Re: [U-Boot] [PATCH v3 01/18] tools: MediaTek: add MTK boot header generation to mkimage
On Sat, 2018-11-03 at 00:08 -0600, Simon Glass wrote: > On 2 November 2018 at 09:15, Ryder Lee wrote: > > This patch adds support for MTK boot image generation. > > > > Signed-off-by: Weijie Gao > > Signed-off-by: Ryder Lee > > --- > > Makefile | 20 ++ > > common/image.c | 1 + > > include/image.h | 1 + > > scripts/Makefile.spl | 11 + > > tools/Makefile | 1 + > > tools/mtk_image.c| 749 > > +++ > > tools/mtk_image.h| 199 ++ > > 7 files changed, 982 insertions(+) > > create mode 100644 tools/mtk_image.c > > create mode 100644 tools/mtk_image.h > > It would help to use patman so that we get a changelog on each patch. > > Reviewed-by: Simon Glass I forgot to add changelog on each patch. Sorry for the inconvenience. Ryder ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3 06/18] clk: MediaTek: add clock driver for MT7629 SoC.
On Sat, 2018-11-03 at 00:08 -0600, Simon Glass wrote: > Hi Ryder, > > On 2 November 2018 at 09:15, Ryder Lee wrote: > > This patch adds clock modules for MediaTek SoCs: > > - Shared part: a common driver which contains the general operations > > for plls, muxes, dividers and gates so that we can reuse it in future. > > > > - Specific SoC part: the group of structures used to hold the hardware > > configuration for each SoC. > > > > We take MT7629 as an example to demonstrate how to implement driver if > > any other MediaTek chips would like to use it. > > > > Signed-off-by: Ryder Lee > > --- > > drivers/clk/Makefile | 1 + > > drivers/clk/mediatek/Makefile | 6 + > > drivers/clk/mediatek/clk-mt7629.c | 709 > > ++ > > drivers/clk/mediatek/clk-mtk.c| 492 ++ > > drivers/clk/mediatek/clk-mtk.h| 153 > > 5 files changed, 1361 insertions(+) > > create mode 100644 drivers/clk/mediatek/Makefile > > create mode 100644 drivers/clk/mediatek/clk-mt7629.c > > create mode 100644 drivers/clk/mediatek/clk-mtk.c > > create mode 100644 drivers/clk/mediatek/clk-mtk.h > > Please add coments to the structs and functions in the header file. > Also put a _common prefix on the functions that are called from other > files. > > Otherwise: > > Reviewed-by: Simon Glass > > Regards, > Simon Got it. I will send a new series soon. Ryder ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 0/3] mtd: Fix partition handling code
On Wed, Oct 31, 2018 at 3:38 PM Boris Brezillon wrote: > > Hello, > > Stefan recently reported a bug when using ubi part on a spi-nand > device and proposed this fix[1]. While his solution while working > I proposed a different approach to kill the CMD_UBI dependency on > CMD_MTDPARTS. This is what patches 1 and 2 are doing. > > Patch 3 is just removing the duplicate Kconfig MTD_PARTITIONS entry. > > Jagan, can you queue those patches to one of your branch and send a > fixes PR, unless Tom prefers to take them directly. > > Regards, > > Boris > > Boris Brezillon (3): > mtd: Use default mtdparts/mtids when not defined in the environment > cmd: ubi: Remove useless call to mtdparts_init() > mtd: Drop duplicate MTD_PARTITIONS Kconfig option Applied to u-boot-spi/master ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3 14/18] serial: 16550: allow the driver to support MediaTek serial
On Mon, 2018-11-05 at 10:20 +0800, Ryder Lee wrote: > On Sat, 2018-11-03 at 00:09 -0600, Simon Glass wrote: > > Hi Ryder, > > > > On 2 November 2018 at 09:15, Ryder Lee wrote: > > > This patch adds an extra operation in ns16550.c to suuport MediaTek > > > SoCs as we have a highspeed register which influences the calcualtion > > > of the divisor. > > > > > > Note that we don't support the baudrate greater than 115200 currently. > > > > > > Signed-off-by: Ryder Lee > > > Tested-by: Matthias Brugger > > > Reviewed-by: Simon Glass > > > --- > > > drivers/serial/ns16550.c | 10 ++ > > > 1 file changed, 10 insertions(+) > > > > Actually it seems to me that we should have a compatible string for > > this and deal with this at run-time? > > > > Is that easy to do here? > > > > How about this: > > uart0: serial@11002000 { > compatible = "ns16550a"; > > mediatek,highspeed = <0>; > > > Ryder > Sorry, I didn't get it right. I will add a compatible string in ns16550_serial_ids[] for MTK chips. Ryder ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] sunxi: Fix memory 2-rank initialization for a33 cpu
On Wed, Oct 31, 2018 at 08:03:16PM +0100, Michael Trimarchi wrote: > When we initialize the memory we need to autodetect rank and size > but this can happen only if we send the proper reset to both > memory module including cke signal. > For this reason we need initialize the physical on both channel because > we need to presume that both are connected. This way let the CLKE to be > activated at the right time with the memory reset coming from the cpu > > Signed-off-by: Michael Trimarchi Acked-by: Maxime Ripard Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 00/14] efi: make efi and bootmgr more usable
This patch set is a collection of patches to enhance efi user interfaces /commands. It will help improve user experience on efi boot and make it more usable *without* edk2's shell utility. Let's see how it works: => efishell boot add 1 SHELL mmc 0:1 /Shell.efi "" => efishell boot add 2 HELLO mmc 0:1 /hello.efi "" => efishell boot dump Boot0001: attributes: A-- (0x0001) label: SHELL file_path: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(1,MBR,0x086246ba,0x800,0x4)/\\Shell.efi data: Boot0002: attributes: A-- (0x0001) label: HELLO file_path: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(1,MBR,0x086246ba,0x800,0x4)/\\hello.efi data: => efishell boot order 1 2 => efishell boot order 1: Boot0001: SHELL 2: Boot0002: HELLO => run -e Boot0002 (or bootefi bootmgr - 2) ; '-' means no dtb specified WARNING: booting without device tree Booting: HELLO ## Starting EFI application at 7db8b040 ... Hello, world! ## Application terminated, r = 0 => env set -e PlatformLang en ; important! (or you can do "efishell setvar PlatformLang en") => env print -e Boot0001: {boot,run}(blob) : 01 00 00 00 68 00 53 00 h.S. 0010: 48 00 45 00 4c 00 4c 00 H.E.L.L. 0020: 00 00 01 04 14 00 b9 73 ...s 0030: 1d e6 84 a3 cc 4a ae ab .J.. 0040: 82 e8 28 f3 62 8b 03 1a ..(.b... 0050: 05 00 00 03 1a 05 00 00 0060: 04 01 2a 00 01 00 00 00 ..*. 0070: 00 08 00 00 00 00 00 00 0080: 00 00 04 00 00 00 00 00 0090: ba 46 62 08 00 00 00 00 .Fb. 00a0: 00 00 00 00 00 00 00 00 00b0: 01 01 04 04 1c 00 5c 00 ..\. 00c0: 5c 00 53 00 68 00 65 00 \.S.h.e. 00d0: 6c 00 6c 00 2e 00 65 00 l.l...e. 00e0: 66 00 69 00 00 00 7f ff f.i 00f0: 04 00 00 ... Boot0002: {boot,run}(blob) : 01 00 00 00 68 00 48 00 h.H. 0010: 45 00 4c 00 4c 00 4f 00 E.L.L.O. 0020: 00 00 01 04 14 00 b9 73 ...s 0030: 1d e6 84 a3 cc 4a ae ab .J.. 0040: 82 e8 28 f3 62 8b 03 1a ..(.b... 0050: 05 00 00 03 1a 05 00 00 0060: 04 01 2a 00 01 00 00 00 ..*. 0070: 00 08 00 00 00 00 00 00 0080: 00 00 04 00 00 00 00 00 0090: ba 46 62 08 00 00 00 00 .Fb. 00a0: 00 00 00 00 00 00 00 00 00b0: 01 01 04 04 1c 00 5c 00 ..\. 00c0: 5c 00 68 00 65 00 6c 00 \.h.e.l. 00d0: 6c 00 6f 00 2e 00 65 00 l.o...e. 00e0: 66 00 69 00 00 00 7f ff f.i 00f0: 04 00 00 ... BootOrder: {boot,run}(blob) : 01 00 02 00 OsIndicationsSupported: {ro,boot}(blob) : 00 00 00 00 00 00 00 00 PlatformLang: {boot,run}(blob) : 65 6een => run -e Boot0001 or bootefi bootmgr (shell ...) "setvar" command now supports efi shell-like syntax: => env set -e foo =S\"akashi\" =0x012345 =Habcdef => env print -e foo foo: {boot,run}(blob) : 61 6b 61 73 68 69 45 23 akashiE# 0010: 01 00 ab cd ef . Other useful sub commands are: => efishell devices ; print uefi devices => efishell drivers ; print uefi drivers => efishell images ; print loaded images => efishell dh ; print uefi handles => efishell memmap ; dump uefi memory map # I admit there is some room to improve the output from those commands. Enjoy! -Takahiro Akashi Changes in v2 (Nov 5, 2018) * modify efi_dp_from_name() for use in efishell * rename efi_marshal_load_option() to efi_serialize_load_option(), taking a "struct efi_load_option" as an argument * improve a format in dumping uefi variables * enhance a setvar syntax as efi's shell does * change a syntax from "bootefi bootmgr -2" to "bootefi bootmgr - 2" * add -e option to run command * add -e option to env command * add more sub-commands AKASHI Takahiro (14): efi_loader: allow device == NULL in efi_dp_from_name() efi_loader: bootmgr: add load option helper functions efi_loader: bootmgr: allow for running a given load option cmd: add efishell command cmd: efishell: add devices command cmd: efishell: add drivers command cmd: efishell: add images command cmd: efishell: add memmap command cmd: efishell: add dh command cmd: bootefi: carve out fdt parameter handling cmd: bootefi: run an EFI application of a specific load option cmd: run: add "-e" option to run an EFI application cmd: efishell: export uefi variable helper functions cmd: env: add "-e" option for handling UEFI variables cmd/Makefile | 2 +- cmd/bootefi.c| 71 ++- cmd/efishell.c | 970 +++ cmd/ef
[U-Boot] [PATCH v2 01/14] efi_loader: allow device == NULL in efi_dp_from_name()
This is a preparatory patch for use in efi_serialize_load_option() as a load option's file_path should have both a device path and a file path. Signed-off-by: AKASHI Takahiro --- lib/efi_loader/efi_device_path.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index cdf7c7be8c5c..d94982314a3e 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -955,7 +955,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, char filename[32] = { 0 }; /* dp->str is u16[32] long */ char *s; - if (!device || (path && !file)) + if (path && !file) return EFI_INVALID_PARAMETER; is_net = !strcmp(dev, "Net"); @@ -965,10 +965,12 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, if (part < 0) return EFI_INVALID_PARAMETER; - *device = efi_dp_from_part(desc, part); + if (device) + *device = efi_dp_from_part(desc, part); } else { #ifdef CONFIG_NET - *device = efi_dp_from_eth(); + if (device) + *device = efi_dp_from_eth(); #endif } @@ -985,7 +987,8 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, s = filename; while ((s = strchr(s, '/'))) *s++ = '\\'; - *file = efi_dp_from_file(NULL, 0, filename); + *file = efi_dp_from_file(((!is_net && device) ? desc : NULL), +part, filename); return EFI_SUCCESS; } -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 06/14] cmd: efishell: add drivers command
"drivers" command prints all the uefi drivers on the system. => efi drivers Driver Name Image Path (unknown) +(not found) guid: 18a031ab-b443-4d1a-a5c0-0c09261e9f71 Currently, no useful information can be printed. Signed-off-by: AKASHI Takahiro --- cmd/efishell.c | 95 +- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/cmd/efishell.c b/cmd/efishell.c index f4fa3fdf28a7..2f54f7803ac5 100644 --- a/cmd/efishell.c +++ b/cmd/efishell.c @@ -346,6 +346,95 @@ static int do_efi_show_devices(int argc, char * const argv[]) return CMD_RET_SUCCESS; } +static int efi_get_driver_handle_info(efi_handle_t handle, u16 **name, + u16 **devname, u16 **filename) +{ + struct efi_driver_binding_protocol *binding; + struct efi_loaded_image *image; + efi_status_t ret; + + ret = bs->open_protocol(handle, &efi_guid_driver_binding_protocol, + (void **)&binding, NULL, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (ret != EFI_SUCCESS) + return -1; + + ret = bs->open_protocol(binding->image_handle, &efi_guid_loaded_image, + (void **)&image, NULL /* FIXME */, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (ret != EFI_SUCCESS) + goto e_out; + + /* +* TODO: +* handle image->device_handle, +* use append_device_path() +*/ + *devname = NULL; + *filename = efi_dp_str(image->file_path); + + return 0; + +e_out: + *devname = NULL; + *filename = L"(not found)"; + + return 0; +} + +static int do_efi_show_drivers(int argc, char * const argv[]) +{ + efi_handle_t *handles = NULL, *handle; + efi_uintn_t size = 0; + u16 *drvname, *devname, *filename; + efi_status_t ret; + int i; + + ret = bs->locate_handle(BY_PROTOCOL, &efi_guid_driver_binding_protocol, + NULL, &size, NULL); + if (ret == EFI_BUFFER_TOO_SMALL) { + handles = calloc(1, size); + if (!handles) + return CMD_RET_FAILURE; + + ret = bs->locate_handle(BY_PROTOCOL, + &efi_guid_driver_binding_protocol, + NULL, &size, handles); + } + if (ret != EFI_SUCCESS) { + free(handles); + return CMD_RET_FAILURE; + } + + printf("Driver Name Image Path\n"); + printf("\n"); + handle = handles; + for (i = 0; i < size / sizeof(*handle); i++) { + if (!efi_get_driver_handle_info(*handle, &drvname, &devname, + &filename)) { + printf("%-16s%ls+%ls\n", + "(unknown)", devname, filename); + efi_free_pool(devname); + efi_free_pool(filename); + + /* TODO: no other info */ + struct efi_object *efiobj; + struct list_head *lhandle; + struct efi_handler *protocol; + + efiobj = efi_search_obj(*handle); + list_for_each(lhandle, &efiobj->protocols) { + protocol = list_entry(lhandle, + struct efi_handler, link); + printf("guid: %pUl\n", protocol->guid); + } + } + handle++; + } + + return CMD_RET_SUCCESS; +} + static int do_efi_boot_add(int argc, char * const argv[]) { int id; @@ -726,6 +815,8 @@ static int do_efishell(cmd_tbl_t *cmdtp, int flag, return do_efi_set_var(argc, argv); else if (!strcmp(command, "devices")) return do_efi_show_devices(argc, argv); + else if (!strcmp(command, "drivers")) + return do_efi_show_drivers(argc, argv); else return CMD_RET_USAGE; } @@ -749,7 +840,9 @@ static char efishell_help_text[] = " - set/delete uefi variable's value\n" " may be \"=\"...\"\", \"=0x...\" (set) or \"=\" (delete)\n" "efishell devices\n" - " - show uefi devices\n"; + " - show uefi devices\n" + "efishell drivers\n" + " - show uefi drivers\n"; #endif U_BOOT_CMD( -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 03/14] efi_loader: bootmgr: allow for running a given load option
With an extra argument, efi_bootmgr_load() can now load an efi binary based on a "Boot" variable specified. Signed-off-by: AKASHI Takahiro --- include/efi_loader.h | 3 ++- lib/efi_loader/efi_bootmgr.c | 8 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index d83de906fbce..ce0f420b5004 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -540,7 +540,8 @@ struct efi_load_option { void efi_deserialize_load_option(struct efi_load_option *lo, u8 *data); unsigned long efi_serialize_load_option(struct efi_load_option *lo, u8 **data); -void *efi_bootmgr_load(struct efi_device_path **device_path, +void *efi_bootmgr_load(int boot_id, + struct efi_device_path **device_path, struct efi_device_path **file_path); #else /* CONFIG_IS_ENABLED(EFI_LOADER) */ diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index a095df3f540b..74eb832a8c92 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -170,7 +170,8 @@ error: * available load-options, finding and returning the first one that can * be loaded successfully. */ -void *efi_bootmgr_load(struct efi_device_path **device_path, +void *efi_bootmgr_load(int boot_id, + struct efi_device_path **device_path, struct efi_device_path **file_path) { uint16_t *bootorder; @@ -183,6 +184,11 @@ void *efi_bootmgr_load(struct efi_device_path **device_path, bs = systab.boottime; rs = systab.runtime; + if (boot_id != -1) { + image = try_load_entry(boot_id, device_path, file_path); + goto error; + } + bootorder = get_var(L"BootOrder", &efi_global_variable_guid, &size); if (!bootorder) goto error; -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 02/14] efi_loader: bootmgr: add load option helper functions
In this patch, helper functions for an load option variable (Boot) are added: * efi_deserialize_load_option(): parse a string into load_option data (renamed from parse_load_option and exported) * efi_serialize_load_option(): convert load_option data into a string Those functions will be used to implement efishell command. Signed-off-by: AKASHI Takahiro --- include/efi_loader.h | 23 + lib/efi_loader/efi_bootmgr.c | 93 +++- 2 files changed, 83 insertions(+), 33 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index 5c2485bd03e4..d83de906fbce 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -517,6 +517,29 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, efi_guid_t *vendor, u32 attributes, efi_uintn_t data_size, void *data); +/* + * See section 3.1.3 in the v2.7 UEFI spec for more details on + * the layout of EFI_LOAD_OPTION. In short it is: + * + *typedef struct _EFI_LOAD_OPTION { + *UINT32 Attributes; + *UINT16 FilePathListLength; + *// CHAR16 Description[]; <-- variable length, NULL terminated + *// EFI_DEVICE_PATH_PROTOCOL FilePathList[]; + * <-- FilePathListLength bytes + *// UINT8 OptionalData[]; + *} EFI_LOAD_OPTION; + */ +struct efi_load_option { + u32 attributes; + u16 file_path_length; + u16 *label; + struct efi_device_path *file_path; + u8 *optional_data; +}; + +void efi_deserialize_load_option(struct efi_load_option *lo, u8 *data); +unsigned long efi_serialize_load_option(struct efi_load_option *lo, u8 **data); void *efi_bootmgr_load(struct efi_device_path **device_path, struct efi_device_path **file_path); diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index 2aae12e15456..a095df3f540b 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -9,6 +9,7 @@ #include #include #include +#include static const struct efi_boot_services *bs; static const struct efi_runtime_services *rs; @@ -30,42 +31,68 @@ static const struct efi_runtime_services *rs; */ -/* - * See section 3.1.3 in the v2.7 UEFI spec for more details on - * the layout of EFI_LOAD_OPTION. In short it is: - * - *typedef struct _EFI_LOAD_OPTION { - *UINT32 Attributes; - *UINT16 FilePathListLength; - *// CHAR16 Description[]; <-- variable length, NULL terminated - *// EFI_DEVICE_PATH_PROTOCOL FilePathList[]; <-- FilePathListLength bytes - *// UINT8 OptionalData[]; - *} EFI_LOAD_OPTION; - */ -struct load_option { - u32 attributes; - u16 file_path_length; - u16 *label; - struct efi_device_path *file_path; - u8 *optional_data; -}; - -/* parse an EFI_LOAD_OPTION, as described above */ -static void parse_load_option(struct load_option *lo, void *ptr) +/* Parse serialized data and transform it into efi_load_option structure */ +void efi_deserialize_load_option(struct efi_load_option *lo, u8 *data) { - lo->attributes = *(u32 *)ptr; - ptr += sizeof(u32); + lo->attributes = get_unaligned_le32(data); + data += sizeof(u32); + + lo->file_path_length = get_unaligned_le16(data); + data += sizeof(u16); - lo->file_path_length = *(u16 *)ptr; - ptr += sizeof(u16); + /* FIXME */ + lo->label = (u16 *)data; + data += (u16_strlen(lo->label) + 1) * sizeof(u16); - lo->label = ptr; - ptr += (u16_strlen(lo->label) + 1) * 2; + /* FIXME */ + lo->file_path = (struct efi_device_path *)data; + data += lo->file_path_length; - lo->file_path = ptr; - ptr += lo->file_path_length; + lo->optional_data = data; +} - lo->optional_data = ptr; +/* + * Serialize efi_load_option structure into byte stream for Boot. + * Return a size of allocated data. + */ +unsigned long efi_serialize_load_option(struct efi_load_option *lo, u8 **data) +{ + unsigned long label_len, option_len; + unsigned long size; + u8 *p; + + label_len = (u16_strlen(lo->label) + 1) * sizeof(u16); + option_len = strlen((char *)lo->optional_data); + + /* total size */ + size = sizeof(lo->attributes); + size += sizeof(lo->file_path_length); + size += label_len; + size += lo->file_path_length; + size += option_len + 1; + p = malloc(size); + if (!p) + return 0; + + /* copy data */ + *data = p; + memcpy(p, &lo->attributes, sizeof(lo->attributes)); + p += sizeof(lo->attributes); + + memcpy(p, &lo->file_path_length, sizeof(lo->file_path_length)); + p += sizeof(lo->file_path_length); + + memcpy(p, lo->label, label_len); + p += label_len; + + memcpy(p, lo->
[U-Boot] [PATCH v2 09/14] cmd: efishell: add dh command
"dh" command prints all the uefi handles used in the system. => efishell dh (T.B.D.) 0: (protocol info not available) 1: (protocol info not available) 2: (protocol info not available) 3: (protocol info not available) 4: (protocol info not available) 5: (protocol info not available) 6: (protocol info not available) 7: (protocol info not available) 8: (protocol info not available) 9: (protocol info not available) 10: (protocol info not available) 11: (protocol info not available) 12: (protocol info not available) 13: (protocol info not available) 14: (protocol info not available) 15: (protocol info not available) Signed-off-by: AKASHI Takahiro --- cmd/efishell.c | 33 - 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/cmd/efishell.c b/cmd/efishell.c index 3e1118a407ff..bd2b99e74079 100644 --- a/cmd/efishell.c +++ b/cmd/efishell.c @@ -514,6 +514,33 @@ static int do_efi_show_memmap(int argc, char * const argv[]) return CMD_RET_SUCCESS; } +static char *efi_get_proto_info(efi_handle_t handle) +{ + return strdup("(protocol info not available)"); +} + +static int do_efi_show_handles(int argc, char * const argv[]) +{ + efi_handle_t *handles = NULL, *handle; + char *info; + int i; + + handles = efi_get_handles_by_proto(NULL); + if (!handles) + return CMD_RET_SUCCESS; + + for (handle = handles, i = 0; *handle; handle++, i++) { + /* TODO: depends on protocols */ + info = efi_get_proto_info(*handle); + printf("%d: %s\n", i, info ?: ""); + free(info); + } + + free(handles); + + return CMD_RET_SUCCESS; +} + static int do_efi_boot_add(int argc, char * const argv[]) { int id; @@ -900,6 +927,8 @@ static int do_efishell(cmd_tbl_t *cmdtp, int flag, return do_efi_show_images(argc, argv); else if (!strcmp(command, "memmap")) return do_efi_show_memmap(argc, argv); + else if (!strcmp(command, "dh")) + return do_efi_show_handles(argc, argv); else return CMD_RET_USAGE; } @@ -929,7 +958,9 @@ static char efishell_help_text[] = "efishell images\n" " - show loaded images\n" "efishell memmap\n" - " - show uefi memory map\n"; + " - show uefi memory map\n" + "efishell dh\n" + " - show uefi handles\n"; #endif U_BOOT_CMD( -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 12/14] cmd: run: add "-e" option to run an EFI application
"run -e" allows for executing EFI application with a specific "Boot" variable. If no "Boot" is specified or "BootOrder" is specified, it tries to run an EFI application specified in the order of "bootOrder." Signed-off-by: AKASHI Takahiro --- cmd/bootefi.c | 2 +- cmd/nvedit.c | 5 + common/cli.c | 30 ++ include/command.h | 3 +++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 7580008f691b..3cefb4d0ecaa 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -509,7 +509,7 @@ exit: return ret; } -static int do_bootefi_bootmgr_exec(int boot_id) +int do_bootefi_bootmgr_exec(int boot_id) { struct efi_device_path *device_path, *file_path; void *addr; diff --git a/cmd/nvedit.c b/cmd/nvedit.c index de16c72c23f2..c0facabfc4fe 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -1343,8 +1343,13 @@ U_BOOT_CMD( U_BOOT_CMD_COMPLETE( run,CONFIG_SYS_MAXARGS, 1, do_run, "run commands in an environment variable", +#if defined(CONFIG_CMD_BOOTEFI) + "var -e [Boot]\n" + "- load and run UEFI app based on 'Boot' UEFI variable", +#else "var [...]\n" "- run the commands in the environment variable(s) 'var'", +#endif var_complete ); #endif diff --git a/common/cli.c b/common/cli.c index 51b8d5f85cbb..e4ec35b5eb00 100644 --- a/common/cli.c +++ b/common/cli.c @@ -14,6 +14,7 @@ #include #include #include +#include "../cmd/efishell.h" DECLARE_GLOBAL_DATA_PTR; @@ -125,6 +126,35 @@ int do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (argc < 2) return CMD_RET_USAGE; +#ifdef CONFIG_CMD_BOOTEFI + if (!strcmp(argv[1], "-e")) { + int boot_id = -1; + char *endp; + + if (argc == 3) { + if (!strcmp(argv[2], "BootOrder")) { + /* boot_id = -1 */; + } else if (!strncmp(argv[2], "Boot", 4)) { + boot_id = (int)simple_strtoul(&argv[2][4], + &endp, 0); + if ((argv[2] + strlen(argv[2]) != endp) || + boot_id > 0x) + return CMD_RET_USAGE; + } else { + return CMD_RET_USAGE; + } + } + + if (efi_init_obj_list()) + return CMD_RET_FAILURE; + + if (efi_handle_fdt(NULL)) + return CMD_RET_FAILURE; + + return do_bootefi_bootmgr_exec(boot_id); + } +#endif + for (i = 1; i < argc; ++i) { char *arg; diff --git a/include/command.h b/include/command.h index 5b1577f3b477..5bb675122cce 100644 --- a/include/command.h +++ b/include/command.h @@ -48,6 +48,9 @@ typedef struct cmd_tbl_s cmd_tbl_t; #if defined(CONFIG_CMD_RUN) extern int do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); #endif +#if defined(CONFIG_CMD_BOOTEFI) +int do_bootefi_bootmgr_exec(int boot_id); +#endif /* common/command.c */ int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp, int -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 14/14] cmd: env: add "-e" option for handling UEFI variables
"env [print|set] -e" allows for handling uefi variables without knowing details about mapping to corresponding u-boot variables. Signed-off-by: AKASHI Takahiro --- cmd/nvedit.c | 58 +++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/cmd/nvedit.c b/cmd/nvedit.c index c0facabfc4fe..1925483c0285 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -36,6 +36,7 @@ #include #include #include +#include "efishell.h" DECLARE_GLOBAL_DATA_PTR; @@ -119,6 +120,25 @@ static int do_env_print(cmd_tbl_t *cmdtp, int flag, int argc, int rcode = 0; int env_flag = H_HIDE_DOT; +#if defined(CONFIG_CMD_BOOTEFI) + if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'e') { + efi_status_t r; + + argc--; + argv++; + + /* Initialize EFI drivers */ + r = efi_init_obj_list(); + if (r != EFI_SUCCESS) { + printf("Error: Cannot set up EFI drivers, r = %lu\n", + r & ~EFI_ERROR_MASK); + return CMD_RET_FAILURE; + } + + return do_efi_dump_var(argc, argv); + } +#endif + if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'a') { argc--; argv++; @@ -216,6 +236,26 @@ static int _do_env_set(int flag, int argc, char * const argv[], int env_flag) ENTRY e, *ep; debug("Initial value for argc=%d\n", argc); + +#if defined(CONFIG_CMD_BOOTEFI) + if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'e') { + efi_status_t r; + + argc--; + argv++; + + /* Initialize EFI drivers */ + r = efi_init_obj_list(); + if (r != EFI_SUCCESS) { + printf("Error: Cannot set up EFI drivers, r = %lu\n", + r & ~EFI_ERROR_MASK); + return CMD_RET_FAILURE; + } + + return do_efi_set_var(argc, argv); + } +#endif + while (argc > 1 && **(argv + 1) == '-') { char *arg = *++argv; @@ -1262,15 +1302,23 @@ static char env_help_text[] = #if defined(CONFIG_CMD_IMPORTENV) "env import [-d] [-t [-r] | -b | -c] addr [size] [var ...] - import environment\n" #endif +#if defined(CONFIG_CMD_BOOTEFI) + "env print [-a | -e [name] | name ...] - print environment\n" +#else "env print [-a | name ...] - print environment\n" +#endif #if defined(CONFIG_CMD_RUN) "env run var [...] - run commands in an environment variable\n" #endif #if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE) "env save - save environment\n" #endif +#if defined(CONFIG_CMD_BOOTEFI) + "env set [-e | -f] name [arg ...]\n"; +#else "env set [-f] name [arg ...]\n"; #endif +#endif U_BOOT_CMD( env, CONFIG_SYS_MAXARGS, 1, do_env, @@ -1295,6 +1343,10 @@ U_BOOT_CMD_COMPLETE( printenv, CONFIG_SYS_MAXARGS, 1,do_env_print, "print environment variables", "[-a]\n- print [all] values of all environment variables\n" +#if defined(CONFIG_CMD_BOOTEFI) + "printenv -e []\n" + "- print UEFI variable 'name' or all the variables\n" +#endif "printenv name ...\n" "- print value of environment variable 'name'", var_complete @@ -1322,7 +1374,11 @@ U_BOOT_CMD_COMPLETE( U_BOOT_CMD_COMPLETE( setenv, CONFIG_SYS_MAXARGS, 0, do_env_set, "set environment variables", - "[-f] name value ...\n" +#if defined(CONFIG_CMD_BOOTEFI) + "-e []\n" + "- set UEFI variable 'name' to 'value' ...'\n" +#endif + "setenv [-f] name value ...\n" "- [forcibly] set environment variable 'name' to 'value ...'\n" "setenv [-f] name\n" "- [forcibly] delete environment variable 'name'", -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 08/14] cmd: efishell: add memmap command
"memmap" command prints uefi-specific memory map information. => efi memmap Type StartEnd Attributes == CONVENTIONAL 4000-7de27000 WB RUNTIME DATA 7de27000-7de28000 WB|RT RESERVED 7de28000-7de2a000 WB RUNTIME DATA 7de2a000-7de2b000 WB|RT RESERVED 7de2b000-7de2c000 WB RUNTIME DATA 7de2c000-7de2d000 WB|RT LOADER DATA 7de2d000-7ff37000 WB RUNTIME CODE 7ff37000-7ff38000 WB|RT LOADER DATA 7ff38000-8000 WB Signed-off-by: AKASHI Takahiro --- cmd/efishell.c | 78 +- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/cmd/efishell.c b/cmd/efishell.c index b5050d63fa22..3e1118a407ff 100644 --- a/cmd/efishell.c +++ b/cmd/efishell.c @@ -442,6 +442,78 @@ static int do_efi_show_images(int argc, char * const argv[]) return CMD_RET_SUCCESS; } +static const char * const efi_mem_type_string[] = { + [EFI_RESERVED_MEMORY_TYPE] = "RESERVED", + [EFI_LOADER_CODE] = "LOADER CODE", + [EFI_LOADER_DATA] = "LOADER DATA", + [EFI_BOOT_SERVICES_CODE] = "BOOT CODE", + [EFI_BOOT_SERVICES_DATA] = "BOOT DATA", + [EFI_RUNTIME_SERVICES_CODE] = "RUNTIME CODE", + [EFI_RUNTIME_SERVICES_DATA] = "RUNTIME DATA", + [EFI_CONVENTIONAL_MEMORY] = "CONVENTIONAL", + [EFI_UNUSABLE_MEMORY] = "UNUSABLE MEM", + [EFI_ACPI_RECLAIM_MEMORY] = "ACPI RECLAIM MEM", + [EFI_ACPI_MEMORY_NVS] = "ACPI NVS", + [EFI_MMAP_IO] = "IO", + [EFI_MMAP_IO_PORT] = "IO PORT", + [EFI_PAL_CODE] = "PAL", +}; + +#define EFI_MEM_ATTR(attribute, bit, string) \ + if ((attribute) & (bit)) { \ + if (sep)\ + putc('|'); \ + sep = 1;\ + printf(string); \ + } + +static int do_efi_show_memmap(int argc, char * const argv[]) +{ + struct efi_mem_desc *map = NULL; + efi_uintn_t map_size = 0; + int i, sep; + efi_status_t ret; + + ret = efi_get_memory_map(&map_size, map, NULL, NULL, NULL); + if (ret == EFI_BUFFER_TOO_SMALL) { + map = malloc(map_size); + if (!map) + return CMD_RET_FAILURE; + ret = efi_get_memory_map(&map_size, map, NULL, NULL, NULL); + } + if (ret != EFI_SUCCESS) + return CMD_RET_FAILURE; + + ret = efi_get_memory_map(&map_size, map, NULL, NULL, NULL); + if (ret != EFI_SUCCESS) + return CMD_RET_FAILURE; + + printf("Type StartEnd Attributes\n"); + printf(" ==\n"); + for (i = 0; i < map_size / sizeof(*map); map++, i++) { + sep = 0; + printf("%-16s %016llx-%016llx ", + efi_mem_type_string[map->type], + map->physical_start, + map->physical_start + map->num_pages * EFI_PAGE_SIZE); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_UC, "UC"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_WC, "WC"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_WT, "WT"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_WB, "WB"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_UCE, "UCE"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_WP, "WP"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_RP, "RP"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_XP, "WP"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_NV, "NV"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_MORE_RELIABLE, "REL"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_RO, "RO"); + EFI_MEM_ATTR(map->attribute, EFI_MEMORY_RUNTIME, "RT"); + putc('\n'); + } + + return CMD_RET_SUCCESS; +} + static int do_efi_boot_add(int argc, char * const argv[]) { int id; @@ -826,6 +898,8 @@ static int do_efishell(cmd_tbl_t *cmdtp, int flag, return do_efi_show_drivers(argc, argv); else if (!strcmp(command, "images")) return do_efi_show_images(argc, argv); + else if (!strcmp(command, "memmap")) + return do_efi_show_memmap(argc, argv); else return CMD_RET_USAGE; } @@ -853,7 +927,9 @@ static char efishell_help_text[] = "efishell drivers\n" " - show uefi drivers\n" "efishell images\n" - " - show loaded images\n"; + " - show loaded images\n" + "efishell memmap\n" + " - show uefi memory map\n"; #endif U_BOOT_CMD( -- 2.19.0 ___ U-B
[U-Boot] [PATCH v2 05/14] cmd: efishell: add devices command
"devices" command prints all the uefi variables on the system. => efishell devices Device Name /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b) /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0) /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/\ HD(2,MBR,0x086246ba,0x40800,0x3f800) /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/\ HD(1,MBR,0x086246ba,0x800,0x4) Signed-off-by: AKASHI Takahiro --- cmd/efishell.c | 88 +- 1 file changed, 87 insertions(+), 1 deletion(-) diff --git a/cmd/efishell.c b/cmd/efishell.c index abc8216c7bd6..f4fa3fdf28a7 100644 --- a/cmd/efishell.c +++ b/cmd/efishell.c @@ -21,6 +21,8 @@ DECLARE_GLOBAL_DATA_PTR; +static const struct efi_boot_services *bs; + static void dump_var_data(char *data, unsigned long len) { char *start, *end, *p; @@ -266,6 +268,84 @@ out: return ret; } +static efi_handle_t *efi_get_handles_by_proto(efi_guid_t *guid) +{ + efi_handle_t *handles = NULL; + efi_uintn_t size = 0; + efi_status_t ret; + + if (guid) { + ret = bs->locate_handle(BY_PROTOCOL, guid, NULL, &size, + handles); + if (ret == EFI_BUFFER_TOO_SMALL) { + handles = calloc(1, size); + if (!handles) + return NULL; + + ret = bs->locate_handle(BY_PROTOCOL, guid, NULL, &size, + handles); + } + if (ret != EFI_SUCCESS) { + free(handles); + return NULL; + } + } else { + ret = bs->locate_handle(ALL_HANDLES, NULL, NULL, &size, NULL); + if (ret == EFI_BUFFER_TOO_SMALL) { + handles = calloc(1, size); + if (!handles) + return NULL; + + ret = bs->locate_handle(ALL_HANDLES, NULL, NULL, &size, + handles); + } + if (ret != EFI_SUCCESS) { + free(handles); + return NULL; + } + } + + return handles; +} + +static int efi_get_device_handle_info(efi_handle_t handle, u16 **name) +{ + struct efi_device_path *dp; + efi_status_t ret; + + ret = bs->open_protocol(handle, &efi_guid_device_path, + (void **)&dp, NULL /* FIXME */, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (ret == EFI_SUCCESS) { + *name = efi_dp_str(dp); + return 0; + } else { + return -1; + } +} + +static int do_efi_show_devices(int argc, char * const argv[]) +{ + efi_handle_t *handles = NULL, *handle; + u16 *devname; + + handles = efi_get_handles_by_proto(NULL); + if (!handles) + return CMD_RET_SUCCESS; + + printf("Device Name\n"); + printf("\n"); + for (handle = handles; *handle; handle++) { + if (!efi_get_device_handle_info(*handle, &devname)) { + printf("%ls\n", devname); + efi_free_pool(devname); + } + handle++; + } + + return CMD_RET_SUCCESS; +} + static int do_efi_boot_add(int argc, char * const argv[]) { int id; @@ -625,6 +705,8 @@ static int do_efishell(cmd_tbl_t *cmdtp, int flag, if (argc < 2) return CMD_RET_USAGE; + bs = systab.boottime; + argc--; argv++; command = argv[0]; @@ -642,6 +724,8 @@ static int do_efishell(cmd_tbl_t *cmdtp, int flag, return do_efi_dump_var(argc, argv); else if (!strcmp(command, "setvar")) return do_efi_set_var(argc, argv); + else if (!strcmp(command, "devices")) + return do_efi_show_devices(argc, argv); else return CMD_RET_USAGE; } @@ -663,7 +747,9 @@ static char efishell_help_text[] = " - get uefi variable's value\n" "efishell setvar []\n" " - set/delete uefi variable's value\n" - " may be \"=\"...\"\", \"=0x...\" (set) or \"=\" (delete)\n"; + " may be \"=\"...\"\", \"=0x...\" (set) or \"=\" (delete)\n" + "efishell devices\n" + " - show uefi devices\n"; #endif U_BOOT_CMD( -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 04/14] cmd: add efishell command
Currently, there is no easy way to add or modify UEFI variables. In particular, bootmgr supports BootOrder/Boot variables, it is quite hard to define them as u-boot variables because they are represented in a complicated and encoded format. The new command, efishell, helps address these issues and give us more friendly interfaces: * efishell boot add: add Boot variable * efishell boot rm: remove Boot variable * efishell boot dump: display all Boot variables * efishell boot order: set/display a boot order (BootOrder) * efishell setvar: set an UEFI variable (with limited functionality) * efishell dumpvar: display all UEFI variables As the name suggests, this command basically provides a subset fo UEFI shell commands with simplified functionality. Signed-off-by: AKASHI Takahiro --- cmd/Makefile | 2 +- cmd/efishell.c | 673 + cmd/efishell.h | 5 + 3 files changed, 679 insertions(+), 1 deletion(-) create mode 100644 cmd/efishell.c create mode 100644 cmd/efishell.h diff --git a/cmd/Makefile b/cmd/Makefile index d9cdaf6064b8..bd531d505a8e 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -24,7 +24,7 @@ obj-$(CONFIG_CMD_BINOP) += binop.o obj-$(CONFIG_CMD_BLOCK_CACHE) += blkcache.o obj-$(CONFIG_CMD_BMP) += bmp.o obj-$(CONFIG_CMD_BOOTCOUNT) += bootcount.o -obj-$(CONFIG_CMD_BOOTEFI) += bootefi.o +obj-$(CONFIG_CMD_BOOTEFI) += bootefi.o efishell.o obj-$(CONFIG_CMD_BOOTMENU) += bootmenu.o obj-$(CONFIG_CMD_BOOTSTAGE) += bootstage.o obj-$(CONFIG_CMD_BOOTZ) += bootz.o diff --git a/cmd/efishell.c b/cmd/efishell.c new file mode 100644 index ..abc8216c7bd6 --- /dev/null +++ b/cmd/efishell.c @@ -0,0 +1,673 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * EFI Shell-like command + * + * Copyright (c) 2018 AKASHI Takahiro, Linaro Limited + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "efishell.h" + +DECLARE_GLOBAL_DATA_PTR; + +static void dump_var_data(char *data, unsigned long len) +{ + char *start, *end, *p; + unsigned long pos, count; + char hex[3], line[9]; + int i; + + end = data + len; + for (start = data, pos = 0; start < end; start += count, pos += count) { + count = end - start; + if (count > 16) + count = 16; + + /* count should be multiple of two */ + printf("%08lx: ", pos); + + /* in hex format */ + p = start; + for (i = 0; i < count / 2; p += 2, i++) + printf(" %c%c", *p, *(p + 1)); + for (; i < 8; i++) + printf(" "); + + /* in character format */ + p = start; + hex[2] = '\0'; + for (i = 0; i < count / 2; i++) { + hex[0] = *p++; + hex[1] = *p++; + line[i] = simple_strtoul(hex, 0, 16); + if (line[i] < 0x20 || line[i] > 0x7f) + line[i] = '.'; + } + line[i] = '\0'; + printf(" %s\n", line); + } +} + +/* + * From efi_variable.c, + * + * Mapping between EFI variables and u-boot variables: + * + * efi_$guid_$varname = {attributes}(type)value + */ +static int do_efi_dump_var(int argc, char * const argv[]) +{ + char regex[256]; + char * const regexlist[] = {regex}; + char *res = NULL, *start, *end; + int len; + + if (argc > 2) + return CMD_RET_USAGE; + + if (argc == 2) + snprintf(regex, 256, "efi_.*-.*-.*-.*-.*_%s", argv[1]); + else + snprintf(regex, 256, "efi_.*-.*-.*-.*-.*_.*"); + debug("%s:%d grep uefi var %s\n", __func__, __LINE__, regex); + + len = hexport_r(&env_htab, '\n', H_MATCH_REGEX | H_MATCH_KEY, + &res, 0, 1, regexlist); + + if (len < 0) + return CMD_RET_FAILURE; + + if (len > 0) { + end = res; + while (true) { + /* variable name */ + start = strchr(end, '_'); + if (!start) + break; + start = strchr(++start, '_'); + if (!start) + break; + end = strchr(++start, '='); + if (!end) + break; + printf("%.*s:", (int)(end - start), start); + end++; + + /* value */ + start = end; + end = strstr(start, "(blob)"); + if (!end) { + putc('\n'); + break; + } +
[U-Boot] [PATCH v2 07/14] cmd: efishell: add images command
"images" command prints loaded images-related information. Signed-off-by: AKASHI Takahiro --- cmd/efishell.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/efishell.c b/cmd/efishell.c index 2f54f7803ac5..b5050d63fa22 100644 --- a/cmd/efishell.c +++ b/cmd/efishell.c @@ -435,6 +435,13 @@ static int do_efi_show_drivers(int argc, char * const argv[]) return CMD_RET_SUCCESS; } +static int do_efi_show_images(int argc, char * const argv[]) +{ + efi_print_image_infos(NULL); + + return CMD_RET_SUCCESS; +} + static int do_efi_boot_add(int argc, char * const argv[]) { int id; @@ -817,6 +824,8 @@ static int do_efishell(cmd_tbl_t *cmdtp, int flag, return do_efi_show_devices(argc, argv); else if (!strcmp(command, "drivers")) return do_efi_show_drivers(argc, argv); + else if (!strcmp(command, "images")) + return do_efi_show_images(argc, argv); else return CMD_RET_USAGE; } @@ -842,7 +851,9 @@ static char efishell_help_text[] = "efishell devices\n" " - show uefi devices\n" "efishell drivers\n" - " - show uefi drivers\n"; + " - show uefi drivers\n" + "efishell images\n" + " - show loaded images\n"; #endif U_BOOT_CMD( -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 11/14] cmd: bootefi: run an EFI application of a specific load option
With this patch applied, we will be able to selectively execute an EFI application by specifying a load option, say "1" for Boot0001, "2" for Boot0002 and so on. => bootefi bootmgr 1, or bootefi bootmgr - 1 Please note that Boot need not be included in "BootOrder". Signed-off-by: AKASHI Takahiro --- cmd/bootefi.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 3aedf5a09f93..7580008f691b 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -509,13 +509,13 @@ exit: return ret; } -static int do_bootefi_bootmgr_exec(void) +static int do_bootefi_bootmgr_exec(int boot_id) { struct efi_device_path *device_path, *file_path; void *addr; efi_status_t r; - addr = efi_bootmgr_load(&device_path, &file_path); + addr = efi_bootmgr_load(boot_id, &device_path, &file_path); if (!addr) return 1; @@ -595,8 +595,20 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } else #endif if (!strcmp(argv[1], "bootmgr")) { - if (efi_handle_fdt(argc > 2 ? argv[2] : NULL)) - return CMD_RET_FAILURE; + char *endp; + int boot_id = -1; + + if (argc > 2) + if (efi_handle_fdt((argv[2][0] == '-') ? + NULL : argv[2])) + return CMD_RET_FAILURE; + + if (argc > 3) { + boot_id = (int)simple_strtoul(argv[3], &endp, 0); + if ((argv[3] + strlen(argv[3]) != endp) || + boot_id > 0x) + return CMD_RET_USAGE; + } return do_bootefi_bootmgr_exec(boot_id); } else { @@ -639,7 +651,7 @@ static char bootefi_help_text[] = "Use environment variable efi_selftest to select a single test.\n" "Use 'setenv efi_selftest list' to enumerate all tests.\n" #endif - "bootefi bootmgr [fdt addr]\n" + "bootefi bootmgr [|'-' []]\n" " - load and boot EFI payload based on BootOrder/Boot variables.\n" "\n" "If specified, the device tree located at gets\n" @@ -647,7 +659,7 @@ static char bootefi_help_text[] = #endif U_BOOT_CMD( - bootefi, 3, 0, do_bootefi, + bootefi, 5, 0, do_bootefi, "Boots an EFI payload from memory", bootefi_help_text ); -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 10/14] cmd: bootefi: carve out fdt parameter handling
The current way how command parameters, particularly "fdt addr," are handled makes it a bit complicated to add a subcommand-specific parameter. So just refactor the code and extract efi_handle_fdt(). This commit is a preparatory change for enhancing bootmgr sub-command. Signed-off-by: AKASHI Takahiro --- cmd/bootefi.c | 51 +- cmd/efishell.h | 1 + 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 5d61819f1f5c..3aedf5a09f93 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -356,6 +356,31 @@ static efi_status_t efi_install_fdt(ulong fdt_addr) return ret; } +int efi_handle_fdt(char *fdt_opt) +{ + unsigned long fdt_addr; + efi_status_t r; + + if (fdt_opt) { + fdt_addr = simple_strtoul(fdt_opt, NULL, 16); + if (!fdt_addr && *fdt_opt != '0') + return CMD_RET_USAGE; + + /* Install device tree */ + r = efi_install_fdt(fdt_addr); + if (r != EFI_SUCCESS) { + printf("ERROR: failed to install device tree\n"); + return CMD_RET_FAILURE; + } + } else { + /* Remove device tree. EFI_NOT_FOUND can be ignored here */ + efi_install_configuration_table(&efi_guid_fdt, NULL); + printf("WARNING: booting without device tree\n"); + } + + return CMD_RET_SUCCESS; +} + /** * do_bootefi_exec() - execute EFI binary * @@ -511,7 +536,6 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) unsigned long addr; char *saddr; efi_status_t r; - unsigned long fdt_addr; /* Allow unaligned memory access */ allow_unaligned(); @@ -527,21 +551,6 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (argc < 2) return CMD_RET_USAGE; - if (argc > 2) { - fdt_addr = simple_strtoul(argv[2], NULL, 16); - if (!fdt_addr && *argv[2] != '0') - return CMD_RET_USAGE; - /* Install device tree */ - r = efi_install_fdt(fdt_addr); - if (r != EFI_SUCCESS) { - printf("ERROR: failed to install device tree\n"); - return CMD_RET_FAILURE; - } - } else { - /* Remove device tree. EFI_NOT_FOUND can be ignored here */ - efi_install_configuration_table(&efi_guid_fdt, NULL); - printf("WARNING: booting without device tree\n"); - } #ifdef CONFIG_CMD_BOOTEFI_HELLO if (!strcmp(argv[1], "hello")) { ulong size = __efi_helloworld_end - __efi_helloworld_begin; @@ -559,6 +568,9 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) struct efi_loaded_image_obj *image_obj; struct efi_loaded_image *loaded_image_info; + if (efi_handle_fdt(argc > 2 ? argv[2] : NULL)) + return CMD_RET_FAILURE; + /* Construct a dummy device path. */ bootefi_device_path = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE, (uintptr_t)&efi_selftest, @@ -583,7 +595,10 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } else #endif if (!strcmp(argv[1], "bootmgr")) { - return do_bootefi_bootmgr_exec(); + if (efi_handle_fdt(argc > 2 ? argv[2] : NULL)) + return CMD_RET_FAILURE; + + return do_bootefi_bootmgr_exec(boot_id); } else { saddr = argv[1]; @@ -592,6 +607,8 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (!addr && *saddr != '0') return CMD_RET_USAGE; + if (efi_handle_fdt(argc > 2 ? argv[2] : NULL)) + return CMD_RET_FAILURE; } printf("## Starting EFI application at %08lx ...\n", addr); diff --git a/cmd/efishell.h b/cmd/efishell.h index 6f70b402b26b..1e5764a8a38d 100644 --- a/cmd/efishell.h +++ b/cmd/efishell.h @@ -3,3 +3,4 @@ #include efi_status_t efi_init_obj_list(void); +int efi_handle_fdt(char *fdt_opt); -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 13/14] cmd: efishell: export uefi variable helper functions
Those function will be used for integration with 'env' command so as to handle uefi variables. Signed-off-by: AKASHI Takahiro --- cmd/efishell.c| 4 ++-- include/command.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/efishell.c b/cmd/efishell.c index bd2b99e74079..8122b842dd76 100644 --- a/cmd/efishell.c +++ b/cmd/efishell.c @@ -68,7 +68,7 @@ static void dump_var_data(char *data, unsigned long len) * * efi_$guid_$varname = {attributes}(type)value */ -static int do_efi_dump_var(int argc, char * const argv[]) +int do_efi_dump_var(int argc, char * const argv[]) { char regex[256]; char * const regexlist[] = {regex}; @@ -228,7 +228,7 @@ out: return 0; } -static int do_efi_set_var(int argc, char * const argv[]) +int do_efi_set_var(int argc, char * const argv[]) { char *var_name, *value = NULL; unsigned long size = 0; diff --git a/include/command.h b/include/command.h index 5bb675122cce..2ce8b53f74c8 100644 --- a/include/command.h +++ b/include/command.h @@ -50,6 +50,8 @@ extern int do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); #endif #if defined(CONFIG_CMD_BOOTEFI) int do_bootefi_bootmgr_exec(int boot_id); +int do_efi_dump_var(int argc, char * const argv[]); +int do_efi_set_var(int argc, char * const argv[]); #endif /* common/command.c */ -- 2.19.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 2/2] spi: pl022: Driver cleanup
- Drop unnecessary include files. - Rename platform_data include file as spi_pl022.h from pl022_spi.h, this is generic notation used for spi platdat include files. Cc: Quentin Schulz Signed-off-by: Jagan Teki --- drivers/spi/pl022_spi.c | 7 +-- include/dm/platform_data/{pl022_spi.h => spi_pl022.h} | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) rename include/dm/platform_data/{pl022_spi.h => spi_pl022.h} (81%) diff --git a/drivers/spi/pl022_spi.c b/drivers/spi/pl022_spi.c index dd27444a43..0ea51f98de 100644 --- a/drivers/spi/pl022_spi.c +++ b/drivers/spi/pl022_spi.c @@ -9,16 +9,11 @@ * Driver for ARM PL022 SPI Controller. */ -#include #include #include #include -#include -#include -#include -#include +#include #include -#include #include #define SSP_CR00x000 diff --git a/include/dm/platform_data/pl022_spi.h b/include/dm/platform_data/spi_pl022.h similarity index 81% rename from include/dm/platform_data/pl022_spi.h rename to include/dm/platform_data/spi_pl022.h index 57d12ac912..36e645c836 100644 --- a/include/dm/platform_data/pl022_spi.h +++ b/include/dm/platform_data/spi_pl022.h @@ -7,8 +7,8 @@ * in ofdata_to_platdata. */ -#ifndef __PL022_SPI_H__ -#define __PL022_SPI_H__ +#ifndef __spi_pl022_h +#define __spi_pl022_h struct pl022_spi_pdata { fdt_addr_t addr; @@ -16,4 +16,4 @@ struct pl022_spi_pdata { unsigned int freq; }; -#endif +#endif /* __spi_pl022_h */ -- 2.18.0.321.gffc6fa0e3 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/2] spi: pl022: Get rid of platdata ifdef's
pl022 spi driver support both OF_CONTROL and PLATDATA and it's using #ifdef check for differentiating platdata vs of_control. So this patch simplify the code and drop the ifdefs Cc: Quentin Schulz Signed-off-by: Jagan Teki --- drivers/spi/pl022_spi.c | 48 include/dm/platform_data/pl022_spi.h | 9 -- 2 files changed, 20 insertions(+), 37 deletions(-) diff --git a/drivers/spi/pl022_spi.c b/drivers/spi/pl022_spi.c index 86b71d2e21..dd27444a43 100644 --- a/drivers/spi/pl022_spi.c +++ b/drivers/spi/pl022_spi.c @@ -72,11 +72,7 @@ struct pl022_spi_slave { void *base; -#if !CONFIG_IS_ENABLED(OF_PLATDATA) - struct clk clk; -#else unsigned int freq; -#endif }; /* @@ -96,30 +92,13 @@ static int pl022_is_supported(struct pl022_spi_slave *ps) return 0; } -#if !CONFIG_IS_ENABLED(OF_PLATDATA) -static int pl022_spi_ofdata_to_platdata(struct udevice *bus) -{ - struct pl022_spi_pdata *plat = bus->platdata; - const void *fdt = gd->fdt_blob; - int node = dev_of_offset(bus); - - plat->addr = fdtdec_get_addr_size(fdt, node, "reg", &plat->size); - - return clk_get_by_index(bus, 0, &plat->clk); -} -#endif - static int pl022_spi_probe(struct udevice *bus) { struct pl022_spi_pdata *plat = dev_get_platdata(bus); struct pl022_spi_slave *ps = dev_get_priv(bus); ps->base = ioremap(plat->addr, plat->size); -#if !CONFIG_IS_ENABLED(OF_PLATDATA) - ps->clk = plat->clk; -#else ps->freq = plat->freq; -#endif /* Check the PL022 version */ if (!pl022_is_supported(ps)) @@ -240,11 +219,7 @@ static int pl022_spi_set_speed(struct udevice *bus, uint speed) u16 scr = SSP_SCR_MIN, cr0 = 0, cpsr = SSP_CPSR_MIN, best_scr = scr, best_cpsr = cpsr; u32 min, max, best_freq = 0, tmp; -#if !CONFIG_IS_ENABLED(OF_PLATDATA) - u32 rate = clk_get_rate(&ps->clk); -#else u32 rate = ps->freq; -#endif bool found = false; max = spi_rate(rate, SSP_CPSR_MIN, SSP_SCR_MIN); @@ -316,6 +291,25 @@ static const struct dm_spi_ops pl022_spi_ops = { }; #if !CONFIG_IS_ENABLED(OF_PLATDATA) +static int pl022_spi_ofdata_to_platdata(struct udevice *bus) +{ + struct pl022_spi_pdata *plat = bus->platdata; + struct udevice *clkdev; + const void *fdt = gd->fdt_blob; + int node = dev_of_offset(bus); + int ret; + + plat->addr = fdtdec_get_addr_size(fdt, node, "reg", &plat->size); + + ret = clk_get_by_index(bus, 0, &clkdev); + if (ret) + return ret; + + plat->freq = clk_get_rate(clkdev); + + return 0; +} + static const struct udevice_id pl022_spi_ids[] = { { .compatible = "arm,pl022-spi" }, { } @@ -327,11 +321,9 @@ U_BOOT_DRIVER(pl022_spi) = { .id = UCLASS_SPI, #if !CONFIG_IS_ENABLED(OF_PLATDATA) .of_match = pl022_spi_ids, -#endif - .ops= &pl022_spi_ops, -#if !CONFIG_IS_ENABLED(OF_PLATDATA) .ofdata_to_platdata = pl022_spi_ofdata_to_platdata, #endif + .ops= &pl022_spi_ops, .platdata_auto_alloc_size = sizeof(struct pl022_spi_pdata), .priv_auto_alloc_size = sizeof(struct pl022_spi_slave), .probe = pl022_spi_probe, diff --git a/include/dm/platform_data/pl022_spi.h b/include/dm/platform_data/pl022_spi.h index 77fe6da3cb..57d12ac912 100644 --- a/include/dm/platform_data/pl022_spi.h +++ b/include/dm/platform_data/pl022_spi.h @@ -10,19 +10,10 @@ #ifndef __PL022_SPI_H__ #define __PL022_SPI_H__ -#if !CONFIG_IS_ENABLED(OF_PLATDATA) -#include -#endif -#include - struct pl022_spi_pdata { fdt_addr_t addr; fdt_size_t size; -#if !CONFIG_IS_ENABLED(OF_PLATDATA) - struct clk clk; -#else unsigned int freq; -#endif }; #endif -- 2.18.0.321.gffc6fa0e3 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3 02/19] dm: i2c: Make i2c_get_chip_for_busnum() fail if the chip is not detected
Hi Simon, On 03/11/2018 07:07, Simon Glass wrote: Hi Jean-Jacques, On 22 October 2018 at 08:12, Jean-Jacques Hiblot wrote: i2c_get_chip_for_busnum() really should check the presence of the chip on the bus. Most of the users of this function assume that this is done. Signed-off-by: Jean-Jacques Hiblot --- Changes in v3: - removed commit introducing dm_i2c_probe_device(). Instead probe the presence of the chip on the I2C bus in i2c_get_chip_for_busnum(). Changes in v2: None drivers/i2c/i2c-uclass.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c index c5a3c4e..975318e 100644 --- a/drivers/i2c/i2c-uclass.c +++ b/drivers/i2c/i2c-uclass.c @@ -347,6 +347,17 @@ int i2c_get_chip_for_busnum(int busnum, int chip_addr, uint offset_len, debug("Cannot find I2C bus %d\n", busnum); return ret; } + + /* detect the presence of the chip on the bus */ + ret = i2c_probe_chip(bus, chip_addr, 0); + debug("%s: bus='%s', address %02x, ret=%d\n", __func__, bus->name, + chip_addr, ret); + if (ret) { + debug("Cannot detect I2C chip %02x on bus %d\n", chip_addr, + busnum); + return ret; + } + I really don't like to keep going on about this, but I think this is still not quite right. That is the development model of many open source projects that made their success. So I don't mind. If the chip is not present that is generally an error, or at least it is assumed to be by the callers. agreed. That is the purpose of the modification i2c_get_chip() is called just above the code you add. This normally probes an existing device at that i2c address, which presumably checks that it is present. However if there is no device at the given address, it calls device_bind(): debug("%s: Searching bus '%s' for address %02x: ", __func__, bus->name, chip_addr); for (device_find_first_child(bus, &dev); dev; device_find_next_child(&dev)) { struct dm_i2c_chip *chip = dev_get_parent_platdata(dev); int ret; if (chip->chip_addr == chip_addr) { ret = device_probe(dev); debug("found, ret=%d\n", ret); f (ret) return ret; *devp = dev; return 0; } } debug("not found\n"); return i2c_bind_driver(bus, chip_addr, offset_len, devp); So I think your new code below should only be used in the case where device_bind() was called. I don't think it hurts to probe the presence of the chip after the device_probe() is called. And I am not sure that the all drivers detect the chip in their probe() functions. What is the case where you: a) Don't put the I2C device in the device tree b) Expect it to be bound c) Want to know if it is not present This is exactly the use case I'm trying to address. There are several possible cases: - Some platforms haven't gone full DM yet and don't put the I2C device in the DT. - Other just don't have a DM I2C driver for the chip and only send a few commands to initialize it. Adding a real I2C-driver may be overkill. - Other platforms rely on the detection of external devices to further identify the platform with no need to actually use the external chip. Looking at it closely, i2c_get_chip() is not consistent. It probes the device it is is already bound, but if not, it binds a device and then fails to probe it. I think it should call device_prove() after binding it. Calling device_probe() would work only if a DM I2C driver exists for the chip and if a description exists in the DT. So I don't think it would work for the cases I mentioned above. Would that be good enough? Otherwise, perhaps we just need a function like: i2c_probe_device(struct udevice *dev) which calls i2c_probe_chip() on the appropriate address? That works, it was what was done in the first version. But I think this version is better as it doesn't introduce a new function and make i2c_get_chip_for_busnum() behave as people expect it to behave: fail if the chip is not there. The cost is a systematic and sometimes unnecessary I2C probe sequence. That penalty is small. There is another solution: add a probe() function to the i2c_generic_chip_drv driver that fails if it doesn't detect the chip. It would do the job. ret = i2c_get_chip(bus, chip_addr, offset_len, devp); if (ret) { debug("Cannot find I2C chip %02x on bus %d\n", chip_addr, -- 2.7.4 Again I'm sorry for all the back and forth. I think it would help to have more information in the commit message about the circumstances in which this change is needed. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] efi_loader: Handle RELA absolute relocations properly
On Sun, 2018-11-04 at 22:28 +0100, Alexander Graf wrote: > With RELA absolute relocations, the relocation target contains our > link > offset which we need to remove from the equation again. We did this > properly in the relative relocation path, but not in the absolute > one. > > So let's do this for the absolute one as well. That way, u-boot can > have > a TEXT_OFFSET of != 0 and still relocate itself properly. > > This fixes a bug where efi_loader did not work on the RISC-V QEMU > port. > With this patch, I can successfully run UEFI applications on the > RISC-V > QEMU port. > > Reported-by: Auer, Lukas > Signed-off-by: Alexander Graf > --- > lib/efi_loader/efi_runtime.c | 3 +++ > 1 file changed, 3 insertions(+) > > Tested-by: Lukas Auer Thanks for the patch! That explains why it was working on the Andes targets. Lukas ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] arm64: mvebu: a8k: autodetect RAM size
Hi Baruch, On 31.10.18 15:50, Baruch Siach wrote: Hi Stefan, On Wed, Oct 31, 2018 at 02:29:50PM +0100, Stefan Roese wrote: On 28.10.18 13:30, Baruch Siach wrote: Some Armada 8K boards like Macchiatobin and Clearfog GT-8K use RAM from external DIMM. Hard coding the RAM size in the device-tree is not convenient. Fortunately, the ATF that initializes the RAM knows the size of RAM, and U-Boot can query the ATF using a SMC call. This code in this commit is mostly taken from downstream Marvell U-Boot code by Grzegorz Jaszczyk. CONFIG_NR_DRAM_BANKS must be set to 2 to use more than 3GB RAM. Cc: Grzegorz Jaszczyk Signed-off-by: Baruch Siach --- arch/arm/mach-mvebu/arm64-common.c | 47 +- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-mvebu/arm64-common.c b/arch/arm/mach-mvebu/arm64-common.c index f47273fde9c6..7ba7301c7a8c 100644 --- a/arch/arm/mach-mvebu/arm64-common.c +++ b/arch/arm/mach-mvebu/arm64-common.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -45,15 +46,59 @@ const struct mbus_dram_target_info *mvebu_mbus_dram_info(void) /* DRAM init code ... */ +#define MV_SIP_DRAM_SIZE 0x8210 + +static u64 a8k_dram_scan_ap_sz(void) +{ + struct pt_regs pregs; + + pregs.regs[0] = MV_SIP_DRAM_SIZE; + pregs.regs[1] = SOC_REGS_PHY_BASE; + smc_call(&pregs); + + return pregs.regs[0]; +} + +static void a8k_dram_init_banksize(void) +{ + /* +* Config 2 DRAM banks: +* Bank 0 - max size 4G - 1G +* Bank 1 - ram size - 4G + 1G +*/ + phys_size_t max_bank0_size = SZ_4G - SZ_1G; + + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + if (gd->ram_size <= max_bank0_size) { + gd->bd->bi_dram[0].size = gd->ram_size; + return; + } + + gd->bd->bi_dram[0].size = max_bank0_size; + if (CONFIG_NR_DRAM_BANKS > 1) { + gd->bd->bi_dram[1].start = SZ_4G; + gd->bd->bi_dram[1].size = gd->ram_size - max_bank0_size; + } Is CONFIG_NR_DRAM_BANKS > 2 possible on one of these platforms? I tested with a 16GB SO-DIMM on Clearfog GT-8K. Before this change only 2GB were visible to Linux. With this change, and with CONFIG_NR_DRAM_BANKS=2, I am able to lock 15.5GB of RAM for write/read using the memtester utility. I didn't test on Macchaitobin because I don't have a >3GB DIMM handy. Also I find the splitting of the available RAM size (detected via ATF) onto the multiple banks not intuitive. Could you please explain the 1GiB hole in the bi_dram[x] struct? I suspect that this might have something to do with the internal register address space. But I fail to see, if this should be reflected in these bi_dram[x] values. As I understand, that is how the ATF code configures the hardware address space. Peripheral devices registers are in the 0xFxxx area, as you can see in the Armada 8040 components .dtsi. Is there any other way to transfer this information to the kernel? It seems that I was wrong with my assumption that the DT blob fixup in U-Boot is made on the base of gd->ram_size. The changes to bi_dram[] are necessary for this DT fixup. It would be great though, if you could add a comment mentioning the reason for the necessary gap in the memory layout in the commit text and the comment in the code though. Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] spi: pl022: Get rid of platdata ifdef's
Hi Jagan, On Mon, Nov 05, 2018 at 02:49:25PM +0530, Jagan Teki wrote: > pl022 spi driver support both OF_CONTROL and PLATDATA and > it's using #ifdef check for differentiating platdata vs of_control. > So this patch simplify the code and drop the ifdefs > You drop a few ifdef, not all. I also find this commit log a bit cryptic. You basically store the frequency of the clock gotten from DM instead of storing the clock itself, which is indeed a welcome simplification of the driver (and you re-order function pointers in the driver structure). > Cc: Quentin Schulz > Signed-off-by: Jagan Teki > --- > drivers/spi/pl022_spi.c | 48 > include/dm/platform_data/pl022_spi.h | 9 -- > 2 files changed, 20 insertions(+), 37 deletions(-) > > diff --git a/drivers/spi/pl022_spi.c b/drivers/spi/pl022_spi.c > index 86b71d2e21..dd27444a43 100644 > --- a/drivers/spi/pl022_spi.c > +++ b/drivers/spi/pl022_spi.c > @@ -72,11 +72,7 @@ > > struct pl022_spi_slave { > void *base; > -#if !CONFIG_IS_ENABLED(OF_PLATDATA) > - struct clk clk; > -#else > unsigned int freq; > -#endif > }; > > /* > @@ -96,30 +92,13 @@ static int pl022_is_supported(struct pl022_spi_slave *ps) > return 0; > } > > -#if !CONFIG_IS_ENABLED(OF_PLATDATA) > -static int pl022_spi_ofdata_to_platdata(struct udevice *bus) > -{ > - struct pl022_spi_pdata *plat = bus->platdata; > - const void *fdt = gd->fdt_blob; > - int node = dev_of_offset(bus); > - > - plat->addr = fdtdec_get_addr_size(fdt, node, "reg", &plat->size); > - > - return clk_get_by_index(bus, 0, &plat->clk); > -} > -#endif > - > static int pl022_spi_probe(struct udevice *bus) > { > struct pl022_spi_pdata *plat = dev_get_platdata(bus); > struct pl022_spi_slave *ps = dev_get_priv(bus); > > ps->base = ioremap(plat->addr, plat->size); > -#if !CONFIG_IS_ENABLED(OF_PLATDATA) > - ps->clk = plat->clk; > -#else > ps->freq = plat->freq; > -#endif > > /* Check the PL022 version */ > if (!pl022_is_supported(ps)) > @@ -240,11 +219,7 @@ static int pl022_spi_set_speed(struct udevice *bus, uint > speed) > u16 scr = SSP_SCR_MIN, cr0 = 0, cpsr = SSP_CPSR_MIN, best_scr = scr, > best_cpsr = cpsr; > u32 min, max, best_freq = 0, tmp; > -#if !CONFIG_IS_ENABLED(OF_PLATDATA) > - u32 rate = clk_get_rate(&ps->clk); > -#else > u32 rate = ps->freq; > -#endif > bool found = false; > > max = spi_rate(rate, SSP_CPSR_MIN, SSP_SCR_MIN); We don't need the u32 rate temp variable anymore so better replace it in this function with ps->freq directly. > @@ -316,6 +291,25 @@ static const struct dm_spi_ops pl022_spi_ops = { > }; > > #if !CONFIG_IS_ENABLED(OF_PLATDATA) > +static int pl022_spi_ofdata_to_platdata(struct udevice *bus) > +{ > + struct pl022_spi_pdata *plat = bus->platdata; > + struct udevice *clkdev; > + const void *fdt = gd->fdt_blob; > + int node = dev_of_offset(bus); > + int ret; > + > + plat->addr = fdtdec_get_addr_size(fdt, node, "reg", &plat->size); > + > + ret = clk_get_by_index(bus, 0, &clkdev); > + if (ret) > + return ret; > + > + plat->freq = clk_get_rate(clkdev); > + > + return 0; > +} > + > static const struct udevice_id pl022_spi_ids[] = { > { .compatible = "arm,pl022-spi" }, > { } > @@ -327,11 +321,9 @@ U_BOOT_DRIVER(pl022_spi) = { > .id = UCLASS_SPI, > #if !CONFIG_IS_ENABLED(OF_PLATDATA) > .of_match = pl022_spi_ids, > -#endif > - .ops= &pl022_spi_ops, > -#if !CONFIG_IS_ENABLED(OF_PLATDATA) > .ofdata_to_platdata = pl022_spi_ofdata_to_platdata, > #endif > + .ops= &pl022_spi_ops, > .platdata_auto_alloc_size = sizeof(struct pl022_spi_pdata), > .priv_auto_alloc_size = sizeof(struct pl022_spi_slave), > .probe = pl022_spi_probe, > diff --git a/include/dm/platform_data/pl022_spi.h > b/include/dm/platform_data/pl022_spi.h > index 77fe6da3cb..57d12ac912 100644 > --- a/include/dm/platform_data/pl022_spi.h > +++ b/include/dm/platform_data/pl022_spi.h > @@ -10,19 +10,10 @@ > #ifndef __PL022_SPI_H__ > #define __PL022_SPI_H__ > > -#if !CONFIG_IS_ENABLED(OF_PLATDATA) > -#include > -#endif > -#include Nope, I need this one else it does not compile. Thanks, Quentin signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH V2 1/4] tools: imx8image: check lseek return value
Check lseek return value. Fix Coverity CID: 184236 184235 184232 Reported-by: Coverity Signed-off-by: Peng Fan --- V2: Per Fabio's comments, use ret = lseek; if (ret) < 0) coding style. tools/imx8image.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/imx8image.c b/tools/imx8image.c index e6b0a146b6..03debe547e 100644 --- a/tools/imx8image.c +++ b/tools/imx8image.c @@ -301,6 +301,7 @@ static void copy_file_aligned(int ifd, const char *datafile, int offset, unsigned char *ptr; uint8_t zeros[0x4000]; int size; + int ret; if (align > 0x4000) { fprintf(stderr, "Wrong alignment requested %d\n", align); @@ -333,7 +334,13 @@ static void copy_file_aligned(int ifd, const char *datafile, int offset, } size = sbuf.st_size; - lseek(ifd, offset, SEEK_SET); + ret = lseek(ifd, offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "%s: lseek error %s\n", + __func__, strerror(errno)); + exit(EXIT_FAILURE); + } + if (write(ifd, ptr, size) != size) { fprintf(stderr, "Write error %s\n", strerror(errno)); exit(EXIT_FAILURE); @@ -359,7 +366,7 @@ static void copy_file (int ifd, const char *datafile, int pad, int offset) int tail; int zero = 0; uint8_t zeros[4096]; - int size; + int size, ret; memset(zeros, 0, sizeof(zeros)); @@ -387,7 +394,13 @@ static void copy_file (int ifd, const char *datafile, int pad, int offset) } size = sbuf.st_size; - lseek(ifd, offset, SEEK_SET); + ret = lseek(ifd, offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "%s: lseek error %s\n", + __func__, strerror(errno)); + exit(EXIT_FAILURE); + } + if (write(ifd, ptr, size) != size) { fprintf(stderr, "Write error %s\n", strerror(errno)); @@ -762,6 +775,7 @@ static int build_container(soc_type_t soc, uint32_t sector_size, char *tmp_filename = NULL; uint32_t size = 0; uint32_t file_padding = 0; + int ret; int container = -1; int cont_img_count = 0; /* indexes to arrange the container */ @@ -883,7 +897,12 @@ static int build_container(soc_type_t soc, uint32_t sector_size, } while (img_sp->option != NO_IMG); /* Add padding or skip appended container */ - lseek(ofd, file_padding, SEEK_SET); + ret = lseek(ofd, file_padding, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "%s: lseek error %s\n", + __func__, strerror(errno)); + exit(EXIT_FAILURE); + } /* Note: Image offset are not contained in the image */ tmp = flatten_container_header(&imx_header, container + 1, &size, -- 2.14.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH V2 2/4] tools: imx8image: fix coverity CID 184234
Fix: CID 184234:(TAINTED_SCALAR) Using tainted variable "header.num_images - 1" as an index into an array "header.img". Reported-by: Coverity Signed-off-by: Peng Fan --- tools/imx8image.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/imx8image.c b/tools/imx8image.c index 03debe547e..019b875773 100644 --- a/tools/imx8image.c +++ b/tools/imx8image.c @@ -666,8 +666,10 @@ static int get_container_image_start_pos(image_t *image_stack, uint32_t align) } ret = fread(&header, sizeof(header), 1, fd); - if (ret != 1) + if (ret != 1) { printf("Failure Read header %d\n", ret); + exit(EXIT_FAILURE); + } fclose(fd); -- 2.14.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH V2 3/4] tools: imx8image: fix coverity CID 184233
Fix: CID 184233:(NEGATIVE_RETURNS) Using variable "container" as an index to array "imx_header.fhdr". Reported-by: Coverity Signed-off-by: Peng Fan --- tools/imx8image.c | 8 1 file changed, 8 insertions(+) diff --git a/tools/imx8image.c b/tools/imx8image.c index 019b875773..ac89c821c9 100644 --- a/tools/imx8image.c +++ b/tools/imx8image.c @@ -812,6 +812,10 @@ static int build_container(soc_type_t soc, uint32_t sector_size, case SCFW: case DATA: case MSG_BLOCK: + if (container < 0) { + fprintf(stderr, "No container found\n"); + exit(EXIT_FAILURE); + } check_file(&sbuf, img_sp->filename); tmp_filename = img_sp->filename; set_image_array_entry(&imx_header.fhdr[container], @@ -825,6 +829,10 @@ static int build_container(soc_type_t soc, uint32_t sector_size, break; case SECO: + if (container < 0) { + fprintf(stderr, "No container found\n"); + exit(EXIT_FAILURE); + } check_file(&sbuf, img_sp->filename); tmp_filename = img_sp->filename; set_image_array_entry(&imx_header.fhdr[container], -- 2.14.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH V2 4/4] tools: imx8image: flatten container header only when creating container
If there is no CONTAINER entry, there is no need to flatten container header. Signed-off-by: Peng Fan --- tools/imx8image.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tools/imx8image.c b/tools/imx8image.c index ac89c821c9..6e8ac464e7 100644 --- a/tools/imx8image.c +++ b/tools/imx8image.c @@ -914,17 +914,19 @@ static int build_container(soc_type_t soc, uint32_t sector_size, exit(EXIT_FAILURE); } - /* Note: Image offset are not contained in the image */ - tmp = flatten_container_header(&imx_header, container + 1, &size, - file_padding); - /* Write image header */ - if (write(ofd, tmp, size) != size) { - fprintf(stderr, "error writing image hdr\n"); - exit(EXIT_FAILURE); - } + if (container >= 0) { + /* Note: Image offset are not contained in the image */ + tmp = flatten_container_header(&imx_header, container + 1, + &size, file_padding); + /* Write image header */ + if (write(ofd, tmp, size) != size) { + fprintf(stderr, "error writing image hdr\n"); + exit(EXIT_FAILURE); + } - /* Clean-up memory used by the headers */ - free(tmp); + /* Clean-up memory used by the headers */ + free(tmp); + } /* * step through the image stack again this time copying -- 2.14.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3 6/6] spi: kirkwood: Full dm conversion
On Mon, May 7, 2018 at 2:40 PM Jagan Teki wrote: > > kirkwood now support dt along with platform data, > respective boards need to switch into dm for the same. > > Signed-off-by: Jagan Teki > --- > Changes for v3: > - rebased master > - Move kconfig option if DM_SPI > > drivers/spi/Kconfig | 12 +- > drivers/spi/kirkwood_spi.c | 240 > ++-- > include/dm/platform_data/spi_kirkwood.h | 15 ++ > 3 files changed, 62 insertions(+), 205 deletions(-) > create mode 100644 include/dm/platform_data/spi_kirkwood.h Any update from the board maintainers about this changes, I would like to push this sooner as possible. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/2] imx: imx8qxp_mek: imximage: remove config.h
config.h is not needed, remove it. Signed-off-by: Peng Fan --- board/freescale/imx8qxp_mek/imximage.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/board/freescale/imx8qxp_mek/imximage.cfg b/board/freescale/imx8qxp_mek/imximage.cfg index 9d39f25bf6..bbffb1a88f 100644 --- a/board/freescale/imx8qxp_mek/imximage.cfg +++ b/board/freescale/imx8qxp_mek/imximage.cfg @@ -7,7 +7,6 @@ */ #define __ASSEMBLY__ -#include /* Boot from SD, sector size 0x400 */ BOOT_FROM SD 0x400 -- 2.14.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 2/2] arm: imx8qxp: build u-boot-dtb.cfgout before checking files
Build u-boot-dtb.cfgout before checking files, otherwise u-boot-dtb.cfgout is generated at late stage and cause final image not generated. Signed-off-by: Peng Fan --- arch/arm/mach-imx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 72fe23a2b9..a3190ad2f0 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -89,7 +89,7 @@ IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%) ifeq ($(CONFIG_ARCH_IMX8), y) CNTR_DEPFILES := $(srctree)/tools/imx_cntr_image.sh IMAGE_TYPE := imx8image -DEPFILE_EXISTS := $(shell if [ -f u-boot-dtb.cfgout ]; then $(CNTR_DEPFILES) u-boot-dtb.cfgout; echo $$?; fi) +DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o u-boot-dtb.cfgout $(srctree)/$(IMX_CONFIG); if [ -f u-boot-dtb.cfgout ]; then $(CNTR_DEPFILES) u-boot-dtb.cfgout; echo $$?; fi) else IMAGE_TYPE := imximage DEPFILE_EXISTS := 0 -- 2.14.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v1 1/1] spi: lpc32xx_ssp: DM conversion
On Wed, Sep 19, 2018 at 5:02 PM Vladimir Zapolskiy wrote: > > On 09/04/2018 09:33 AM, Jagan Teki wrote: > > On Wed, May 9, 2018 at 12:37 PM, Akash Gajjar > > wrote: > >> From: Akash Gajjar > >> > >> This patch adds support for DM to the LPC32xx SSP SPI driver. > >> > >> Some TODOs are left over for later, These would be enhancements to the > >> original functionality, and can come later. The legacy functionality is > >> removed in this version. > >> > >> Signed-off-by: Akash Gajjar > >> --- > > [snip] > > >> + > >> +/* TODO: update compatibel device tree */ > >> +static const struct udevice_id lpc32xx_ssp_spi_ids[] = { > >> + { .compatible = "" }, > > > > Don't we have DTS for this platform on Linux? > > We have, but it makes little sense to add platform OF support to U-Boot > at the moment. > > In other words, all #if CONFIG_IS_ENABLED(OF_CONTROL) code sections > shall be removed. But few core ops should depends on fdt lib functions, any plan on adding OF_CONTROL to it? ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] spi: Zap mpc8xx_spi driver
On Fri, Mar 2, 2018 at 3:17 PM Christophe LEROY wrote: > > > Le 26/02/2018 à 15:43, Jagan Teki a écrit : > > - Driver not used by any boards > > This driver should be used by MCR3000 board. For the time > being SPI is not activated on that board because we are struggling > with u-boot size. I'm working on re-activating SPI soon on this board. > > I also have another board that I'm planing to include in the near > future. That board stores ethernet addresses in an SPI E2PROM, so this > driver will be mandatory for it. > > Therefore, please do not drop it now. It will be converted to DM before > the deadline. Any patch for this? planning to merge it on MW ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v1] fs: ubifs: Fix UBIFS decompression on 64 bit
Add local size_t variable to crypto_comp_decompress as intermediate storage for destination length to avoid memory corruption and incorrect results on 64 bit targets. This is what linux does for the various lz compression implementations. Signed-off-by: Paul Davey Cc: Heiko Schocher --- When attempting to use ubifs on a MIPS64 platform I found that it would fail decompression for the file I was attempting to load. Further investigation found that this was due to the pointer cast from unsigned int * to size_t * in the decompression wrapper. This will cause any big endian 64 bit platform to fail to load any ubifs file that requires decompression and at least cause little endian 64 bit platforms to silently write 0 over 4 bytes of stack memory. fs/ubifs/ubifs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index 47fa41ad1dd..d5101d3c459 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -125,6 +125,7 @@ crypto_comp_decompress(const struct ubifs_info *c, struct crypto_comp *tfm, { struct ubifs_compressor *compr = ubifs_compressors[tfm->compressor]; int err; + size_t tmp_len = *dlen; if (compr->compr_type == UBIFS_COMPR_NONE) { memcpy(dst, src, slen); @@ -132,11 +133,12 @@ crypto_comp_decompress(const struct ubifs_info *c, struct crypto_comp *tfm, return 0; } - err = compr->decompress(src, slen, dst, (size_t *)dlen); + err = compr->decompress(src, slen, dst, &tmp_len); if (err) ubifs_err(c, "cannot decompress %d bytes, compressor %s, " "error %d", slen, compr->name, err); + *dlen = tmp_len; return err; return 0; -- 2.19.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] board: rockchip: rk3399: add Rockpro64 board support
Hi Jagan, On 05/11/18 12:40 PM, Jagan Teki wrote: On 03/11/18 4:58 PM, Akash Gajjar wrote: Rockpro64 is rk3399 based board from pine64.org. add initial board support for Rockpro64. complete board support will be added later in upcoming patchsets. Signed-off-by: Akash Gajjar --- arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3399-rockpro64.dts | 519 +++ Does it pure Linux sync file? if yes mention the commit id details on commit message. Nope, it is not pure Linux sync file. though dts support is queued for Linux 4.20. arch/arm/dts/rk3399-sdram-lpddr4-1600.dtsi | 1535 Send this separately, more convenient to review ddr changes separately. Will do this in v2 changes. arch/arm/mach-rockchip/rk3399/Kconfig | 10 + board/rockchip/rockpro64/Kconfig | 15 + board/rockchip/rockpro64/MAINTAINERS | 6 + board/rockchip/rockpro64/Makefile | 7 + board/rockchip/rockpro64/rockpro64.c | 94 ++ configs/rockpro64-rk3399_defconfig | 78 + include/configs/rockpro64.h | 15 + 10 files changed, 2280 insertions(+) create mode 100644 arch/arm/dts/rk3399-rockpro64.dts create mode 100644 arch/arm/dts/rk3399-sdram-lpddr4-1600.dtsi create mode 100644 board/rockchip/rockpro64/Kconfig create mode 100644 board/rockchip/rockpro64/MAINTAINERS create mode 100644 board/rockchip/rockpro64/Makefile create mode 100644 board/rockchip/rockpro64/rockpro64.c create mode 100644 configs/rockpro64-rk3399_defconfig create mode 100644 include/configs/rockpro64.h diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index d36447d18d..8a84cf55a3 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -51,6 +51,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \ rk3399-puma-ddr1333.dtb \ rk3399-puma-ddr1600.dtb \ rk3399-puma-ddr1866.dtb \ + rk3399-rockpro64.dtb \ rv1108-evb.dtb dtb-$(CONFIG_ARCH_MESON) += \ meson-gxbb-nanopi-k2.dtb \ diff --git a/arch/arm/dts/rk3399-rockpro64.dts b/arch/arm/dts/rk3399-rockpro64.dts new file mode 100644 index 00..8497a1124b --- /dev/null +++ b/arch/arm/dts/rk3399-rockpro64.dts @@ -0,0 +1,519 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2018 Akash Gajjar + */ + +/dts-v1/; +#include +#include +#include "rk3399.dtsi" +#include "rk3399-sdram-lpddr4-1600.dtsi" if this change related to u-boot, just sync Linux dts file and create -u-boot.dtsi and include this on that. Just to understand, what has been tested with this support? This initial phase patchsets are just to notify community that board support is in progress. In V2 changes will add complete support of u-boot for Rockpro64. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PULL] u-boot-sh/master
On Sun, Nov 04, 2018 at 10:15:07AM +0100, Marek Vasut wrote: > The following changes since commit fdaccfeb5e03e18c05be386b8a7c6be02be2cf15: > > Merge branch 'master' of git://git.denx.de/u-boot-socfpga (2018-10-31 > 17:15:55 -0400) > > are available in the Git repository at: > > git://git.denx.de/u-boot-sh.git master > > for you to fetch changes up to a376dde1deb9cc42e3804b9c654f873c936cc8d4: > > mmc: tmio: sdhi: Merge DTCNTL access into single register write > (2018-11-02 16:07:04 +0100) > Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [GIT PULL] mips-fixes-for-v2018.11
On Sat, Nov 03, 2018 at 11:59:55AM +0100, Daniel Schwierzeck wrote: > Hi Tom, > > please pull an important bugfix for MIPS, thanks. > > Travis CI: https://travis-ci.org/danielschwierzeck/u-boot/builds/450057399 > > > The following changes since commit 99431c1c21685fe63d46b6eac995b78ce9adce0a: > > Merge tag 'arc-for-2018.11' of git://git.denx.de/u-boot-arc > (2018-11-02 09:39:18 -0400) > > are available in the Git repository at: > > git://git.denx.de/u-boot-mips.git tags/mips-fixes-for-v2018.11 > > for you to fetch changes up to 963014641117291c15df2425caf46c7b4b979f18: > > MIPS: make size of relocation table fixed but configurable (2018-11-02 > 22:39:07 +0100) > Applied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH V2 1/4] tools: imx8image: check lseek return value
Hi Peng, On Mon, Nov 5, 2018 at 7:53 AM Peng Fan wrote: > > Check lseek return value. > > Fix Coverity CID: 184236 184235 184232 > > Reported-by: Coverity > Signed-off-by: Peng Fan Thanks for the respin. Reviewed-by: Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 01/58] mpc83xx: Introduce ARCH_MPC830*
Replace CONFIG_MPC830* with proper CONFIG_ARCH_MPC830* Kconfig options. Signed-off-by: Mario Six --- v1 -> v2: * Removed config options from whitelist --- arch/powerpc/cpu/mpc83xx/Kconfig | 17 + arch/powerpc/cpu/mpc83xx/spd_sdram.c | 2 +- arch/powerpc/cpu/mpc83xx/speed.c | 38 ++-- arch/powerpc/include/asm/arch-mpc83xx/gpio.h | 2 +- arch/powerpc/include/asm/fsl_lbc.h | 2 +- arch/powerpc/include/asm/global_data.h | 6 ++--- arch/powerpc/include/asm/immap_83xx.h| 10 arch/powerpc/include/asm/mpc8xxx_spi.h | 2 +- board/keymile/km83xx/km83xx.c| 2 +- drivers/qe/qe.c | 2 +- drivers/ram/mpc83xx_sdram.c | 4 +-- include/configs/MPC8308RDB.h | 2 -- include/configs/hrcon.h | 2 -- include/configs/km/km8309-common.h | 2 -- include/configs/km/km83xx-common.h | 2 +- include/configs/mpc8308_p1m.h| 2 -- include/configs/strider.h| 2 -- include/linux/immap_qe.h | 2 +- include/mpc83xx.h| 24 +- scripts/config_whitelist.txt | 3 --- 20 files changed, 66 insertions(+), 62 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 571cf8fc2ef..142b9247860 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -10,6 +10,7 @@ choice config TARGET_MPC8308_P1M bool "Support mpc8308_p1m" + select ARCH_MPC8308 config TARGET_SBC8349 bool "Support sbc8349" @@ -22,6 +23,7 @@ config TARGET_VME8349 config TARGET_MPC8308RDB bool "Support MPC8308RDB" + select ARCH_MPC8308 select SYS_FSL_ERRATUM_ESDHC111 config TARGET_MPC8313ERDB @@ -74,6 +76,8 @@ config TARGET_KM8360 config TARGET_SUVD3 bool "Support suvd3" + select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMTEGR1" + select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMVECT1" imply CMD_CRAMFS imply FS_CRAMFS @@ -87,15 +91,28 @@ config TARGET_TQM834X config TARGET_HRCON bool "Support hrcon" + select ARCH_MPC8308 select SYS_FSL_ERRATUM_ESDHC111 config TARGET_STRIDER bool "Support strider" + select ARCH_MPC8308 select SYS_FSL_ERRATUM_ESDHC111 imply CMD_PCA953X endchoice +config ARCH_MPC830X + bool + +config ARCH_MPC8308 + bool + select ARCH_MPC830X + +config ARCH_MPC8309 + bool + select ARCH_MPC830X + source "board/esd/vme8349/Kconfig" source "board/freescale/mpc8308rdb/Kconfig" source "board/freescale/mpc8313erdb/Kconfig" diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c b/arch/powerpc/cpu/mpc83xx/spd_sdram.c index 328a018eb6f..97ef77121b5 100644 --- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c +++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c @@ -31,7 +31,7 @@ void board_add_ram_info(int use_default) printf(" (DDR%d", ((ddr->sdram_cfg & SDRAM_CFG_SDRAM_TYPE_MASK) >> SDRAM_CFG_SDRAM_TYPE_SHIFT) - 1); -#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) +#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) if ((ddr->sdram_cfg & SDRAM_CFG_DBW_MASK) == SDRAM_CFG_DBW_16) puts(", 16-bit"); else if ((ddr->sdram_cfg & SDRAM_CFG_DBW_MASK) == SDRAM_CFG_DBW_32) diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c index 39bc1c53406..d537af5130a 100644 --- a/arch/powerpc/cpu/mpc83xx/speed.c +++ b/arch/powerpc/cpu/mpc83xx/speed.c @@ -85,12 +85,12 @@ int get_clocks(void) u32 lcrr; u32 csb_clk; -#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \ +#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \ defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) u32 tsec1_clk; u32 tsec2_clk; u32 usbdr_clk; -#elif defined(CONFIG_MPC8309) +#elif defined(CONFIG_ARCH_MPC8309) u32 usbdr_clk; #endif #ifdef CONFIG_MPC834x @@ -107,7 +107,7 @@ int get_clocks(void) #if defined(CONFIG_FSL_ESDHC) u32 sdhc_clk; #endif -#if !defined(CONFIG_MPC8309) +#if !defined(CONFIG_ARCH_MPC8309) u32 enc_clk; #endif u32 lbiu_clk; @@ -122,7 +122,7 @@ int get_clocks(void) u32 qe_clk; u32 brg_clk; #endif -#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \ +#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \ defined(CONFIG_MPC837x) u32 pciexp1_clk; u32 pciexp2_clk; @@ -155,7 +155,7 @@ int get_clocks(void) sccr = im->clk.sccr; -#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \ +#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \ defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) switch ((sccr & SCCR_TSEC1CM) >> SCCR_TSEC1CM
[U-Boot] [PATCH v2 02/58] mpc83xx: Introduce ARCH_MPC831*
Replace CONFIG_MPC833* with proper CONFIG_ARCH_MPC833* Kconfig options. Signed-off-by: Mario Six --- v1 -> v2: * Removed config options from whitelist --- arch/powerpc/cpu/mpc83xx/Kconfig | 15 +++ arch/powerpc/cpu/mpc83xx/cpu.c | 2 +- arch/powerpc/cpu/mpc83xx/cpu_init.c | 4 +-- arch/powerpc/cpu/mpc83xx/fdt.c | 6 ++--- arch/powerpc/cpu/mpc83xx/spd_sdram.c | 2 +- arch/powerpc/cpu/mpc83xx/speed.c | 40 ++-- arch/powerpc/include/asm/arch-mpc83xx/gpio.h | 4 +-- arch/powerpc/include/asm/global_data.h | 8 +++--- arch/powerpc/include/asm/immap_83xx.h| 4 +-- arch/powerpc/include/asm/mpc8xxx_spi.h | 4 +-- drivers/ram/mpc83xx_sdram.c | 4 +-- include/configs/MPC8313ERDB.h| 2 -- include/configs/MPC8315ERDB.h| 2 -- include/configs/ids8313.h| 3 --- include/configs/ve8313.h | 2 -- include/mpc83xx.h| 20 +++--- scripts/config_whitelist.txt | 3 --- 17 files changed, 64 insertions(+), 61 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 142b9247860..20780ba68bd 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -17,6 +17,7 @@ config TARGET_SBC8349 config TARGET_VE8313 bool "Support ve8313" + select ARCH_MPC8313 config TARGET_VME8349 bool "Support vme8349" @@ -28,11 +29,13 @@ config TARGET_MPC8308RDB config TARGET_MPC8313ERDB bool "Support MPC8313ERDB" + select ARCH_MPC8313 select BOARD_EARLY_INIT_F select SUPPORT_SPL config TARGET_MPC8315ERDB bool "Support MPC8315ERDB" + select ARCH_MPC8315 select BOARD_EARLY_INIT_F config TARGET_MPC8323ERDB @@ -65,6 +68,7 @@ config TARGET_MPC837XERDB config TARGET_IDS8313 bool "Support ids8313" + select ARCH_MPC8313 select DM imply CMD_DM @@ -113,6 +117,17 @@ config ARCH_MPC8309 bool select ARCH_MPC830X +config ARCH_MPC831X + bool + +config ARCH_MPC8313 + bool + select ARCH_MPC831X + +config ARCH_MPC8315 + bool + select ARCH_MPC831X + source "board/esd/vme8349/Kconfig" source "board/freescale/mpc8308rdb/Kconfig" source "board/freescale/mpc8313erdb/Kconfig" diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c index b29f271e9bc..8a88068fdba 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu.c +++ b/arch/powerpc/cpu/mpc83xx/cpu.c @@ -18,7 +18,7 @@ #include #include #include -#if defined(CONFIG_BOOTCOUNT_LIMIT) && !defined(CONFIG_MPC831x) +#if defined(CONFIG_BOOTCOUNT_LIMIT) && !defined(CONFIG_ARCH_MPC831X) #include #include #endif diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c index 1555205e069..7d8d5516b4c 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu_init.c +++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c @@ -240,7 +240,7 @@ void cpu_init_f (volatile immap_t * im) /* System General Purpose Register */ #ifdef CONFIG_SYS_SICRH -#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC8313) +#if defined(CONFIG_MPC834x) || defined(CONFIG_ARCH_MPC8313) /* regarding to MPC34x manual rev.1 bits 28..29 must be preserved */ __raw_writel((im->sysconf.sicrh & 0x000C) | CONFIG_SYS_SICRH, &im->sysconf.sicrh); @@ -312,7 +312,7 @@ void cpu_init_f (volatile immap_t * im) im->gpio[1].dat = CONFIG_SYS_GPIO2_DAT; im->gpio[1].dir = CONFIG_SYS_GPIO2_DIR; #endif -#if defined(CONFIG_USB_EHCI_FSL) && defined(CONFIG_MPC831x) +#if defined(CONFIG_USB_EHCI_FSL) && defined(CONFIG_ARCH_MPC831X) uint32_t temp; struct usb_ehci *ehci = (struct usb_ehci *)CONFIG_SYS_FSL_USB1_ADDR; diff --git a/arch/powerpc/cpu/mpc83xx/fdt.c b/arch/powerpc/cpu/mpc83xx/fdt.c index 0ecafd708fc..cfd391b78ab 100644 --- a/arch/powerpc/cpu/mpc83xx/fdt.c +++ b/arch/powerpc/cpu/mpc83xx/fdt.c @@ -16,7 +16,7 @@ extern void ft_qe_setup(void *blob); DECLARE_GLOBAL_DATA_PTR; #if defined(CONFIG_BOOTCOUNT_LIMIT) && \ - (defined(CONFIG_QE) && !defined(CONFIG_MPC831x)) + (defined(CONFIG_QE) && !defined(CONFIG_ARCH_MPC831X)) #include void fdt_fixup_muram (void *blob) @@ -52,7 +52,7 @@ void ft_cpu_setup(void *blob, bd_t *bd) #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\ defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3) ||\ defined(CONFIG_HAS_ETH4) || defined(CONFIG_HAS_ETH5) -#ifdef CONFIG_MPC8313 +#ifdef CONFIG_ARCH_MPC8313 /* * mpc8313e erratum IPIC1 swapped TSEC interrupt ID numbers on rev. 1 * h/w (see AN3545). The base device tree in use has rev. 1 ID numbers, @@ -123,7 +123,7 @@ void ft_cpu_setup(void *blob, bd_t *bd) fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); #if d
[U-Boot] [PATCH v2 03/58] mpc83xx: Introduce ARCH_MPC832*
Replace CONFIG_MPC832* with proper CONFIG_ARCH_MPC832* Kconfig options. Signed-off-by: Mario Six --- v1 -> v2: No changes --- arch/powerpc/cpu/mpc83xx/Kconfig | 7 +++ arch/powerpc/cpu/mpc83xx/speed.c | 10 +- arch/powerpc/include/asm/immap_83xx.h | 2 +- include/configs/MPC8323ERDB.h | 1 - include/configs/MPC832XEMDS.h | 1 - include/configs/km/km8321-common.h| 1 - include/linux/immap_qe.h | 2 +- include/mpc83xx.h | 6 +++--- scripts/config_whitelist.txt | 1 - 9 files changed, 17 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 20780ba68bd..1b9402e024b 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -40,9 +40,11 @@ config TARGET_MPC8315ERDB config TARGET_MPC8323ERDB bool "Support MPC8323ERDB" + select ARCH_MPC832X config TARGET_MPC832XEMDS bool "Support MPC832XEMDS" + select ARCH_MPC832X select BOARD_EARLY_INIT_F config TARGET_MPC8349EMDS @@ -82,11 +84,13 @@ config TARGET_SUVD3 bool "Support suvd3" select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMTEGR1" select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMVECT1" + select ARCH_MPC832X if SYS_EXTRA_OPTIONS="SUVD3" imply CMD_CRAMFS imply FS_CRAMFS config TARGET_TUXX1 bool "Support tuxx1" + select ARCH_MPC832X imply CMD_CRAMFS imply FS_CRAMFS @@ -128,6 +132,9 @@ config ARCH_MPC8315 bool select ARCH_MPC831X +config ARCH_MPC832X + bool + source "board/esd/vme8349/Kconfig" source "board/freescale/mpc8308rdb/Kconfig" source "board/freescale/mpc8313erdb/Kconfig" diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c index 9f09d2955f8..ab025af70d4 100644 --- a/arch/powerpc/cpu/mpc83xx/speed.c +++ b/arch/powerpc/cpu/mpc83xx/speed.c @@ -98,7 +98,7 @@ int get_clocks(void) #endif u32 core_clk; u32 i2c1_clk; -#if !defined(CONFIG_MPC832x) +#if !defined(CONFIG_ARCH_MPC832X) u32 i2c2_clk; #endif #if defined(CONFIG_ARCH_MPC8315) @@ -315,7 +315,7 @@ int get_clocks(void) i2c1_clk = tsec2_clk; #elif defined(CONFIG_MPC8360) i2c1_clk = csb_clk; -#elif defined(CONFIG_MPC832x) +#elif defined(CONFIG_ARCH_MPC832X) i2c1_clk = enc_clk; #elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) i2c1_clk = enc_clk; @@ -326,7 +326,7 @@ int get_clocks(void) #elif defined(CONFIG_ARCH_MPC8309) i2c1_clk = csb_clk; #endif -#if !defined(CONFIG_MPC832x) +#if !defined(CONFIG_ARCH_MPC832X) i2c2_clk = csb_clk; /* i2c-2 clk is equal to csb clk */ #endif @@ -467,7 +467,7 @@ int get_clocks(void) #endif gd->arch.core_clk = core_clk; gd->arch.i2c1_clk = i2c1_clk; -#if !defined(CONFIG_MPC832x) +#if !defined(CONFIG_ARCH_MPC832X) gd->arch.i2c2_clk = i2c2_clk; #endif #if !defined(CONFIG_ARCH_MPC8309) @@ -546,7 +546,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #endif printf(" I2C1:%-4s MHz\n", strmhz(buf, gd->arch.i2c1_clk)); -#if !defined(CONFIG_MPC832x) +#if !defined(CONFIG_ARCH_MPC832X) printf(" I2C2:%-4s MHz\n", strmhz(buf, gd->arch.i2c2_clk)); #endif diff --git a/arch/powerpc/include/asm/immap_83xx.h b/arch/powerpc/include/asm/immap_83xx.h index d22d887babd..318b79d0b8a 100644 --- a/arch/powerpc/include/asm/immap_83xx.h +++ b/arch/powerpc/include/asm/immap_83xx.h @@ -843,7 +843,7 @@ typedef struct immap { u8 qe[0x10]; /* QE block */ } immap_t; -#elif defined(CONFIG_MPC832x) +#elif defined(CONFIG_ARCH_MPC832X) typedef struct immap { sysconf83xx_t sysconf;/* System configuration */ wdt83xx_t wdt;/* Watch Dog Timer (WDT) Registers */ diff --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h index 578202f3be3..bd1b1bb0a7c 100644 --- a/include/configs/MPC8323ERDB.h +++ b/include/configs/MPC8323ERDB.h @@ -14,7 +14,6 @@ */ #define CONFIG_E3001 /* E300 family */ #define CONFIG_QE 1 /* Has QE */ -#define CONFIG_MPC832x 1 /* MPC832x CPU specific */ /* * System Clock Setup diff --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h index 8f11d9b3a48..0bb7db9bc37 100644 --- a/include/configs/MPC832XEMDS.h +++ b/include/configs/MPC832XEMDS.h @@ -11,7 +11,6 @@ */ #define CONFIG_E3001 /* E300 family */ #define CONFIG_QE 1 /* Has QE */ -#define CONFIG_MPC832x 1 /* MPC832x CPU specific */ #define CONFIG_MPC832XEMDS 1 /* MPC832XEMDS board specific */ /* diff --git a/include/configs/km/km8321-common.h b/include/configs/km/km8321-common.h index 41b3ba28429..a
[U-Boot] [PATCH v2 04/58] mpc83xx: Introduce ARCH_MPC834*
Replace CONFIG_MPC834* with proper CONFIG_ARCH_MPC834* Kconfig options. Signed-off-by: Mario Six --- v1 -> v2: * Removed config option from whitelist --- arch/powerpc/cpu/mpc83xx/Kconfig | 12 arch/powerpc/cpu/mpc83xx/cpu_init.c | 2 +- arch/powerpc/cpu/mpc83xx/spd_sdram.c | 2 +- arch/powerpc/cpu/mpc83xx/speed.c | 22 +++--- arch/powerpc/include/asm/arch-mpc83xx/gpio.h | 2 +- arch/powerpc/include/asm/fsl_lbc.h | 8 arch/powerpc/include/asm/global_data.h | 6 +++--- arch/powerpc/include/asm/immap_83xx.h| 6 +++--- arch/powerpc/include/asm/mpc8xxx_spi.h | 2 +- drivers/pci/pci_auto.c | 2 +- drivers/pci/pci_auto_old.c | 2 +- include/configs/MPC8349EMDS.h| 2 -- include/configs/MPC8349ITX.h | 3 --- include/configs/TQM834x.h| 2 -- include/configs/sbc8349.h| 2 -- include/configs/vme8349.h| 2 -- include/mpc83xx.h| 18 +- include/usb/ehci-ci.h| 2 +- scripts/config_whitelist.txt | 2 -- 19 files changed, 49 insertions(+), 50 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 1b9402e024b..6cca45e4026 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -14,6 +14,7 @@ config TARGET_MPC8308_P1M config TARGET_SBC8349 bool "Support sbc8349" + select ARCH_MPC8349 config TARGET_VE8313 bool "Support ve8313" @@ -21,6 +22,7 @@ config TARGET_VE8313 config TARGET_VME8349 bool "Support vme8349" + select ARCH_MPC8349 config TARGET_MPC8308RDB bool "Support MPC8308RDB" @@ -49,6 +51,7 @@ config TARGET_MPC832XEMDS config TARGET_MPC8349EMDS bool "Support MPC8349EMDS" + select ARCH_MPC8349 select BOARD_EARLY_INIT_F select SYS_FSL_DDR select SYS_FSL_DDR_BE @@ -56,6 +59,7 @@ config TARGET_MPC8349EMDS config TARGET_MPC8349ITX bool "Support MPC8349ITX" + select ARCH_MPC8349 imply CMD_IRQ config TARGET_MPC837XEMDS @@ -96,6 +100,7 @@ config TARGET_TUXX1 config TARGET_TQM834X bool "Support TQM834x" + select ARCH_MPC8349 config TARGET_HRCON bool "Support hrcon" @@ -135,6 +140,13 @@ config ARCH_MPC8315 config ARCH_MPC832X bool +config ARCH_MPC834X + bool + +config ARCH_MPC8349 + bool + select ARCH_MPC834X + source "board/esd/vme8349/Kconfig" source "board/freescale/mpc8308rdb/Kconfig" source "board/freescale/mpc8313erdb/Kconfig" diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c index 7d8d5516b4c..7c378671feb 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu_init.c +++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c @@ -240,7 +240,7 @@ void cpu_init_f (volatile immap_t * im) /* System General Purpose Register */ #ifdef CONFIG_SYS_SICRH -#if defined(CONFIG_MPC834x) || defined(CONFIG_ARCH_MPC8313) +#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC8313) /* regarding to MPC34x manual rev.1 bits 28..29 must be preserved */ __raw_writel((im->sysconf.sicrh & 0x000C) | CONFIG_SYS_SICRH, &im->sysconf.sicrh); diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c b/arch/powerpc/cpu/mpc83xx/spd_sdram.c index 3f18aadf19b..b3cbf9f8823 100644 --- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c +++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c @@ -426,7 +426,7 @@ long int spd_sdram() /* * Errata DDR6 work around: input enable 2 cycles earlier. -* including MPC834x Rev1.0/1.1 and MPC8360 Rev1.1/1.2. +* including MPC834X Rev1.0/1.1 and MPC8360 Rev1.1/1.2. */ if(PVR_MAJ(pvr) <= 1 && spd.mem_type == SPD_MEMTYPE_DDR){ if (caslat == 2) diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c index ab025af70d4..7cb6f3727df 100644 --- a/arch/powerpc/cpu/mpc83xx/speed.c +++ b/arch/powerpc/cpu/mpc83xx/speed.c @@ -86,14 +86,14 @@ int get_clocks(void) u32 csb_clk; #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \ - defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) + defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x) u32 tsec1_clk; u32 tsec2_clk; u32 usbdr_clk; #elif defined(CONFIG_ARCH_MPC8309) u32 usbdr_clk; #endif -#ifdef CONFIG_MPC834x +#ifdef CONFIG_ARCH_MPC834X u32 usbmph_clk; #endif u32 core_clk; @@ -156,7 +156,7 @@ int get_clocks(void) sccr = im->clk.sccr; #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \ - defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) + defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x) switch ((sccr & SCCR_TSEC1CM) >> SCCR
[U-Boot] [PATCH v2 05/58] mpc83xx: Introduce ARCH_MPC836*
Replace CONFIG_MPC836* with proper CONFIG_ARCH_MPC836* Kconfig options. Signed-off-by: Mario Six --- v1 -> v2: * Removed config option from whitelist --- arch/powerpc/cpu/mpc83xx/Kconfig | 4 arch/powerpc/cpu/mpc83xx/speed.c | 10 +- arch/powerpc/include/asm/fsl_lbc.h | 4 ++-- arch/powerpc/include/asm/global_data.h | 4 ++-- arch/powerpc/include/asm/immap_83xx.h | 2 +- board/keymile/km83xx/km83xx.c | 4 ++-- drivers/ram/mpc83xx_sdram.c| 8 include/configs/km8360.h | 1 - include/linux/immap_qe.h | 2 +- include/mpc83xx.h | 10 +- include/post.h | 2 +- scripts/config_whitelist.txt | 1 - 12 files changed, 27 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 6cca45e4026..5f9d036e371 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -80,6 +80,7 @@ config TARGET_IDS8313 config TARGET_KM8360 bool "Support km8360" + select ARCH_MPC8360 imply CMD_CRAMFS imply CMD_DIAG imply FS_CRAMFS @@ -147,6 +148,9 @@ config ARCH_MPC8349 bool select ARCH_MPC834X +config ARCH_MPC8360 + bool + source "board/esd/vme8349/Kconfig" source "board/freescale/mpc8308rdb/Kconfig" source "board/freescale/mpc8313erdb/Kconfig" diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c index 7cb6f3727df..ed77675a8ea 100644 --- a/arch/powerpc/cpu/mpc83xx/speed.c +++ b/arch/powerpc/cpu/mpc83xx/speed.c @@ -113,7 +113,7 @@ int get_clocks(void) u32 lbiu_clk; u32 lclk_clk; u32 mem_clk; -#if defined(CONFIG_MPC8360) +#if defined(CONFIG_ARCH_MPC8360) u32 mem_sec_clk; #endif #if defined(CONFIG_QE) @@ -313,7 +313,7 @@ int get_clocks(void) #if defined(CONFIG_ARCH_MPC834X) i2c1_clk = tsec2_clk; -#elif defined(CONFIG_MPC8360) +#elif defined(CONFIG_ARCH_MPC8360) i2c1_clk = csb_clk; #elif defined(CONFIG_ARCH_MPC832X) i2c1_clk = enc_clk; @@ -407,7 +407,7 @@ int get_clocks(void) (1 + ((im->clk.spmr & SPMR_DDRCM) >> SPMR_DDRCM_SHIFT)); corepll = (im->clk.spmr & SPMR_COREPLL) >> SPMR_COREPLL_SHIFT; -#if defined(CONFIG_MPC8360) +#if defined(CONFIG_ARCH_MPC8360) mem_sec_clk = csb_clk * (1 + ((im->clk.spmr & SPMR_LBIUCM) >> SPMR_LBIUCM_SHIFT)); #endif @@ -476,7 +476,7 @@ int get_clocks(void) gd->arch.lbiu_clk = lbiu_clk; gd->arch.lclk_clk = lclk_clk; gd->mem_clk = mem_clk; -#if defined(CONFIG_MPC8360) +#if defined(CONFIG_ARCH_MPC8360) gd->arch.mem_sec_clk = mem_sec_clk; #endif #if defined(CONFIG_QE) @@ -536,7 +536,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf(" Local Bus: %-4s MHz\n", strmhz(buf, gd->arch.lclk_clk)); printf(" DDR: %-4s MHz\n", strmhz(buf, gd->mem_clk)); -#if defined(CONFIG_MPC8360) +#if defined(CONFIG_ARCH_MPC8360) printf(" DDR Secondary: %-4s MHz\n", strmhz(buf, gd->arch.mem_sec_clk)); #endif diff --git a/arch/powerpc/include/asm/fsl_lbc.h b/arch/powerpc/include/asm/fsl_lbc.h index 0ea44560332..3528acd627d 100644 --- a/arch/powerpc/include/asm/fsl_lbc.h +++ b/arch/powerpc/include/asm/fsl_lbc.h @@ -43,10 +43,10 @@ void lbc_sdram_init(void); #define BR_MSEL0x00E0 #define BR_MSEL_SHIFT 5 #define BR_MS_GPCM 0x /* GPCM */ -#if !defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_MPC8360) +#if !defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_ARCH_MPC8360) #define BR_MS_FCM 0x0020 /* FCM */ #endif -#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC8360) +#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC8360) #define BR_MS_SDRAM0x0060 /* SDRAM */ #elif defined(CONFIG_MPC85xx) #define BR_MS_SDRAM0x /* SDRAM */ diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h index cd0d76696d2..cf3ba588220 100644 --- a/arch/powerpc/include/asm/global_data.h +++ b/arch/powerpc/include/asm/global_data.h @@ -61,9 +61,9 @@ struct arch_global_data { # if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315) u32 sata_clk; # endif -# if defined(CONFIG_MPC8360) +# if defined(CONFIG_ARCH_MPC8360) u32 mem_sec_clk; -# endif /* CONFIG_MPC8360 */ +# endif /* CONFIG_ARCH_MPC8360 */ #endif #endif #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) diff --git a/arch/powerpc/include/asm/immap_83xx.h b/arch/powerpc/include/asm/immap_83xx.h index bf7a4b9250c..f6721e7b1d5 100644 --- a/arch/powerpc/include/asm/immap_83xx.h +++ b/arch/powerpc/include/asm/immap_83xx.h @@ -803,7 +803,7
[U-Boot] [PATCH v2 06/58] mpc83xx: Introduce ARCH_MPC837X
Replace CONFIG_MPC837x with a proper CONFIG_ARCH_MPC837X Kconfig option. Signed-off-by: Mario Six --- v1 -> v2: No changes --- arch/powerpc/cpu/mpc83xx/Kconfig | 5 + arch/powerpc/cpu/mpc83xx/speed.c | 30 ++-- arch/powerpc/include/asm/arch-mpc83xx/gpio.h | 2 +- arch/powerpc/include/asm/global_data.h | 6 +++--- arch/powerpc/include/asm/immap_83xx.h| 2 +- arch/powerpc/include/asm/mpc8xxx_spi.h | 2 +- drivers/ram/mpc83xx_sdram.c | 8 include/configs/MPC837XEMDS.h| 1 - include/configs/MPC837XERDB.h| 1 - include/mpc83xx.h| 24 +++--- scripts/config_whitelist.txt | 1 - 11 files changed, 42 insertions(+), 40 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 5f9d036e371..e41f4d1f9a3 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -64,12 +64,14 @@ config TARGET_MPC8349ITX config TARGET_MPC837XEMDS bool "Support MPC837XEMDS" + select ARCH_MPC837X select BOARD_EARLY_INIT_F imply CMD_SATA imply FSL_SATA config TARGET_MPC837XERDB bool "Support MPC837XERDB" + select ARCH_MPC837X select BOARD_EARLY_INIT_F config TARGET_IDS8313 @@ -151,6 +153,9 @@ config ARCH_MPC8349 config ARCH_MPC8360 bool +config ARCH_MPC837X + bool + source "board/esd/vme8349/Kconfig" source "board/freescale/mpc8308rdb/Kconfig" source "board/freescale/mpc8313erdb/Kconfig" diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c index ed77675a8ea..668ed27862b 100644 --- a/arch/powerpc/cpu/mpc83xx/speed.c +++ b/arch/powerpc/cpu/mpc83xx/speed.c @@ -86,7 +86,7 @@ int get_clocks(void) u32 csb_clk; #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \ - defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x) + defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X) u32 tsec1_clk; u32 tsec2_clk; u32 usbdr_clk; @@ -123,11 +123,11 @@ int get_clocks(void) u32 brg_clk; #endif #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \ - defined(CONFIG_MPC837x) + defined(CONFIG_ARCH_MPC837X) u32 pciexp1_clk; u32 pciexp2_clk; #endif -#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315) +#if defined(CONFIG_ARCH_MPC837X) || defined(CONFIG_ARCH_MPC8315) u32 sata_clk; #endif @@ -156,7 +156,7 @@ int get_clocks(void) sccr = im->clk.sccr; #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \ - defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x) + defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X) switch ((sccr & SCCR_TSEC1CM) >> SCCR_TSEC1CM_SHIFT) { case 0: tsec1_clk = 0; @@ -177,7 +177,7 @@ int get_clocks(void) #endif #if defined(CONFIG_ARCH_MPC830X) || defined(CONFIG_ARCH_MPC831X) || \ - defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x) + defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X) switch ((sccr & SCCR_USBDRCM) >> SCCR_USBDRCM_SHIFT) { case 0: usbdr_clk = 0; @@ -198,7 +198,7 @@ int get_clocks(void) #endif #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC8315) || \ - defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x) + defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X) switch ((sccr & SCCR_TSEC2CM) >> SCCR_TSEC2CM_SHIFT) { case 0: tsec2_clk = 0; @@ -321,7 +321,7 @@ int get_clocks(void) i2c1_clk = enc_clk; #elif defined(CONFIG_FSL_ESDHC) i2c1_clk = sdhc_clk; -#elif defined(CONFIG_MPC837x) +#elif defined(CONFIG_ARCH_MPC837X) i2c1_clk = enc_clk; #elif defined(CONFIG_ARCH_MPC8309) i2c1_clk = csb_clk; @@ -331,7 +331,7 @@ int get_clocks(void) #endif #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \ - defined(CONFIG_MPC837x) + defined(CONFIG_ARCH_MPC837X) switch ((sccr & SCCR_PCIEXP1CM) >> SCCR_PCIEXP1CM_SHIFT) { case 0: pciexp1_clk = 0; @@ -369,7 +369,7 @@ int get_clocks(void) } #endif -#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315) +#if defined(CONFIG_ARCH_MPC837X) || defined(CONFIG_ARCH_MPC8315) switch ((sccr & SCCR_SATA1CM) >> SCCR_SATA1CM_SHIFT) { case 0: sata_clk = 0; @@ -449,7 +449,7 @@ int get_clocks(void) gd->arch.csb_clk = csb_clk; #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \ - defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x) + defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X) gd->arch.tsec1_clk = tsec1_clk; gd->arch.tsec2_clk = tsec2_clk; gd->arch.usbdr_cl
[U-Boot] [PATCH v2 09/58] keymile: Unroll includes
To further simplify config include files, unroll the km/km8309-common.h and km/km8321-common.h include files. Signed-off-by: Mario Six --- v1 -> v2: No changes --- include/configs/km8309-common.h | 174 include/configs/km8321-common.h | 139 include/configs/kmtegr1.h | 164 - include/configs/kmvect1.h | 164 - include/configs/suvd3.h | 116 ++- include/configs/tuxx1.h | 115 +- 6 files changed, 551 insertions(+), 321 deletions(-) delete mode 100644 include/configs/km8309-common.h delete mode 100644 include/configs/km8321-common.h diff --git a/include/configs/km8309-common.h b/include/configs/km8309-common.h deleted file mode 100644 index 3bd334c5152..000 --- a/include/configs/km8309-common.h +++ /dev/null @@ -1,174 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (C) 2012 Keymile AG - *Gerlando Falauto - * - * Based on km8321-common.h, see respective copyright notice for credits - */ - -#ifndef __CONFIG_KM8309_COMMON_H -#define __CONFIG_KM8309_COMMON_H - -/* - * High Level Configuration Options - */ -#define CONFIG_E3001 /* E300 family */ -#define CONFIG_QE 1 /* Has QE */ - -#define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0" - -/* include common defines/options for all 83xx Keymile boards */ -#include "km83xx-common.h" - -/* QE microcode/firmware address */ -#define CONFIG_SYS_QE_FMAN_FW_IN_NOR -/* between the u-boot partition and env */ -#ifndef CONFIG_SYS_QE_FW_ADDR -#define CONFIG_SYS_QE_FW_ADDR 0xF00C -#endif - -/* - * System IO Config - */ -/* 0x14000180 SICR_1 */ -#define CONFIG_SYS_SICRL (0\ - | SICR_1_UART1_UART1RTS \ - | SICR_1_I2C_CKSTOP \ - | SICR_1_IRQ_A_IRQ \ - | SICR_1_IRQ_B_IRQ \ - | SICR_1_GPIO_A_GPIO\ - | SICR_1_GPIO_B_GPIO\ - | SICR_1_GPIO_C_GPIO\ - | SICR_1_GPIO_D_GPIO\ - | SICR_1_GPIO_E_GPIO\ - | SICR_1_GPIO_F_GPIO\ - | SICR_1_USB_A_UART2S \ - | SICR_1_USB_B_UART2RTS \ - | SICR_1_FEC1_FEC1 \ - | SICR_1_FEC2_FEC2 \ - ) - -/* 0x00080400 SICR_2 */ -#define CONFIG_SYS_SICRH (0\ - | SICR_2_FEC3_FEC3 \ - | SICR_2_HDLC1_A_HDLC1 \ - | SICR_2_ELBC_A_LA \ - | SICR_2_ELBC_B_LCLK\ - | SICR_2_HDLC2_A_HDLC2 \ - | SICR_2_USB_D_GPIO \ - | SICR_2_PCI_PCI\ - | SICR_2_HDLC1_B_HDLC1 \ - | SICR_2_HDLC1_C_HDLC1 \ - | SICR_2_HDLC2_B_GPIO \ - | SICR_2_HDLC2_C_HDLC2 \ - | SICR_2_QUIESCE_B \ - ) - -/* GPR_1 */ -#define CONFIG_SYS_GPR1 0x50008060 - -#define CONFIG_SYS_GP1DIR 0x -#define CONFIG_SYS_GP1ODR 0x -#define CONFIG_SYS_GP2DIR 0xFF00 -#define CONFIG_SYS_GP2ODR 0x - -/* - * Hardware Reset Configuration Word - */ -#define CONFIG_SYS_HRCW_LOW (\ - HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \ - HRCWL_DDR_TO_SCB_CLK_2X1 | \ - HRCWL_CSB_TO_CLKIN_2X1 | \ - HRCWL_CORE_TO_CSB_2X1 | \ - HRCWL_CE_PLL_VCO_DIV_2 | \ - HRCWL_CE_TO_PLL_1X3) - -#define CONFIG_SYS_HRCW_HIGH (\ - HRCWH_PCI_AGENT | \ - HRCWH_PCI_ARBITER_DISABLE | \ - HRCWH_CORE_ENABLE | \ - HRCWH_FROM_0X0100 | \ - HRCWH_BOOTSEQ_DISABLE | \ - HRCWH_SW_WATCHDOG_DISABLE | \ - HRCWH_ROM_LOC_LOCAL_16BIT | \ - HRCWH_BIG_ENDIAN | \ - HRCWH_LALE_NORMAL) - -#define CONFIG_SYS_DDRCDR (\ - DDRCDR_EN | \ - DDRCDR_PZ_MAXZ | \ - DDRCDR_NZ_MAXZ | \ - DDRCDR_M_ODR) - -#define CONFIG_SYS_DDR_CS0_BNDS0x007f -#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \ -SDRAM_CFG_32_BE | \ -SDRAM_CFG_SREN | \ -SDRAM_CFG_HSE) - -#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000 -#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05) -#define CONFIG_SYS_DDR_INTERVAL((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \ -(0x200 << SDRAM_INTERVAL_REFINT_SHIFT)) - -#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \ -CSCONFIG_ODT_RD_NEVER | \ -
[U-Boot] [PATCH v2 08/58] keymile: Move config files
We want to unroll several include files, while keeping include statements consistent. To make it easier to not break the include statements, move the include files to the main configs directory. All three include files moved will be unrolled, so they won't pollute the directory for long. Signed-off-by: Mario Six --- v1 -> v2: No changes --- include/configs/{km => }/km8309-common.h | 0 include/configs/{km => }/km8321-common.h | 0 include/configs/km8360.h | 2 +- include/configs/{km => }/km83xx-common.h | 4 ++-- include/configs/kmtegr1.h| 4 ++-- include/configs/kmvect1.h| 4 ++-- include/configs/suvd3.h | 4 ++-- include/configs/tuxx1.h | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) rename include/configs/{km => }/km8309-common.h (100%) rename include/configs/{km => }/km8321-common.h (100%) rename include/configs/{km => }/km83xx-common.h (99%) diff --git a/include/configs/km/km8309-common.h b/include/configs/km8309-common.h similarity index 100% rename from include/configs/km/km8309-common.h rename to include/configs/km8309-common.h diff --git a/include/configs/km/km8321-common.h b/include/configs/km8321-common.h similarity index 100% rename from include/configs/km/km8321-common.h rename to include/configs/km8321-common.h diff --git a/include/configs/km8360.h b/include/configs/km8360.h index 7e2876ee088..d6c2772825e 100644 --- a/include/configs/km8360.h +++ b/include/configs/km8360.h @@ -38,7 +38,7 @@ #define CONFIG_QE /* Has QE */ /* include common defines/options for all 83xx Keymile boards */ -#include "km/km83xx-common.h" +#include "km83xx-common.h" /* * System IO Setup diff --git a/include/configs/km/km83xx-common.h b/include/configs/km83xx-common.h similarity index 99% rename from include/configs/km/km83xx-common.h rename to include/configs/km83xx-common.h index fb2a1cb39a0..c80169c9b68 100644 --- a/include/configs/km/km83xx-common.h +++ b/include/configs/km83xx-common.h @@ -8,8 +8,8 @@ #define __CONFIG_KM83XX_H /* include common defines/options for all Keymile boards */ -#include "keymile-common.h" -#include "km-powerpc.h" +#include "km/keymile-common.h" +#include "km/km-powerpc.h" /* * System Clock Setup diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h index 69397ae5ae4..95a131892de 100644 --- a/include/configs/kmtegr1.h +++ b/include/configs/kmtegr1.h @@ -20,7 +20,7 @@ * High Level Configuration Options */ -/* This needs to be set prior to including km/km83xx-common.h */ +/* This needs to be set prior to including km83xx-common.h */ #define CONFIG_HOSTNAME "kmtegr1" #define CONFIG_KM_BOARD_NAME "kmtegr1" @@ -36,7 +36,7 @@ #define NAND_MAX_CHIPS 1 /* include common defines/options for all 8309 Keymile boards */ -#include "km/km8309-common.h" +#include "km8309-common.h" /* must be after the include because KMBEC_FPGA is otherwise undefined */ #define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */ diff --git a/include/configs/kmvect1.h b/include/configs/kmvect1.h index 178e769976a..0bbf541aec7 100644 --- a/include/configs/kmvect1.h +++ b/include/configs/kmvect1.h @@ -20,14 +20,14 @@ * High Level Configuration Options */ -/* This needs to be set prior to including km/km83xx-common.h */ +/* This needs to be set prior to including km83xx-common.h */ #define CONFIG_HOSTNAME"kmvect1" #define CONFIG_KM_BOARD_NAME "kmvect1" /* at end of uboot partition, before env */ #define CONFIG_SYS_QE_FW_ADDR 0xF00B /* include common defines/options for all 8309 Keymile boards */ -#include "km/km8309-common.h" +#include "km8309-common.h" #define CONFIG_SYS_APP1_BASE 0xA000 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */ diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h index 2a3f7ff5260..98137392edb 100644 --- a/include/configs/suvd3.h +++ b/include/configs/suvd3.h @@ -20,12 +20,12 @@ * High Level Configuration Options */ -/* This needs to be set prior to including km/km83xx-common.h */ +/* This needs to be set prior to including km83xx-common.h */ #define CONFIG_HOSTNAME"suvd3" #define CONFIG_KM_BOARD_NAME "suvd3" /* include common defines/options for all 8321 Keymile boards */ -#include "km/km8321-common.h" +#include "km8321-common.h" #define CONFIG_SYS_APP1_BASE 0xA000 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */ diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h index 8729fc9b2ef..1301d230f6d 100644 --- a/include/configs/tuxx1.h +++ b/include/configs/tuxx1.h @@ -43,7 +43,7 @@ #endif /* include common defines/options for all 8321 Keymile boards */ -#include "km/km8321-common.h" +#include "km8321-common.h" #define CONFIG_SYS_APP1_BASE 0xA000/* PAXG */ #defineCONFIG_SYS_APP1_SIZE256 /* Megabytes */ -- 2.11
[U-Boot] [PATCH v2 07/58] keymile: Make distinct kmtegr1, kmvect1, suvd3 configs
The kmtegr1, kmvect1, and suvd3 boards all use the same config include file with lots of #ifdefs in it. The Kconfig migation will become easier if we get rid of these #ifdefs first. Hence, create distinct config include files for these boards, and unwind the #ifdef logic in these config files to only include the options necessary for each board. Signed-off-by: Mario Six --- v1 -> v2: * Combined config creation and simplification patches. --- arch/powerpc/cpu/mpc83xx/Kconfig | 16 - board/keymile/km83xx/Kconfig | 26 configs/kmtegr1_defconfig| 2 +- configs/kmvect1_defconfig| 2 +- include/configs/kmtegr1.h| 100 + include/configs/kmvect1.h| 133 +++ include/configs/suvd3.h | 94 --- 7 files changed, 274 insertions(+), 99 deletions(-) create mode 100644 include/configs/kmtegr1.h create mode 100644 include/configs/kmvect1.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index e41f4d1f9a3..59e0c9a8d08 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -89,9 +89,19 @@ config TARGET_KM8360 config TARGET_SUVD3 bool "Support suvd3" - select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMTEGR1" - select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMVECT1" - select ARCH_MPC832X if SYS_EXTRA_OPTIONS="SUVD3" + select ARCH_MPC832X + imply CMD_CRAMFS + imply FS_CRAMFS + +config TARGET_KMVECT1 + bool "Support kmvect1" + select ARCH_MPC8309 + imply CMD_CRAMFS + imply FS_CRAMFS + +config TARGET_KMTEGR1 + bool "Support kmtegr1" + select ARCH_MPC8309 imply CMD_CRAMFS imply FS_CRAMFS diff --git a/board/keymile/km83xx/Kconfig b/board/keymile/km83xx/Kconfig index d6c594c96ac..d52ee9117b5 100644 --- a/board/keymile/km83xx/Kconfig +++ b/board/keymile/km83xx/Kconfig @@ -11,6 +11,32 @@ config SYS_CONFIG_NAME endif +if TARGET_KMVECT1 + +config SYS_BOARD + default "km83xx" + +config SYS_VENDOR + default "keymile" + +config SYS_CONFIG_NAME + default "kmvect1" + +endif + +if TARGET_KMTEGR1 + +config SYS_BOARD + default "km83xx" + +config SYS_VENDOR + default "keymile" + +config SYS_CONFIG_NAME + default "kmtegr1" + +endif + if TARGET_SUVD3 config SYS_BOARD diff --git a/configs/kmtegr1_defconfig b/configs/kmtegr1_defconfig index 55fbed61c05..d84b91fa34c 100644 --- a/configs/kmtegr1_defconfig +++ b/configs/kmtegr1_defconfig @@ -1,7 +1,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xF000 CONFIG_MPC83xx=y -CONFIG_TARGET_SUVD3=y +CONFIG_TARGET_KMTEGR1=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_SYS_EXTRA_OPTIONS="KMTEGR1" diff --git a/configs/kmvect1_defconfig b/configs/kmvect1_defconfig index 4f513cbb50c..d52e043570a 100644 --- a/configs/kmvect1_defconfig +++ b/configs/kmvect1_defconfig @@ -1,7 +1,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xF000 CONFIG_MPC83xx=y -CONFIG_TARGET_SUVD3=y +CONFIG_TARGET_KMVECT1=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_SYS_EXTRA_OPTIONS="KMVECT1" diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h new file mode 100644 index 000..69397ae5ae4 --- /dev/null +++ b/include/configs/kmtegr1.h @@ -0,0 +1,100 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2006 Freescale Semiconductor, Inc. + *Dave Liu + * + * Copyright (C) 2007 Logic Product Development, Inc. + *Peter Barada + * + * Copyright (C) 2007 MontaVista Software, Inc. + *Anton Vorontsov + * + * (C) Copyright 2010 + * Heiko Schocher, DENX Software Engineering, h...@denx.de. + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +/* + * High Level Configuration Options + */ + +/* This needs to be set prior to including km/km83xx-common.h */ + +#define CONFIG_HOSTNAME "kmtegr1" +#define CONFIG_KM_BOARD_NAME "kmtegr1" +#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0" +#define CONFIG_KM_UBI_PARTITION_NAME_APP "ubi1" + +#define CONFIG_ENV_ADDR0xF010 +#define CONFIG_ENV_OFFSET 0x10 + +#define CONFIG_NAND_ECC_BCH +#define CONFIG_NAND_KMETER1 +#define CONFIG_SYS_MAX_NAND_DEVICE 1 +#define NAND_MAX_CHIPS 1 + +/* include common defines/options for all 8309 Keymile boards */ +#include "km/km8309-common.h" +/* must be after the include because KMBEC_FPGA is otherwise undefined */ +#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */ + +#define CONFIG_SYS_APP1_BASE 0xA000 +#define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */ +#define CONFIG_SYS_APP2_BASE 0xB000 +#define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */ + +/* EEprom support */ +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 + +/* + * Init Local Bus Memory Controller: + * + *
[U-Boot] [PATCH v2 12/58] keymile: Make distinct kmeter1, and kmcoge5ne configs
The kmeter1, and kmcoge5ne boards also build from the same config file with #ifdef logic. Create a separate include config for each board with the #ifdef logic resolved as needed. Signed-off-by: Mario Six --- v1 -> v2: * Combined config creation and simplification patches --- arch/powerpc/cpu/mpc83xx/Kconfig | 11 +- board/keymile/km83xx/Kconfig | 17 +- board/keymile/km83xx/km83xx.c | 2 +- configs/kmcoge5ne_defconfig | 3 +- configs/kmeter1_defconfig | 3 +- include/configs/{km8360.h => kmcoge5ne.h} | 29 -- include/configs/kmeter1.h | 462 ++ 7 files changed, 489 insertions(+), 38 deletions(-) rename include/configs/{km8360.h => kmcoge5ne.h} (95%) create mode 100644 include/configs/kmeter1.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 1ebb092f0bf..29d84f363d1 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -80,8 +80,15 @@ config TARGET_IDS8313 select DM imply CMD_DM -config TARGET_KM8360 - bool "Support km8360" +config TARGET_KMETER1 + bool "Support kmeter1" + select ARCH_MPC8360 + imply CMD_CRAMFS + imply CMD_DIAG + imply FS_CRAMFS + +config TARGET_KMCOGE5NE + bool "Support kmcoge5ne" select ARCH_MPC8360 imply CMD_CRAMFS imply CMD_DIAG diff --git a/board/keymile/km83xx/Kconfig b/board/keymile/km83xx/Kconfig index 0c4fa0b7fdb..f17034f 100644 --- a/board/keymile/km83xx/Kconfig +++ b/board/keymile/km83xx/Kconfig @@ -1,4 +1,4 @@ -if TARGET_KM8360 +if TARGET_KMETER1 config SYS_BOARD default "km83xx" @@ -7,7 +7,20 @@ config SYS_VENDOR default "keymile" config SYS_CONFIG_NAME - default "km8360" + default "kmeter1" + +endif + +if TARGET_KMCOGE5NE + +config SYS_BOARD + default "km83xx" + +config SYS_VENDOR + default "keymile" + +config SYS_CONFIG_NAME + default "kmcoge5ne" endif diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index 12044ee0d70..1fd6f919014 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -271,7 +271,7 @@ int last_stage_init(void) } #endif -#if defined(CONFIG_KMCOGE5NE) +#if defined(CONFIG_TARGET_KMCOGE5NE) struct bfticu_iomap *base = (struct bfticu_iomap *)CONFIG_SYS_BFTIC3_BASE; u8 dip_switch = in_8((u8 *)&(base->mswitch)) & BFTICU_DIPSWITCH_MASK; diff --git a/configs/kmcoge5ne_defconfig b/configs/kmcoge5ne_defconfig index 8a41d1ddc90..2a3f03f28e4 100644 --- a/configs/kmcoge5ne_defconfig +++ b/configs/kmcoge5ne_defconfig @@ -1,10 +1,9 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xF000 CONFIG_MPC83xx=y -CONFIG_TARGET_KM8360=y +CONFIG_TARGET_KMCOGE5NE=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y -CONFIG_SYS_EXTRA_OPTIONS="KMCOGE5NE" CONFIG_MISC_INIT_R=y CONFIG_VERSION_VARIABLE=y CONFIG_BOARD_EARLY_INIT_R=y diff --git a/configs/kmeter1_defconfig b/configs/kmeter1_defconfig index 3f78854da78..3d37333c258 100644 --- a/configs/kmeter1_defconfig +++ b/configs/kmeter1_defconfig @@ -1,10 +1,9 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xF000 CONFIG_MPC83xx=y -CONFIG_TARGET_KM8360=y +CONFIG_TARGET_KMETER1=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y -CONFIG_SYS_EXTRA_OPTIONS="KMETER1" CONFIG_MISC_INIT_R=y CONFIG_VERSION_VARIABLE=y CONFIG_BOARD_EARLY_INIT_R=y diff --git a/include/configs/km8360.h b/include/configs/kmcoge5ne.h similarity index 95% rename from include/configs/km8360.h rename to include/configs/kmcoge5ne.h index 59fe2c216ee..6bf6b765d68 100644 --- a/include/configs/km8360.h +++ b/include/configs/kmcoge5ne.h @@ -12,11 +12,6 @@ #define CONFIG_SYS_KMBEC_FPGA_BASE 0xE800 #define CONFIG_SYS_KMBEC_FPGA_SIZE 64 -#if defined CONFIG_KMETER1 -#define CONFIG_HOSTNAME"kmeter1" -#define CONFIG_KM_BOARD_NAME "kmeter1" -#define CONFIG_KM_DEF_NETDEV "netdev=eth2\0" -#elif defined CONFIG_KMCOGE5NE #define CONFIG_HOSTNAME"kmcoge5ne" #define CONFIG_KM_BOARD_NAME "kmcoge5ne" #define CONFIG_KM_DEF_NETDEV "netdev=eth1\0" @@ -28,9 +23,6 @@ #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0" #define CONFIG_KM_UBI_PARTITION_NAME_APP "ubi1" -#else -#error ("Board not supported") -#endif /* * High Level Configuration Options @@ -169,10 +161,8 @@ #define CONFIG_UEC_ETH #define CONFIG_ETHPRIME"UEC0" -#if !defined(CONFIG_ARCH_MPC8309) #define CONFIG_UEC_ETH1/* GETH1 */ #define UEC_VERBOSE_DEBUG 1 -#endif #ifdef CONFIG_UEC_ETH1 #define CONFIG_SYS_UEC1_UCC_NUM3 /* UCC4 */ @@ -361,7 +351,6 @@ #define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000 -#ifdef CONFIG_KMCOGE5NE /** * KMCOGE5NE has 512 MB RAM */ @@ -372,12 +361,6 @@ CSCONFIG_BANK_BIT_3 | \ CSCONFIG_ROW_BIT_13 | \ CSCONFIG
[U-Boot] [PATCH v2 10/58] keymile: Make distinct kmsupx5, tuge1, kmopti2, and kmtepr2 configs
The kmsupx5, tuge1, kmopti2, and kmtepr2 boards all build from the same include config file with lots of #ifdef logic. To ease Kconfig migration, create new config include files for these boards, and resolve the #ifdef logic as needed. Signed-off-by: Mario Six --- v1 -> v2: * Combined config creation and simplification patches --- arch/powerpc/cpu/mpc83xx/Kconfig | 24 board/keymile/km83xx/Kconfig | 52 + configs/kmopti2_defconfig| 3 +- configs/kmsupx5_defconfig| 3 +- configs/kmtepr2_defconfig| 3 +- configs/tuge1_defconfig | 3 +- configs/tuxx1_defconfig | 1 - include/configs/kmopti2.h| 234 ++ include/configs/kmsupx5.h| 210 ++ include/configs/kmtepr2.h| 235 +++ include/configs/tuge1.h | 210 ++ include/configs/tuxx1.h | 62 --- 12 files changed, 969 insertions(+), 71 deletions(-) create mode 100644 include/configs/kmopti2.h create mode 100644 include/configs/kmsupx5.h create mode 100644 include/configs/kmtepr2.h create mode 100644 include/configs/tuge1.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 59e0c9a8d08..1ebb092f0bf 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -111,6 +111,30 @@ config TARGET_TUXX1 imply CMD_CRAMFS imply FS_CRAMFS +config TARGET_KMSUPX5 + bool "Support kmsupx5" + select ARCH_MPC832X + imply CMD_CRAMFS + imply FS_CRAMFS + +config TARGET_TUGE1 + bool "Support tuge1" + select ARCH_MPC832X + imply CMD_CRAMFS + imply FS_CRAMFS + +config TARGET_KMOPTI2 + bool "Support kmopti2" + select ARCH_MPC832X + imply CMD_CRAMFS + imply FS_CRAMFS + +config TARGET_KMTEPR2 + bool "Support kmtepr2" + select ARCH_MPC832X + imply CMD_CRAMFS + imply FS_CRAMFS + config TARGET_TQM834X bool "Support TQM834x" select ARCH_MPC8349 diff --git a/board/keymile/km83xx/Kconfig b/board/keymile/km83xx/Kconfig index d52ee9117b5..0c4fa0b7fdb 100644 --- a/board/keymile/km83xx/Kconfig +++ b/board/keymile/km83xx/Kconfig @@ -62,3 +62,55 @@ config SYS_CONFIG_NAME default "tuxx1" endif + +if TARGET_KMSUPX5 + +config SYS_BOARD + default "km83xx" + +config SYS_VENDOR + default "keymile" + +config SYS_CONFIG_NAME + default "kmsupx5" + +endif + +if TARGET_TUGE1 + +config SYS_BOARD + default "km83xx" + +config SYS_VENDOR + default "keymile" + +config SYS_CONFIG_NAME + default "tuge1" + +endif + +if TARGET_KMOPTI2 + +config SYS_BOARD + default "km83xx" + +config SYS_VENDOR + default "keymile" + +config SYS_CONFIG_NAME + default "kmopti2" + +endif + +if TARGET_KMTEPR2 + +config SYS_BOARD + default "km83xx" + +config SYS_VENDOR + default "keymile" + +config SYS_CONFIG_NAME + default "kmtepr2" + +endif diff --git a/configs/kmopti2_defconfig b/configs/kmopti2_defconfig index a81f4a39e6a..a083f8b26e2 100644 --- a/configs/kmopti2_defconfig +++ b/configs/kmopti2_defconfig @@ -1,10 +1,9 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xF000 CONFIG_MPC83xx=y -CONFIG_TARGET_TUXX1=y +CONFIG_TARGET_KMOPTI2=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y -CONFIG_SYS_EXTRA_OPTIONS="KMOPTI2" CONFIG_MISC_INIT_R=y CONFIG_VERSION_VARIABLE=y CONFIG_BOARD_EARLY_INIT_R=y diff --git a/configs/kmsupx5_defconfig b/configs/kmsupx5_defconfig index 8234e1454ff..d108a009050 100644 --- a/configs/kmsupx5_defconfig +++ b/configs/kmsupx5_defconfig @@ -1,10 +1,9 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xF000 CONFIG_MPC83xx=y -CONFIG_TARGET_TUXX1=y +CONFIG_TARGET_KMSUPX5=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y -CONFIG_SYS_EXTRA_OPTIONS="KMSUPX5" CONFIG_MISC_INIT_R=y CONFIG_VERSION_VARIABLE=y CONFIG_BOARD_EARLY_INIT_R=y diff --git a/configs/kmtepr2_defconfig b/configs/kmtepr2_defconfig index ef7453f85ae..29ecf387829 100644 --- a/configs/kmtepr2_defconfig +++ b/configs/kmtepr2_defconfig @@ -1,10 +1,9 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xF000 CONFIG_MPC83xx=y -CONFIG_TARGET_TUXX1=y +CONFIG_TARGET_KMTEPR2=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y -CONFIG_SYS_EXTRA_OPTIONS="KMTEPR2" CONFIG_MISC_INIT_R=y CONFIG_VERSION_VARIABLE=y CONFIG_BOARD_EARLY_INIT_R=y diff --git a/configs/tuge1_defconfig b/configs/tuge1_defconfig index bee1baa41ed..11da663f3bb 100644 --- a/configs/tuge1_defconfig +++ b/configs/tuge1_defconfig @@ -1,10 +1,9 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xF000 CONFIG_MPC83xx=y -CONFIG_TARGET_TUXX1=y +CONFIG_TARGET_TUGE1=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y -CONFIG_SYS_EXTRA_OPTIONS="TUGE1" CONFIG_MISC_INIT_R=y CONFIG_VERSION_VARIABLE=y CONFIG_BOARD_EARLY_INIT_R=y diff --git a/configs/tuxx1_defconfig b/configs
[U-Boot] [PATCH v2 11/58] keymile: Unroll km/km83xx-common.h
Simplify the keymile config files once more by unrolling the km/km83xx-common.h, and resolve the #ifdef logic as needed. Signed-off-by: Mario Six --- v1 -> v2: No changes --- include/configs/km8360.h| 291 ++- include/configs/km83xx-common.h | 296 include/configs/kmopti2.h | 289 ++- include/configs/kmsupx5.h | 289 ++- include/configs/kmtegr1.h | 288 +- include/configs/kmtepr2.h | 289 ++- include/configs/kmvect1.h | 288 +- include/configs/suvd3.h | 291 ++- include/configs/tuge1.h | 289 ++- include/configs/tuxx1.h | 289 ++- 10 files changed, 2579 insertions(+), 320 deletions(-) delete mode 100644 include/configs/km83xx-common.h diff --git a/include/configs/km8360.h b/include/configs/km8360.h index d6c2772825e..59fe2c216ee 100644 --- a/include/configs/km8360.h +++ b/include/configs/km8360.h @@ -37,8 +37,295 @@ */ #define CONFIG_QE /* Has QE */ -/* include common defines/options for all 83xx Keymile boards */ -#include "km83xx-common.h" +/* include common defines/options for all Keymile boards */ +#include "km/keymile-common.h" +#include "km/km-powerpc.h" + +/* + * System Clock Setup + */ +#define CONFIG_83XX_CLKIN 6600 +#define CONFIG_SYS_CLK_FREQ6600 +#define CONFIG_83XX_PCICLK 6600 + +/* + * IMMR new address + */ +#define CONFIG_SYS_IMMR0xE000 + +/* + * Bus Arbitration Configuration Register (ACR) + */ +#define CONFIG_SYS_ACR_PIPE_DEP 3 /* pipeline depth 4 transactions */ +#define CONFIG_SYS_ACR_RPTCNT 3 /* 4 consecutive transactions */ +#define CONFIG_SYS_ACR_APARK0 /* park bus to master (below) */ +#define CONFIG_SYS_ACR_PARKM3 /* parking master = QuiccEngine */ + +/* + * DDR Setup + */ +#define CONFIG_SYS_DDR_BASE0x /* DDR is system memory */ +#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE +#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x1000) /* +256M */ + +#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE +#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \ + DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05) + +#define CFG_83XX_DDR_USES_CS0 + +/* + * Manually set up DDR parameters + */ +#define CONFIG_DDR_II +#define CONFIG_SYS_DDR_SIZE2048 /* MB */ + +/* + * The reserved memory + */ +#define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE /* start of monitor */ +#define CONFIG_SYS_FLASH_BASE 0xF000 + +#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE) +#define CONFIG_SYS_RAMBOOT +#endif + +/* Reserve 768 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (768 * 1024) + +/* + * Initial RAM Base Address Setup + */ +#define CONFIG_SYS_INIT_RAM_LOCK +#define CONFIG_SYS_INIT_RAM_ADDR 0xE600 /* Initial RAM address */ +#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */ +#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \ + GENERATED_GBL_DATA_SIZE) + +/* + * Init Local Bus Memory Controller: + * + * Bank Bus Machine PortSz Size Device + * --- --- -- - -- + * 0 Local GPCM16 bit 256MB FLASH + * 1 Local GPCM 8 bit 128MB GPIO/PIGGY + * + */ +/* + * FLASH on the Local Bus + */ +#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */ +#define CONFIG_FLASH_CFI_DRIVER/* use the CFI driver */ +#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */ +#define CONFIG_SYS_FLASH_PROTECTION +#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE + +#define CONFIG_SYS_LBLAWBAR0_PRELIMCONFIG_SYS_FLASH_BASE +#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB) + +#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \ + BR_PS_16 | /* 16 bit port size */ \ + BR_MS_GPCM | /* MSEL = GPCM */ \ + BR_V) + +#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \ + OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \ + OR_GPCM_SCY_5 | \ + OR_GPCM_TRLX_SET | OR_GPCM_EAD) + +#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of flash banks */ +#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */ +#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE } + +/* + * PRIO1/PIGGY on the local bus CS1 + */ +/* Window base at flash base */ +
[U-Boot] [PATCH v2 13/58] mpc83xx: Make distinct MPC8313ERDB targets
MPC8313ERDB has the option of either enabling NOR or NAND boot in its config file (by commenting out certain #ifdefs). To keep this ability after migrating options to Kconfig, we introduce two MPC8313ERDB configs: one for NOR, and one for NAND. Signed-off-by: Mario Six --- v1 -> v2: * Combined config creation and simplification patches --- arch/powerpc/cpu/mpc83xx/Kconfig | 10 +- board/freescale/mpc8313erdb/Kconfig| 17 +- configs/MPC8313ERDB_33_defconfig | 2 +- configs/MPC8313ERDB_66_defconfig | 2 +- configs/MPC8313ERDB_NAND_33_defconfig | 2 +- configs/MPC8313ERDB_NAND_66_defconfig | 2 +- .../configs/{MPC8313ERDB.h => MPC8313ERDB_NAND.h} | 61 +-- include/configs/MPC8313ERDB_NOR.h | 594 + 8 files changed, 636 insertions(+), 54 deletions(-) rename include/configs/{MPC8313ERDB.h => MPC8313ERDB_NAND.h} (90%) create mode 100644 include/configs/MPC8313ERDB_NOR.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 29d84f363d1..ede98c70da7 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -29,8 +29,14 @@ config TARGET_MPC8308RDB select ARCH_MPC8308 select SYS_FSL_ERRATUM_ESDHC111 -config TARGET_MPC8313ERDB - bool "Support MPC8313ERDB" +config TARGET_MPC8313ERDB_NOR + bool "Support MPC8313ERDB_NOR" + select ARCH_MPC8313 + select BOARD_EARLY_INIT_F + select SUPPORT_SPL + +config TARGET_MPC8313ERDB_NAND + bool "Support MPC8313ERDB_NAND" select ARCH_MPC8313 select BOARD_EARLY_INIT_F select SUPPORT_SPL diff --git a/board/freescale/mpc8313erdb/Kconfig b/board/freescale/mpc8313erdb/Kconfig index 145608feab2..b6332a1368b 100644 --- a/board/freescale/mpc8313erdb/Kconfig +++ b/board/freescale/mpc8313erdb/Kconfig @@ -1,4 +1,4 @@ -if TARGET_MPC8313ERDB +if TARGET_MPC8313ERDB_NOR config SYS_BOARD default "mpc8313erdb" @@ -7,6 +7,19 @@ config SYS_VENDOR default "freescale" config SYS_CONFIG_NAME - default "MPC8313ERDB" + default "MPC8313ERDB_NOR" + +endif + +if TARGET_MPC8313ERDB_NAND + +config SYS_BOARD + default "mpc8313erdb" + +config SYS_VENDOR + default "freescale" + +config SYS_CONFIG_NAME + default "MPC8313ERDB_NAND" endif diff --git a/configs/MPC8313ERDB_33_defconfig b/configs/MPC8313ERDB_33_defconfig index 3bb680c2179..cacb5ba0774 100644 --- a/configs/MPC8313ERDB_33_defconfig +++ b/configs/MPC8313ERDB_33_defconfig @@ -1,7 +1,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xFE00 CONFIG_MPC83xx=y -CONFIG_TARGET_MPC8313ERDB=y +CONFIG_TARGET_MPC8313ERDB_NOR=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_SYS_EXTRA_OPTIONS="SYS_33MHZ" diff --git a/configs/MPC8313ERDB_66_defconfig b/configs/MPC8313ERDB_66_defconfig index bb26a9e3813..6b29c2e5c9d 100644 --- a/configs/MPC8313ERDB_66_defconfig +++ b/configs/MPC8313ERDB_66_defconfig @@ -1,7 +1,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xFE00 CONFIG_MPC83xx=y -CONFIG_TARGET_MPC8313ERDB=y +CONFIG_TARGET_MPC8313ERDB_NOR=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_SYS_EXTRA_OPTIONS="SYS_66MHZ" diff --git a/configs/MPC8313ERDB_NAND_33_defconfig b/configs/MPC8313ERDB_NAND_33_defconfig index ab28a78cbe5..4c8957c2742 100644 --- a/configs/MPC8313ERDB_NAND_33_defconfig +++ b/configs/MPC8313ERDB_NAND_33_defconfig @@ -3,7 +3,7 @@ CONFIG_SYS_TEXT_BASE=0x0010 CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL=y CONFIG_MPC83xx=y -CONFIG_TARGET_MPC8313ERDB=y +CONFIG_TARGET_MPC8313ERDB_NAND=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_SYS_EXTRA_OPTIONS="SYS_33MHZ" diff --git a/configs/MPC8313ERDB_NAND_66_defconfig b/configs/MPC8313ERDB_NAND_66_defconfig index a454ec67fc6..ff3d0dc84e9 100644 --- a/configs/MPC8313ERDB_NAND_66_defconfig +++ b/configs/MPC8313ERDB_NAND_66_defconfig @@ -3,7 +3,7 @@ CONFIG_SYS_TEXT_BASE=0x0010 CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL=y CONFIG_MPC83xx=y -CONFIG_TARGET_MPC8313ERDB=y +CONFIG_TARGET_MPC8313ERDB_NAND=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_SYS_EXTRA_OPTIONS="SYS_66MHZ" diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB_NAND.h similarity index 90% rename from include/configs/MPC8313ERDB.h rename to include/configs/MPC8313ERDB_NAND.h index c5a8065d6a4..976b6854e49 100644 --- a/include/configs/MPC8313ERDB.h +++ b/include/configs/MPC8313ERDB_NAND.h @@ -15,7 +15,6 @@ #define CONFIG_E3001 #define CONFIG_MPC8313ERDB 1 -#ifdef CONFIG_NAND #define CONFIG_SPL_INIT_MINIMAL #define CONFIG_SPL_FLUSH_IMAGE #define CONFIG_SPL_TARGET "u-boot-with-spl.bin" @@ -40,8 +39,6 @@ #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE_SPL /* start of monitor */ #endif -#endif /* CONFIG_NAND */ - #ifndef CONFIG_SYS_MONITOR_BASE #define CONFIG_SYS_MONITOR_BASE
[U-Boot] [PATCH v2 15/58] mpc83xx: Make distinct caddy2 config
vme8349.h contains two separate boards: The vme8349 itself, and the caddy2 board. The caddy2 board is chosen by setting certain config variables. Create a proper config file for the caddy2 board to make Kconfig migration easier. Furthermoew, simplify the vme8349 and caddy2 configs by keeping only the options necessary for each board. Signed-off-by: Mario Six --- v1 -> v2: * Combined config creation and simplification patches --- arch/powerpc/cpu/mpc83xx/Kconfig | 4 + board/esd/vme8349/Kconfig| 13 + board/esd/vme8349/vme8349.c | 8 +- configs/caddy2_defconfig | 3 +- drivers/pci/pci_auto.c | 3 +- drivers/pci/pci_auto_old.c | 3 +- include/configs/caddy2.h | 512 +++ include/configs/vme8349.h| 29 --- 8 files changed, 538 insertions(+), 37 deletions(-) create mode 100644 include/configs/caddy2.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index ede98c70da7..65f4583ffea 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -24,6 +24,10 @@ config TARGET_VME8349 bool "Support vme8349" select ARCH_MPC8349 +config TARGET_CADDY2 + bool "Support caddy2" + select ARCH_MPC8349 + config TARGET_MPC8308RDB bool "Support MPC8308RDB" select ARCH_MPC8308 diff --git a/board/esd/vme8349/Kconfig b/board/esd/vme8349/Kconfig index b8d9432dcc9..ef2af40f7e8 100644 --- a/board/esd/vme8349/Kconfig +++ b/board/esd/vme8349/Kconfig @@ -10,3 +10,16 @@ config SYS_CONFIG_NAME default "vme8349" endif + +if TARGET_CADDY2 + +config SYS_BOARD + default "vme8349" + +config SYS_VENDOR + default "esd" + +config SYS_CONFIG_NAME + default "caddy2" + +endif diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c index 45ad3a83ee8..a46d0b6da63 100644 --- a/board/esd/vme8349/vme8349.c +++ b/board/esd/vme8349/vme8349.c @@ -60,7 +60,7 @@ int dram_init(void) int checkboard(void) { -#ifdef VME_CADDY2 +#ifdef CONFIG_TARGET_CADDY2 puts("Board: esd VME-CADDY/2\n"); #else puts("Board: esd VME-CPU/8349\n"); @@ -69,7 +69,7 @@ int checkboard(void) return 0; } -#ifdef VME_CADDY2 +#ifdef CONFIG_TARGET_CADDY2 int board_eth_init(bd_t *bis) { return pci_eth_init(bis); @@ -102,7 +102,7 @@ int misc_init_r() * Provide SPD values for spd_sdram(). Both boards (VME-CADDY/2 * and VME-CADDY/2) have different SDRAM configurations. */ -#ifdef VME_CADDY2 +#ifdef CONFIG_TARGET_CADDY2 #define SMALL_RAM 0xff #define LARGE_RAM 0x00 #else @@ -165,7 +165,7 @@ static spd_eeprom_t default_spd_eeprom = { SPD_VAL(0x7e, 0x1d),/* 63 */ { 'e', 's', 'd', '-', 'g', 'm', 'b', 'h' }, SPD_VAL(0x00, 0x00),/* 72 */ -#ifdef VME_CADDY2 +#ifdef CONFIG_TARGET_CADDY2 { "vme-caddy/2 ram " } #else { "vme-cpu/2 ram " } diff --git a/configs/caddy2_defconfig b/configs/caddy2_defconfig index 5fec4f8d499..fe0c34fc61a 100644 --- a/configs/caddy2_defconfig +++ b/configs/caddy2_defconfig @@ -1,10 +1,9 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xFFF0 CONFIG_MPC83xx=y -CONFIG_TARGET_VME8349=y +CONFIG_TARGET_CADDY2=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y -CONFIG_SYS_EXTRA_OPTIONS="CADDY2" CONFIG_BOOTDELAY=6 CONFIG_MISC_INIT_R=y CONFIG_HUSH_PARSER=y diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c index f5e46842bf6..1a3bf708347 100644 --- a/drivers/pci/pci_auto.c +++ b/drivers/pci/pci_auto.c @@ -359,7 +359,8 @@ int dm_pciauto_config_device(struct udevice *dev) PCI_DEV(dm_pci_get_bdf(dev))); break; #endif -#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) +#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) && \ + !defined(CONFIG_TARGET_CADDY2) case PCI_CLASS_BRIDGE_OTHER: /* * The host/PCI bridge 1 seems broken in 8349 - it presents diff --git a/drivers/pci/pci_auto_old.c b/drivers/pci/pci_auto_old.c index 6ab1b3b43fc..b566705c9d9 100644 --- a/drivers/pci/pci_auto_old.c +++ b/drivers/pci/pci_auto_old.c @@ -376,7 +376,8 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev) PCI_DEV(dev)); break; #endif -#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) +#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) && \ + !defined(CONFIG_TARGET_CADDY2) case PCI_CLASS_BRIDGE_OTHER: /* * The host/PCI bridge 1 seems broken in 8349 - it presents diff --git a/include/configs/caddy2.h b/include/configs/caddy2.h new file mode 100644 index 000..a7dd0b3 --- /dev/null +++ b/include/configs/caddy2.h @@ -0,0 +1,512 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * esd vme8349 U-Boot configuration file + * Copyright (c) 2008, 2009 esd gmb
[U-Boot] [PATCH v2 16/58] powerpc: Add LSDMR config values
The LSDMR_* macros are used to configure the system bus on MPC83xx. A few of the possible LSDMR_* macros were never defined in the respective include files. This renders the SDRAM support on the MPC8349EMDS unusable, because it uses these undefined macros. To make the SDRAM option work, introduce these macros into the proper config file. Signed-off-by: Mario Six --- v1 -> v2: No changes --- arch/powerpc/include/asm/fsl_lbc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/include/asm/fsl_lbc.h b/arch/powerpc/include/asm/fsl_lbc.h index 3528acd627d..bf352d9a561 100644 --- a/arch/powerpc/include/asm/fsl_lbc.h +++ b/arch/powerpc/include/asm/fsl_lbc.h @@ -428,14 +428,17 @@ void lbc_sdram_init(void); #define LSDMR_BSMA1516 (3 << (31 - 10)) #define LSDMR_BSMA1617 (4 << (31 - 10)) #define LSDMR_RFCR5(3 << (31 - 16)) +#define LSDMR_RFCR8 (5 << (31 - 16)) #define LSDMR_RFCR16 (7 << (31 - 16)) #define LSDMR_PRETOACT3 (3 << (31 - 19)) +#define LSDMR_PRETOACT6 (5 << (31 - 19)) #define LSDMR_PRETOACT7(7 << (31 - 19)) #define LSDMR_ACTTORW3 (3 << (31 - 22)) #define LSDMR_ACTTORW7 (7 << (31 - 22)) #define LSDMR_ACTTORW6 (6 << (31 - 22)) #define LSDMR_BL8 (1 << (31 - 23)) #define LSDMR_WRC2 (2 << (31 - 27)) +#define LSDMR_WRC3 (3 << (31 - 27)) #define LSDMR_WRC4 (0 << (31 - 27)) #define LSDMR_BUFCMD (1 << (31 - 29)) #define LSDMR_CL3 (3 << (31 - 31)) -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 20/58] MPC832XEMDS: Migrate to CONFIG_TARGET_MPC832XEMDS
Use the proper CONFIG_TARGET_MPC832XEMDS Kconfig option to replace the CONFIG_MPC832XEMDS ad-hoc config option. Signed-off-by: Mario Six --- v1 -> v2: * Removed config option from whitelist --- board/freescale/common/pq-mds-pib.c | 6 +++--- include/configs/MPC832XEMDS.h | 1 - scripts/config_whitelist.txt| 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/board/freescale/common/pq-mds-pib.c b/board/freescale/common/pq-mds-pib.c index d152a7821f4..ae660398575 100644 --- a/board/freescale/common/pq-mds-pib.c +++ b/board/freescale/common/pq-mds-pib.c @@ -36,7 +36,7 @@ int pib_init(void) i2c_write(0x26, 0x6, 1, &val8, 1); val8 = 0x34; i2c_write(0x26, 0x7, 1, &val8, 1); -#if defined(CONFIG_MPC832XEMDS) +#if defined(CONFIG_TARGET_MPC832XEMDS) val8 = 0xf9;/* PMC2, PMC3 slot to PCI bus */ #else val8 = 0xf3;/* PMC1, PMC2, PMC3 slot to PCI bus */ @@ -55,7 +55,7 @@ int pib_init(void) eieio(); -#if defined(CONFIG_MPC832XEMDS) +#if defined(CONFIG_TARGET_MPC832XEMDS) printf("PCI 32bit bus on PMC2 &PMC3\n"); #else printf("PCI 32bit bus on PMC1 & PMC2 &PMC3\n"); @@ -76,7 +76,7 @@ int pib_init(void) eieio(); printf("QOC3 ATM card on PMC0\n"); -#elif defined(CONFIG_MPC832XEMDS) +#elif defined(CONFIG_TARGET_MPC832XEMDS) val8 = 0; i2c_write(0x26, 0x7, 1, &val8, 1); val8 = 0xf7; diff --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h index 0bb7db9bc37..4cb595bb8e5 100644 --- a/include/configs/MPC832XEMDS.h +++ b/include/configs/MPC832XEMDS.h @@ -11,7 +11,6 @@ */ #define CONFIG_E3001 /* E300 family */ #define CONFIG_QE 1 /* Has QE */ -#define CONFIG_MPC832XEMDS 1 /* MPC832XEMDS board specific */ /* * System Clock Setup diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 4c34c02265d..5da8146c893 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1261,7 +1261,6 @@ CONFIG_MMU CONFIG_MONITOR_IS_IN_RAM CONFIG_MPC8313ERDB CONFIG_MPC8315ERDB -CONFIG_MPC832XEMDS CONFIG_MPC8349ITX CONFIG_MPC837XEMDS CONFIG_MPC837XERDB -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 14/58] vme8349: Migrate to CONFIG_TARGET_VME8349
CONFIG_TARGET_VME8349 can replace CONFIG_VME8349. Hence, replace CONFIG_VME8349 with CONFIG_TARGET_VME8349, and remove CONFIG_VME8349. Signed-off-by: Mario Six --- v1 -> v2: No changes --- drivers/pci/pci_auto.c | 2 +- drivers/pci/pci_auto_old.c | 2 +- include/configs/vme8349.h | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c index a673d8ae136..f5e46842bf6 100644 --- a/drivers/pci/pci_auto.c +++ b/drivers/pci/pci_auto.c @@ -359,7 +359,7 @@ int dm_pciauto_config_device(struct udevice *dev) PCI_DEV(dm_pci_get_bdf(dev))); break; #endif -#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_VME8349) +#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) case PCI_CLASS_BRIDGE_OTHER: /* * The host/PCI bridge 1 seems broken in 8349 - it presents diff --git a/drivers/pci/pci_auto_old.c b/drivers/pci/pci_auto_old.c index 90c22a08cbc..6ab1b3b43fc 100644 --- a/drivers/pci/pci_auto_old.c +++ b/drivers/pci/pci_auto_old.c @@ -376,7 +376,7 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev) PCI_DEV(dev)); break; #endif -#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_VME8349) +#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) case PCI_CLASS_BRIDGE_OTHER: /* * The host/PCI bridge 1 seems broken in 8349 - it presents diff --git a/include/configs/vme8349.h b/include/configs/vme8349.h index 56955501309..fe570abf8f7 100644 --- a/include/configs/vme8349.h +++ b/include/configs/vme8349.h @@ -28,7 +28,6 @@ * High Level Configuration Options */ #define CONFIG_E3001 /* E300 Family */ -#define CONFIG_VME8349 1 /* ESD VME8349 board specific */ /* Don't enable PCI2 on vme834x - it doesn't exist physically. */ #undef CONFIG_MPC83XX_PCI2 /* support for 2nd PCI controller */ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 19/58] ve8313: Merge BR/OR settings
The ve8313 has the option of either configuring the eLBC (enhanced local system bus) such that * NOR flash is the first memory bank, and NAND flash is the second memory bank, or * NAND flash is the first memory bank, and NOR flash is the second memory bank, by using CONFIG_SYS_NOR_{BR,OR}_PRELIM and CONFIG_SYS_NAND_{BR,OR}_PRELIM for defining CONFIG_SYS_{BR,OR}{0,1}_PRELIM. After Kconfig migration, replacing some lines in the defconfig will have the same effect. Hence, we will not create distinct ve8313_{NOR,NAND} configs for such a small change. Instead, fix the current default (NOR first, NAND second), and unroll the CONFIG_SYS_NAND_{BR,OR}_PRELIM options. This will ease the Kconfig migration Signed-off-by: Mario Six --- v1 -> v2: No changes --- include/configs/ve8313.h | 39 +++ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/include/configs/ve8313.h b/include/configs/ve8313.h index 791eac363bd..87fbe36640b 100644 --- a/include/configs/ve8313.h +++ b/include/configs/ve8313.h @@ -115,18 +115,6 @@ #define CONFIG_SYS_FLASH_SIZE 32 /* size in MB */ #define CONFIG_SYS_FLASH_EMPTY_INFO/* display empty sectors */ -#define CONFIG_SYS_NOR_BR_PRELIM (CONFIG_SYS_FLASH_BASE \ - | BR_PS_16 /* 16 bit */ \ - | BR_MS_GPCM/* MSEL = GPCM */ \ - | BR_V) /* valid */ -#define CONFIG_SYS_NOR_OR_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \ - | OR_GPCM_CSNT \ - | OR_GPCM_ACS_DIV4 \ - | OR_GPCM_SCY_5 \ - | OR_GPCM_TRLX_SET \ - | OR_GPCM_EAD) - /* 0xfe000c55 */ - #define CONFIG_SYS_LBLAWBAR0_PRELIMCONFIG_SYS_FLASH_BASE #define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_32MB) @@ -172,24 +160,35 @@ #define CONFIG_NAND_FSL_ELBC 1 #define CONFIG_SYS_NAND_BLOCK_SIZE 16384 -#define CONFIG_SYS_NAND_BR_PRELIM (CONFIG_SYS_NAND_BASE \ + +#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE \ + | BR_PS_16 /* 16 bit */ \ + | BR_MS_GPCM/* MSEL = GPCM */ \ + | BR_V) /* valid */ +#define CONFIG_SYS_OR0_PRELIM (OR_AM_32MB \ + | OR_GPCM_CSNT \ + | OR_GPCM_ACS_DIV4 \ + | OR_GPCM_SCY_5 \ + | OR_GPCM_TRLX_SET \ + | OR_GPCM_EAD) + /* 0xfe000c55 */ + +#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_NAND_BASE \ | BR_PS_8 \ | BR_DECC_CHK_GEN \ | BR_MS_FCM \ | BR_V) /* valid */ /* 0x61000c21 */ -#define CONFIG_SYS_NAND_OR_PRELIM (OR_AM_32KB \ +#define CONFIG_SYS_OR1_PRELIM (OR_AM_32KB \ | OR_FCM_BCTLD \ | OR_FCM_CHT \ | OR_FCM_SCY_2 \ | OR_FCM_RST \ - | OR_FCM_TRLX) - /* 0x90ac */ + | OR_FCM_TRLX) /* 0x90ac */ -#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NOR_BR_PRELIM -#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NOR_OR_PRELIM -#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NAND_BR_PRELIM -#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM +/* Still needed for spl_minimal.c */ +#define CONFIG_SYS_NAND_BR_PRELIM CONFIG_SYS_BR1_PRELIM +#define CONFIG_SYS_NAND_OR_PRELIM CONFIG_SYS_OR1_PRELIM #define CONFIG_SYS_LBLAWBAR1_PRELIMCONFIG_SYS_NAND_BASE #define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_32KB) -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 18/58] mpc8315erdb: Merge BR/OR settings
The mpc8315erdb has the option of either configuring the eLBC (enhanced local system bus) such that * NOR flash is the first memory bank, and NAND flash is the second memory bank, or * NAND flash is the first memory bank, and NOR flash is the second memory bank, by using CONFIG_SYS_NOR_{BR,OR}_PRELIM and CONFIG_SYS_NAND_{BR,OR}_PRELIM for defining CONFIG_SYS_{BR,OR}{0,1}_PRELIM. After Kconfig migration, replacing some lines in the defconfig will have the same effect. Hence, we will not create distinct ve8313_{NOR,NAND} configs for such a small change. Instead, fix the current default (NOR first, NAND second), and unroll the CONFIG_SYS_NAND_{BR,OR}_PRELIM options. This will ease the Kconfig migration. Signed-off-by: Mario Six --- v1 -> v2: No changes --- include/configs/MPC8315ERDB.h | 40 +++- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h index b8506321af3..a2b5b07ea9c 100644 --- a/include/configs/MPC8315ERDB.h +++ b/include/configs/MPC8315ERDB.h @@ -191,20 +191,6 @@ #define CONFIG_SYS_LBLAWBAR0_PRELIMCONFIG_SYS_FLASH_BASE #define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_8MB) -#define CONFIG_SYS_NOR_BR_PRELIM (CONFIG_SYS_FLASH_BASE \ - | BR_PS_16 /* 16 bit port */ \ - | BR_MS_GPCM/* MSEL = GPCM */ \ - | BR_V) /* valid */ -#define CONFIG_SYS_NOR_OR_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \ - | OR_UPM_XAM \ - | OR_GPCM_CSNT \ - | OR_GPCM_ACS_DIV2 \ - | OR_GPCM_XACS \ - | OR_GPCM_SCY_15 \ - | OR_GPCM_TRLX_SET \ - | OR_GPCM_EHTR_SET \ - | OR_GPCM_EAD) - #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */ /* 127 64KB sectors and 8 8KB top sectors per device */ #define CONFIG_SYS_MAX_FLASH_SECT 135 @@ -236,13 +222,26 @@ #define CONFIG_SYS_NAND_U_BOOT_OFFS 16384 #define CONFIG_SYS_NAND_U_BOOT_RELOC 0x0001 -#define CONFIG_SYS_NAND_BR_PRELIM (CONFIG_SYS_NAND_BASE \ +#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE \ + | BR_PS_16 /* 16 bit port */ \ + | BR_MS_GPCM/* MSEL = GPCM */ \ + | BR_V) /* valid */ +#define CONFIG_SYS_OR0_PRELIM (OR_AM_8MB \ + | OR_UPM_XAM \ + | OR_GPCM_CSNT \ + | OR_GPCM_ACS_DIV2 \ + | OR_GPCM_XACS \ + | OR_GPCM_SCY_15 \ + | OR_GPCM_TRLX_SET \ + | OR_GPCM_EHTR_SET \ + | OR_GPCM_EAD) +#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_NAND_BASE \ | BR_DECC_CHK_GEN /* Use HW ECC */ \ | BR_PS_8 /* 8 bit port */ \ | BR_MS_FCM /* MSEL = FCM */ \ | BR_V) /* valid */ -#define CONFIG_SYS_NAND_OR_PRELIM \ - (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \ +#define CONFIG_SYS_OR1_PRELIM \ + (OR_AM_32KB \ | OR_FCM_CSCT \ | OR_FCM_CST \ | OR_FCM_CHT \ @@ -251,10 +250,9 @@ | OR_FCM_EHTR) /* 0x8396 */ -#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NOR_BR_PRELIM -#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NOR_OR_PRELIM -#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NAND_BR_PRELIM -#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM +/* Still needed for spl_minimal.c */ +#define CONFIG_SYS_NAND_BR_PRELIM CONFIG_SYS_BR1_PRELIM +#define CONFIG_SYS_NAND_OR_PRELIM CONFIG_SYS_OR1_PRELIM #define CONFIG_SYS_LBLAWBAR1_PRELIMCONFIG_SYS_NAND_BASE #define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_32KB) -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 17/58] mpc83xx: Make distinct MPC8349EMDS_SDRAM board
The MPC8349EMDS config file contains config options to enable SDRAM support. To keep this ability after the Kconfig migration, create a new MPC8349EMDS_SDRAM board that enables the SDRAM support and remove the SDRAM support from the original board. Signed-off-by: Mario Six --- v1 -> v2: * Combined config creation and simplification patches --- arch/powerpc/cpu/mpc83xx/Kconfig| 8 + board/freescale/mpc8349emds/Kconfig | 13 + configs/MPC8349EMDS_SDRAM_defconfig | 24 ++ include/configs/MPC8349EMDS.h | 76 include/configs/MPC8349EMDS_SDRAM.h | 731 5 files changed, 776 insertions(+), 76 deletions(-) create mode 100644 configs/MPC8349EMDS_SDRAM_defconfig create mode 100644 include/configs/MPC8349EMDS_SDRAM.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 65f4583ffea..0ce1aad6d03 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -67,6 +67,14 @@ config TARGET_MPC8349EMDS select SYS_FSL_DDR_BE select SYS_FSL_HAS_DDR2 +config TARGET_MPC8349EMDS_SDRAM + bool "Support MPC8349EMDS_SDRAM" + select ARCH_MPC8349 + select BOARD_EARLY_INIT_F + select SYS_FSL_DDR + select SYS_FSL_DDR_BE + select SYS_FSL_HAS_DDR2 + config TARGET_MPC8349ITX bool "Support MPC8349ITX" select ARCH_MPC8349 diff --git a/board/freescale/mpc8349emds/Kconfig b/board/freescale/mpc8349emds/Kconfig index 51f0b34f398..d1541180799 100644 --- a/board/freescale/mpc8349emds/Kconfig +++ b/board/freescale/mpc8349emds/Kconfig @@ -10,3 +10,16 @@ config SYS_CONFIG_NAME default "MPC8349EMDS" endif + +if TARGET_MPC8349EMDS_SDRAM + +config SYS_BOARD + default "mpc8349emds" + +config SYS_VENDOR + default "freescale" + +config SYS_CONFIG_NAME + default "MPC8349EMDS_SDRAM" + +endif diff --git a/configs/MPC8349EMDS_SDRAM_defconfig b/configs/MPC8349EMDS_SDRAM_defconfig new file mode 100644 index 000..8ec87408398 --- /dev/null +++ b/configs/MPC8349EMDS_SDRAM_defconfig @@ -0,0 +1,24 @@ +CONFIG_PPC=y +CONFIG_SYS_TEXT_BASE=0xFE00 +CONFIG_MPC83xx=y +CONFIG_TARGET_MPC8349EMDS_SDRAM=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_STDOUT_VIA_ALIAS=y +CONFIG_BOOTDELAY=6 +CONFIG_HUSH_PARSER=y +CONFIG_CMD_IMLS=y +CONFIG_CMD_I2C=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_DATE=y +# CONFIG_MMC is not set +CONFIG_MTD_NOR_FLASH=y +CONFIG_PHY_MARVELL=y +CONFIG_NETDEVICES=y +CONFIG_TSEC_ENET=y +# CONFIG_PCI is not set +CONFIG_SYS_NS16550=y +CONFIG_SPI=y +CONFIG_MPC8XXX_SPI=y +CONFIG_OF_LIBFDT=y diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h index 93de2cc1c07..fe2b81b905b 100644 --- a/include/configs/MPC8349EMDS.h +++ b/include/configs/MPC8349EMDS.h @@ -219,82 +219,6 @@ #define CONFIG_SYS_LBC_LBCR0x /* - * The MPC834xEA MDS for 834xE rev3.1 may not be assembled SDRAM memory. - * if board has SRDAM on local bus, you can define CONFIG_SYS_LB_SDRAM - */ -#undef CONFIG_SYS_LB_SDRAM - -#ifdef CONFIG_SYS_LB_SDRAM -/* Local bus BR2, OR2 definition for SDRAM if soldered on the MDS board */ -/* - * Base Register 2 and Option Register 2 configure SDRAM. - * The SDRAM base address, CONFIG_SYS_LBC_SDRAM_BASE, is 0xf000. - * - * For BR2, need: - *Base address of 0xf000 = BR[0:16] = 0 - *port-size = 32-bits = BR2[19:20] = 11 - *no parity checking = BR2[21:22] = 00 - *SDRAM for MSEL = BR2[24:26] = 011 - *Valid = BR[31] = 1 - * - * 04812 16 20 24 28 - * 0001 1000 0110 0001 = F0001861 - */ - -#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_LBC_SDRAM_BASE \ - | BR_PS_32 /* 32-bit port */ \ - | BR_MS_SDRAM /* MSEL = SDRAM */ \ - | BR_V) /* Valid */ - /* 0xF0001861 */ -#define CONFIG_SYS_LBLAWBAR2_PRELIMCONFIG_SYS_LBC_SDRAM_BASE -#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_64MB) - -/* - * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64. - * - * For OR2, need: - *64MB mask for AM, OR2[0:7] = 1100 - * XAM, OR2[17:18] = 11 - *9 columns OR2[19-21] = 010 - *13 rows OR2[23-25] = 100 - *EAD set for extra time OR[31] = 1 - * - * 04812 16 20 24 28 - * 1100 0110 1001 0001 = FC006901 - */ - -#define CONFIG_SYS_OR2_PRELIM (OR_AM_64MB \ - | OR_SDRAM_XAM \ - | ((9 - OR_SDRAM_MIN_COLS) << OR_SDRAM_COLS_SHIFT) \ - | ((13 - OR_SDRAM_MIN_ROWS) << OR_SDRAM_ROWS_SHIFT) \ - | OR_SDRAM_EAD) - /* 0xFC006901 */ - - /* LB sdram refresh timer, about 6us */ -#define CONFIG_SYS_LBC_LSRT0x3200 -
[U-Boot] [PATCH v2 26/58] MPC837XEMDS: Remove CONFIG_MPC837XEMDS
CONFIG_MPC837XEMDS is unused, and TARGET_MPC837XEMDS could replace it. Hence, get rid of CONFIG_MPC837XEMDS. Signed-off-by: Mario Six --- v1 -> v2: * Removed config option from whitelist --- include/configs/MPC837XEMDS.h | 1 - scripts/config_whitelist.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h index 82dcb859736..577f7ec0b2f 100644 --- a/include/configs/MPC837XEMDS.h +++ b/include/configs/MPC837XEMDS.h @@ -11,7 +11,6 @@ * High Level Configuration Options */ #define CONFIG_E3001 /* E300 family */ -#define CONFIG_MPC837XEMDS 1 /* MPC837XEMDS board specific */ /* * System Clock Setup diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 47eb8982581..238a529e084 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1258,7 +1258,6 @@ CONFIG_MMC_SPI_SPEED CONFIG_MMC_SUNXI_SLOT CONFIG_MMU CONFIG_MONITOR_IS_IN_RAM -CONFIG_MPC837XEMDS CONFIG_MPC837XERDB CONFIG_MPC83XX_GPIO CONFIG_MPC83XX_GPIO_0_INIT_DIRECTION -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 21/58] MPC8349ITX: Migrate to CONFIG_TARGET_MPC8349ITX
Use the proper CONFIG_TARGET_MPC8349ITX Kconfig option to replace the CONFIG_MPC8349ITX ad-hoc config option. Signed-off-by: Mario Six --- v1 -> v2: * Removed config option from whitelist --- board/freescale/mpc8349itx/mpc8349itx.c | 2 +- configs/MPC8349ITX_LOWBOOT_defconfig| 1 - configs/MPC8349ITX_defconfig| 1 - include/configs/MPC8349ITX.h| 4 ++-- scripts/config_whitelist.txt| 1 - 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/board/freescale/mpc8349itx/mpc8349itx.c b/board/freescale/mpc8349itx/mpc8349itx.c index 3bdec1c4005..d90553384f6 100644 --- a/board/freescale/mpc8349itx/mpc8349itx.c +++ b/board/freescale/mpc8349itx/mpc8349itx.c @@ -152,7 +152,7 @@ int dram_init(void) int checkboard(void) { -#ifdef CONFIG_MPC8349ITX +#ifdef CONFIG_TARGET_MPC8349ITX puts("Board: Freescale MPC8349E-mITX\n"); #else puts("Board: Freescale MPC8349E-mITX-GP\n"); diff --git a/configs/MPC8349ITX_LOWBOOT_defconfig b/configs/MPC8349ITX_LOWBOOT_defconfig index 51667235487..5e3ad6e 100644 --- a/configs/MPC8349ITX_LOWBOOT_defconfig +++ b/configs/MPC8349ITX_LOWBOOT_defconfig @@ -4,7 +4,6 @@ CONFIG_MPC83xx=y CONFIG_TARGET_MPC8349ITX=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y -CONFIG_SYS_EXTRA_OPTIONS="MPC8349ITX" CONFIG_BOOTDELAY=6 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs ip=mpc8349emitx:eth0:off console=ttyS0,115200" diff --git a/configs/MPC8349ITX_defconfig b/configs/MPC8349ITX_defconfig index 55e593c1150..7f9b9cb283d 100644 --- a/configs/MPC8349ITX_defconfig +++ b/configs/MPC8349ITX_defconfig @@ -4,7 +4,6 @@ CONFIG_MPC83xx=y CONFIG_TARGET_MPC8349ITX=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y -CONFIG_SYS_EXTRA_OPTIONS="MPC8349ITX" CONFIG_BOOTDELAY=6 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs ip=mpc8349emitx:eth0:off console=ttyS0,115200" diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h index 496780d80c0..5877279adaf 100644 --- a/include/configs/MPC8349ITX.h +++ b/include/configs/MPC8349ITX.h @@ -54,7 +54,7 @@ * On-board devices */ -#ifdef CONFIG_MPC8349ITX +#ifdef CONFIG_TARGET_MPC8349ITX /* The CF card interface on the back of the board */ #define CONFIG_COMPACT_FLASH #define CONFIG_VSC7385_ENET/* VSC7385 ethernet support */ @@ -642,7 +642,7 @@ boards, we say we have two, but don't display a message if we find only one. */ /* U-Boot image on TFTP server */ #define CONFIG_UBOOTPATH "u-boot.bin" -#ifdef CONFIG_MPC8349ITX +#ifdef CONFIG_TARGET_MPC8349ITX #define CONFIG_FDTFILE "mpc8349emitx.dtb" #else #define CONFIG_FDTFILE "mpc8349emitxgp.dtb" diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 5da8146c893..9b79ad960c1 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1261,7 +1261,6 @@ CONFIG_MMU CONFIG_MONITOR_IS_IN_RAM CONFIG_MPC8313ERDB CONFIG_MPC8315ERDB -CONFIG_MPC8349ITX CONFIG_MPC837XEMDS CONFIG_MPC837XERDB CONFIG_MPC83XX_GPIO -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 23/58] strider: Migrate to CONFIG_TARGET_STRIDER
Use the proper CONFIG_TARGET_STRIDER Kconfig option to replace the CONFIG_STRIDER ad-hoc config option. Signed-off-by: Mario Six --- v1 -> v2: * Removed config option from whitelist --- board/gdsys/common/Makefile | 4 ++-- board/gdsys/mpc8308/Makefile | 2 +- include/configs/strider.h| 1 - scripts/config_whitelist.txt | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile index 67d2b310b30..9090933e345 100644 --- a/board/gdsys/common/Makefile +++ b/board/gdsys/common/Makefile @@ -11,8 +11,8 @@ obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o ch7301.o obj-$(CONFIG_DLVISION_10G) += osd.o dp501.o obj-$(CONFIG_CONTROLCENTERD) += dp501.o obj-$(CONFIG_TARGET_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o fanctrl.o -obj-$(CONFIG_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o ch7301.o -obj-$(CONFIG_STRIDER) += fanctrl.o +obj-$(CONFIG_TARGET_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o ch7301.o +obj-$(CONFIG_TARGET_STRIDER) += fanctrl.o obj-$(CONFIG_STRIDER_CON) += osd.o obj-$(CONFIG_STRIDER_CON_DP) += osd.o diff --git a/board/gdsys/mpc8308/Makefile b/board/gdsys/mpc8308/Makefile index f29376fc9ed..dc579479f95 100644 --- a/board/gdsys/mpc8308/Makefile +++ b/board/gdsys/mpc8308/Makefile @@ -5,4 +5,4 @@ obj-y := mpc8308.o sdram.o obj-$(CONFIG_TARGET_HRCON) += hrcon.o -obj-$(CONFIG_STRIDER) += strider.o +obj-$(CONFIG_TARGET_STRIDER) += strider.o diff --git a/include/configs/strider.h b/include/configs/strider.h index 89e0610871e..c42fe8c3ece 100644 --- a/include/configs/strider.h +++ b/include/configs/strider.h @@ -13,7 +13,6 @@ */ #define CONFIG_E3001 /* E300 family */ #define CONFIG_MPC83xx 1 /* MPC83xx family */ -#define CONFIG_STRIDER 1 /* STRIDER board specific */ #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 68d4b956d7d..087d9c59235 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1952,7 +1952,6 @@ CONFIG_STANDALONE_LOAD_ADDR CONFIG_STATIC_BOARD_REV CONFIG_STD_DEVICES_SETTINGS CONFIG_STM32_FLASH -CONFIG_STRIDER CONFIG_STRIDER_CON CONFIG_STRIDER_CON_DP CONFIG_STRIDER_CPU -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 28/58] mpc83xx: Migrate legacy PCI options to Kconfig
The MPC83xx include files contain some settings of the PCI subsystem. Migrate these to Kconfig until a proper DM PCI driver exists. Signed-off-by: Mario Six --- v1 -> v2: No changes --- arch/powerpc/cpu/mpc83xx/Kconfig| 26 ++ board/freescale/mpc8349emds/pci.c | 12 ++-- configs/MPC8349EMDS_SDRAM_defconfig | 1 + configs/MPC8349EMDS_defconfig | 1 + configs/sbc8349_PCI_33_defconfig| 1 + configs/sbc8349_PCI_66_defconfig| 1 + configs/vme8349_defconfig | 1 + include/configs/MPC8349EMDS.h | 11 ++- include/configs/MPC8349EMDS_SDRAM.h | 11 ++- include/configs/TQM834x.h | 2 +- include/configs/caddy2.h| 8 include/configs/sbc8349.h | 10 +- include/configs/vme8349.h | 10 +- 13 files changed, 44 insertions(+), 51 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 0ce1aad6d03..bd4e5c14a9a 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -215,6 +215,32 @@ config ARCH_MPC8360 config ARCH_MPC837X bool +menu "Legacy options" + +if ARCH_MPC8349 + +#TODO(mario@gdsys.cc): Remove when mpc83xx PCI has been converted to DM/DT +choice + prompt "PMC slot configuration" + +config PCI_ALL_PCI1 + bool "All PMC slots on PCI1" + +config PCI_ONE_PCI1 + bool "First PMC1 on PCI1" + +config PCI_TWO_PCI1 + bool "First two PMC1 on PCI1" + +endchoice + +config PCI_64BIT + bool "PMC2 is 64bit" + +endif + +endmenu + source "board/esd/vme8349/Kconfig" source "board/freescale/mpc8308rdb/Kconfig" source "board/freescale/mpc8313erdb/Kconfig" diff --git a/board/freescale/mpc8349emds/pci.c b/board/freescale/mpc8349emds/pci.c index a2feda855f6..005190ed87d 100644 --- a/board/freescale/mpc8349emds/pci.c +++ b/board/freescale/mpc8349emds/pci.c @@ -77,11 +77,11 @@ void pib_init(void) i2c_write(0x26, 0x6, 1, &val8, 1); val8 = 0x34; i2c_write(0x26, 0x7, 1, &val8, 1); -#if defined(PCI_64BIT) +#if defined(CONFIG_PCI_64BIT) val8 = 0xf4;/* PMC2:PCI1/64-bit */ -#elif defined(PCI_ALL_PCI1) +#elif defined(CONFIG_PCI_ALL_PCI1) val8 = 0xf3;/* PMC1:PCI1 PMC2:PCI1 PMC3:PCI1 */ -#elif defined(PCI_ONE_PCI1) +#elif defined(CONFIG_PCI_ONE_PCI1) val8 = 0xf9;/* PMC1:PCI1 PMC2:PCI2 PMC3:PCI2 */ #else val8 = 0xf5;/* PMC1:PCI1 PMC2:PCI1 PMC3:PCI2 */ @@ -98,11 +98,11 @@ void pib_init(void) i2c_write(0x27, 0x3, 1, &val8, 1); asm("eieio"); -#if defined(PCI_64BIT) +#if defined(CONFIG_PCI_64BIT) printf("PCI1: 64-bit on PMC2\n"); -#elif defined(PCI_ALL_PCI1) +#elif defined(CONFIG_PCI_ALL_PCI1) printf("PCI1: 32-bit on PMC1, PMC2, PMC3\n"); -#elif defined(PCI_ONE_PCI1) +#elif defined(CONFIG_PCI_ONE_PCI1) printf("PCI1: 32-bit on PMC1\n"); printf("PCI2: 32-bit on PMC2, PMC3\n"); #else diff --git a/configs/MPC8349EMDS_SDRAM_defconfig b/configs/MPC8349EMDS_SDRAM_defconfig index 8ec87408398..4da9774f070 100644 --- a/configs/MPC8349EMDS_SDRAM_defconfig +++ b/configs/MPC8349EMDS_SDRAM_defconfig @@ -2,6 +2,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xFE00 CONFIG_MPC83xx=y CONFIG_TARGET_MPC8349EMDS_SDRAM=y +CONFIG_PCI_ONE_PCI1=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_BOOTDELAY=6 diff --git a/configs/MPC8349EMDS_defconfig b/configs/MPC8349EMDS_defconfig index 41a1d9609b5..bd8ff625e19 100644 --- a/configs/MPC8349EMDS_defconfig +++ b/configs/MPC8349EMDS_defconfig @@ -2,6 +2,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xFE00 CONFIG_MPC83xx=y CONFIG_TARGET_MPC8349EMDS=y +CONFIG_PCI_ONE_PCI1=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_BOOTDELAY=6 diff --git a/configs/sbc8349_PCI_33_defconfig b/configs/sbc8349_PCI_33_defconfig index 02d5185124c..5c2720aef14 100644 --- a/configs/sbc8349_PCI_33_defconfig +++ b/configs/sbc8349_PCI_33_defconfig @@ -2,6 +2,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xFF80 CONFIG_MPC83xx=y CONFIG_TARGET_SBC8349=y +CONFIG_PCI_64BIT=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_SYS_EXTRA_OPTIONS="PCI_33M" diff --git a/configs/sbc8349_PCI_66_defconfig b/configs/sbc8349_PCI_66_defconfig index 945c5229b93..e6535dafcf7 100644 --- a/configs/sbc8349_PCI_66_defconfig +++ b/configs/sbc8349_PCI_66_defconfig @@ -2,6 +2,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xFF80 CONFIG_MPC83xx=y CONFIG_TARGET_SBC8349=y +CONFIG_PCI_64BIT=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_SYS_EXTRA_OPTIONS="PCI_66M" diff --git a/configs/vme8349_defconfig b/configs/vme8349_defconfig index a7d81a3a0f1..90c29b7fedf 100644 --- a/configs/vme8349_defconfig +++ b/configs/vme8349_defconfig @@ -2,6 +2,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xFFF0 CONFIG_MPC83xx=y CONFIG_TARGET_VME8349=y +CONFIG_PCI_64BIT=y CONFIG_OF_BOARD_SETUP=y CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_BOOTDELAY=6 d
[U-Boot] [PATCH v2 25/58] MPC8315ERDB: Remove CONFIG_MPC8315ERDB
CONFIG_MPC8315ERDB is unused, and TARGET_MPC8315ERDB could replace it. Hence, get rid of CONFIG_MPC8315ERDB. Signed-off-by: Mario Six --- v1 -> v2: * Removed config option from whitelist --- include/configs/MPC8315ERDB.h | 1 - scripts/config_whitelist.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h index a2b5b07ea9c..c373a0ab4c1 100644 --- a/include/configs/MPC8315ERDB.h +++ b/include/configs/MPC8315ERDB.h @@ -22,7 +22,6 @@ * High Level Configuration Options */ #define CONFIG_E3001 /* E300 family */ -#define CONFIG_MPC8315ERDB 1 /* MPC8315ERDB board specific */ /* * System Clock Setup diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index c997dfbba6e..47eb8982581 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1258,7 +1258,6 @@ CONFIG_MMC_SPI_SPEED CONFIG_MMC_SUNXI_SLOT CONFIG_MMU CONFIG_MONITOR_IS_IN_RAM -CONFIG_MPC8315ERDB CONFIG_MPC837XEMDS CONFIG_MPC837XERDB CONFIG_MPC83XX_GPIO -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 22/58] hrcon: Migrate to CONFIG_TARGET_HRCON
Use the proper CONFIG_TARGET_HRCON Kconfig option to replace the CONFIG_HRCON ad-hoc config option. Signed-off-by: Mario Six --- v1 -> v2: * Combined config creation and simplification patches * Removed config option from whitelist --- board/gdsys/common/Makefile | 2 +- board/gdsys/mpc8308/Makefile | 2 +- include/configs/hrcon.h | 1 - include/gdsys_fpga.h | 2 +- scripts/config_whitelist.txt | 1 - 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile index af9058a5d77..67d2b310b30 100644 --- a/board/gdsys/common/Makefile +++ b/board/gdsys/common/Makefile @@ -10,7 +10,7 @@ obj-$(CONFIG_IO64) += miiphybb.o obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o ch7301.o obj-$(CONFIG_DLVISION_10G) += osd.o dp501.o obj-$(CONFIG_CONTROLCENTERD) += dp501.o -obj-$(CONFIG_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o fanctrl.o +obj-$(CONFIG_TARGET_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o fanctrl.o obj-$(CONFIG_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o ch7301.o obj-$(CONFIG_STRIDER) += fanctrl.o obj-$(CONFIG_STRIDER_CON) += osd.o diff --git a/board/gdsys/mpc8308/Makefile b/board/gdsys/mpc8308/Makefile index 60d22325738..f29376fc9ed 100644 --- a/board/gdsys/mpc8308/Makefile +++ b/board/gdsys/mpc8308/Makefile @@ -4,5 +4,5 @@ # Dirk Eibach, Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc obj-y := mpc8308.o sdram.o -obj-$(CONFIG_HRCON) += hrcon.o +obj-$(CONFIG_TARGET_HRCON) += hrcon.o obj-$(CONFIG_STRIDER) += strider.o diff --git a/include/configs/hrcon.h b/include/configs/hrcon.h index 23ed4e54c72..cd5e883b7a1 100644 --- a/include/configs/hrcon.h +++ b/include/configs/hrcon.h @@ -13,7 +13,6 @@ */ #define CONFIG_E3001 /* E300 family */ #define CONFIG_MPC83xx 1 /* MPC83xx family */ -#define CONFIG_HRCON 1 /* HRCON board specific */ #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR diff --git a/include/gdsys_fpga.h b/include/gdsys_fpga.h index db4424d3f8a..e9fb4b88b5e 100644 --- a/include/gdsys_fpga.h +++ b/include/gdsys_fpga.h @@ -161,7 +161,7 @@ struct ihs_fpga { }; #endif -#if defined(CONFIG_HRCON) || defined(CONFIG_STRIDER_CON_DP) +#if defined(CONFIG_TARGET_HRCON) || defined(CONFIG_STRIDER_CON_DP) struct ihs_fpga { u16 reflection_low; /* 0x */ u16 versions; /* 0x0002 */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 9b79ad960c1..68d4b956d7d 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -917,7 +917,6 @@ CONFIG_HPS_SDR_CTRLCFG_RFIFOCMAP_RFIFOCMAP CONFIG_HPS_SDR_CTRLCFG_STATICCFG_MEMBL CONFIG_HPS_SDR_CTRLCFG_STATICCFG_USEECCASDATA CONFIG_HPS_SDR_CTRLCFG_WFIFOCMAP_WFIFOCMAP -CONFIG_HRCON CONFIG_HRCON_DH CONFIG_HRCON_FANS CONFIG_HSMMC2_8BIT -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 24/58] MPC8313ERDB: Remove CONFIG_MPC8313ERDB
CONFIG_MPC8313ERDB is unused, and TARGET_MPC8313ERDB_NAND/TARGET_MPC8313ERDB_NOR Kconfig could replace it. Hence, get rid of CONFIG_MPC8313ERDB. Signed-off-by: Mario Six --- v1 -> v2: * Removed config option from whitelist --- include/configs/MPC8313ERDB_NAND.h | 1 - include/configs/MPC8313ERDB_NOR.h | 1 - scripts/config_whitelist.txt | 1 - 3 files changed, 3 deletions(-) diff --git a/include/configs/MPC8313ERDB_NAND.h b/include/configs/MPC8313ERDB_NAND.h index 976b6854e49..31c29001807 100644 --- a/include/configs/MPC8313ERDB_NAND.h +++ b/include/configs/MPC8313ERDB_NAND.h @@ -13,7 +13,6 @@ * High Level Configuration Options */ #define CONFIG_E3001 -#define CONFIG_MPC8313ERDB 1 #define CONFIG_SPL_INIT_MINIMAL #define CONFIG_SPL_FLUSH_IMAGE diff --git a/include/configs/MPC8313ERDB_NOR.h b/include/configs/MPC8313ERDB_NOR.h index 8d8482d00f5..03420a181c5 100644 --- a/include/configs/MPC8313ERDB_NOR.h +++ b/include/configs/MPC8313ERDB_NOR.h @@ -13,7 +13,6 @@ * High Level Configuration Options */ #define CONFIG_E3001 -#define CONFIG_MPC8313ERDB 1 #ifndef CONFIG_SYS_MONITOR_BASE #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE/* start of monitor */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 087d9c59235..c997dfbba6e 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1258,7 +1258,6 @@ CONFIG_MMC_SPI_SPEED CONFIG_MMC_SUNXI_SLOT CONFIG_MMU CONFIG_MONITOR_IS_IN_RAM -CONFIG_MPC8313ERDB CONFIG_MPC8315ERDB CONFIG_MPC837XEMDS CONFIG_MPC837XERDB -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 27/58] MPC837XERDB: Remove CONFIG_MPC837XERDB
CONFIG_MPC837XERDB is unused, and TARGET_MPC837XERDB could replace it. Hence, get rid of CONFIG_MPC837XERDB. Signed-off-by: Mario Six --- v1 -> v2: * Removed config option from whitelist --- include/configs/MPC837XERDB.h | 1 - scripts/config_whitelist.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h index 6029d0f21bf..a8f5b013b28 100644 --- a/include/configs/MPC837XERDB.h +++ b/include/configs/MPC837XERDB.h @@ -12,7 +12,6 @@ * High Level Configuration Options */ #define CONFIG_E3001 /* E300 family */ -#define CONFIG_MPC837XERDB 1 #define CONFIG_HWCONFIG diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 238a529e084..b339f6028fd 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1258,7 +1258,6 @@ CONFIG_MMC_SPI_SPEED CONFIG_MMC_SUNXI_SLOT CONFIG_MMU CONFIG_MONITOR_IS_IN_RAM -CONFIG_MPC837XERDB CONFIG_MPC83XX_GPIO CONFIG_MPC83XX_GPIO_0_INIT_DIRECTION CONFIG_MPC83XX_GPIO_0_INIT_OPEN_DRAIN -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 29/58] mpc83xx: Replace CONFIG_83XX_CLKIN in calculations
CONFIG_SYS_CLK_FREQ is the standard way to set the system clock frequency. On MPC83xx, CONFIG_83XX_CLKIN is used for this purpose. Hence, the obvious way is to replace CONFIG_83XX_CLKIN with CONFIG_SYS_CLK_FREQ. A few MPC83xx boards use the CONFIG_83XX_CLKIN variable for computing CONFIG_SYS_NS16550_CLK. This makes it harder to replace CONFIG_83XX_CLKIN. But the value of the multiplicator can be read from the SPMR register. Hence, replace the static calculations with a call to a new get_bus_freq function, as other architectures do. Signed-off-by: Mario Six --- v1 -> v2: No changes --- arch/powerpc/cpu/mpc83xx/spl_minimal.c | 8 include/configs/MPC8315ERDB.h | 2 +- include/configs/ids8313.h | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/spl_minimal.c b/arch/powerpc/cpu/mpc83xx/spl_minimal.c index 746f1febba0..3315ee05e11 100644 --- a/arch/powerpc/cpu/mpc83xx/spl_minimal.c +++ b/arch/powerpc/cpu/mpc83xx/spl_minimal.c @@ -89,3 +89,11 @@ void puts(const char *str) while (*str) putc(*str++); } + +ulong get_bus_freq(ulong dummy) +{ + volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; + u8 spmf = (im->clk.spmr & SPMR_SPMF) >> SPMR_SPMF_SHIFT; + + return CONFIG_83XX_CLKIN * spmf; +} diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h index c373a0ab4c1..adb2bb6c2d8 100644 --- a/include/configs/MPC8315ERDB.h +++ b/include/configs/MPC8315ERDB.h @@ -271,7 +271,7 @@ */ #define CONFIG_SYS_NS16550_SERIAL #define CONFIG_SYS_NS16550_REG_SIZE1 -#define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 2) +#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0)) #define CONFIG_SYS_BAUDRATE_TABLE \ {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200} diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h index f1d8990a886..e6c0b89fa3e 100644 --- a/include/configs/ids8313.h +++ b/include/configs/ids8313.h @@ -311,7 +311,7 @@ {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200} #define CONFIG_SYS_NS16550_COM1(CONFIG_SYS_IMMR + 0x4500) #define CONFIG_SYS_NS16550_COM2(CONFIG_SYS_IMMR + 0x4600) -#define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 2) +#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0)) #define CONFIG_HAS_FSL_DR_USB #define CONFIG_SYS_SCCR_USBDRCM3 -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 30/58] mpc83xx: Get rid of CONFIG_83XX_CLKIN
MPC83xx uses CONFIG_83XX_CLKIN instead of CONFIG_SYS_CLK_FREQ to set the system clock. To migrate the architecture, we can replace CONFIG_83XX_CLKIN with CONFIG_SYS_CLK_FREQ. To do this * replace all occurrences of CONFIG_83XX_CLKIN with CONFIG_SYS_CLK_FREQ * set CONFIG_SYS_CLK_FREQ to the old value of CONFIG_83XX_CLKIN in all MPC83xx config files Signed-off-by: Mario Six --- v1 -> v2: No changes --- Kconfig | 2 +- arch/powerpc/cpu/mpc83xx/speed.c| 4 ++-- arch/powerpc/cpu/mpc83xx/spl_minimal.c | 2 +- board/freescale/mpc8349emds/MAINTAINERS | 1 + board/freescale/mpc837xerdb/MAINTAINERS | 1 + board/tqc/tqm834x/pci.c | 2 +- configs/MPC8308RDB_defconfig| 1 + configs/MPC8313ERDB_33_defconfig| 1 + configs/MPC8313ERDB_66_defconfig| 1 + configs/MPC8313ERDB_NAND_33_defconfig | 1 + configs/MPC8313ERDB_NAND_66_defconfig | 1 + configs/MPC8315ERDB_defconfig | 1 + configs/MPC8323ERDB_defconfig | 1 + configs/MPC832XEMDS_ATM_defconfig | 1 + configs/MPC832XEMDS_HOST_33_defconfig | 1 + configs/MPC832XEMDS_HOST_66_defconfig | 1 + configs/MPC832XEMDS_SLAVE_defconfig | 1 + configs/MPC832XEMDS_defconfig | 1 + configs/MPC8349EMDS_SDRAM_defconfig | 1 + configs/MPC8349EMDS_SLAVE_defconfig | 22 ++ configs/MPC8349EMDS_defconfig | 1 + configs/MPC8349ITXGP_defconfig | 2 ++ configs/MPC8349ITX_LOWBOOT_defconfig| 1 + configs/MPC8349ITX_defconfig| 1 + configs/MPC837XEMDS_HOST_defconfig | 1 + configs/MPC837XEMDS_defconfig | 1 + configs/MPC837XERDB_SLAVE_defconfig | 31 +++ configs/MPC837XERDB_defconfig | 2 ++ configs/TQM834x_defconfig | 1 + configs/caddy2_defconfig| 1 + configs/hrcon_defconfig | 1 + configs/hrcon_dh_defconfig | 1 + configs/ids8313_defconfig | 1 + configs/kmcoge5ne_defconfig | 1 + configs/kmeter1_defconfig | 1 + configs/kmopti2_defconfig | 1 + configs/kmsupx5_defconfig | 1 + configs/kmtegr1_defconfig | 1 + configs/kmtepr2_defconfig | 1 + configs/kmvect1_defconfig | 1 + configs/mpc8308_p1m_defconfig | 1 + configs/sbc8349_PCI_33_defconfig| 1 + configs/sbc8349_PCI_66_defconfig| 1 + configs/sbc8349_defconfig | 1 + configs/strider_con_defconfig | 1 + configs/strider_con_dp_defconfig| 1 + configs/strider_cpu_defconfig | 1 + configs/strider_cpu_dp_defconfig| 1 + configs/suvd3_defconfig | 1 + configs/tuge1_defconfig | 1 + configs/tuxx1_defconfig | 1 + configs/ve8313_defconfig| 1 + configs/vme8349_defconfig | 1 + include/configs/MPC8308RDB.h| 6 -- include/configs/MPC8313ERDB_NAND.h | 17 + include/configs/MPC8313ERDB_NOR.h | 15 +-- include/configs/MPC8315ERDB.h | 6 -- include/configs/MPC8323ERDB.h | 9 - include/configs/MPC832XEMDS.h | 13 - include/configs/MPC8349EMDS.h | 19 ++- include/configs/MPC8349EMDS_SDRAM.h | 19 ++- include/configs/MPC8349ITX.h| 7 --- include/configs/MPC837XEMDS.h | 13 - include/configs/MPC837XERDB.h | 14 -- include/configs/TQM834x.h | 3 --- include/configs/caddy2.h| 11 --- include/configs/hrcon.h | 6 -- include/configs/ids8313.h | 3 --- include/configs/kmeter1.h | 7 --- include/configs/mpc8308_p1m.h | 6 -- include/configs/sbc8349.h | 16 include/configs/strider.h | 6 -- include/configs/ve8313.h| 4 include/configs/vme8349.h | 9 - 74 files changed, 113 insertions(+), 208 deletions(-) create mode 100644 configs/MPC8349EMDS_SLAVE_defconfig create mode 100644 configs/MPC837XERDB_SLAVE_defconfig diff --git a/Kconfig b/Kconfig index f500188d589..cd1f2ce7066 100644 --- a/Kconfig +++ b/Kconfig @@ -463,7 +463,7 @@ config SYS_TEXT_BASE config SYS_CLK_FREQ - depends on ARC || ARCH_SUNXI + depends on ARC || ARCH_SUNXI || MPC83xx int "CPU clock frequency" help TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c index 668ed27862b..e870a23103b 100644 --- a/arch/powerpc/cpu/mpc83xx/speed.c +++ b/arch/powerpc/cpu/mpc83xx/speed.c @@ -137,8 +137,8 @@ int get_clocks(void) clkin_div = (
[U-Boot] [PATCH v2 32/58] mpc83xx: pcie: Read the clock from registers
The MPC83xx DM timer driver disables arch.pciexp*_clk, and uses clk_get_rate instead. But the legacy MPC83xx PCIe driver still uses arch.pciexp*_clk for the clock. Hence, read the PCIe clock from the registers in the legacy MPC83xx PCIe driver. Signed-off-by: Mario Six --- v1 -> v2: No changes --- arch/powerpc/cpu/mpc83xx/pcie.c | 39 --- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/pcie.c b/arch/powerpc/cpu/mpc83xx/pcie.c index c250150224d..2608447d80d 100644 --- a/arch/powerpc/cpu/mpc83xx/pcie.c +++ b/arch/powerpc/cpu/mpc83xx/pcie.c @@ -176,6 +176,41 @@ static void mpc83xx_pcie_register_hose(int bus, struct pci_region *reg, #endif /* CONFIG_83XX_GENERIC_PCIE_REGISTER_HOSES */ +int get_pcie_clk(int index) +{ + volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; + u32 pci_sync_in; + u8 spmf; + u8 clkin_div; + u32 sccr; + u32 csb_clk; + u32 testval; + + clkin_div = ((im->clk.spmr & SPMR_CKID) >> SPMR_CKID_SHIFT); + sccr = im->clk.sccr; + pci_sync_in = CONFIG_SYS_CLK_FREQ / (1 + clkin_div); + spmf = (im->clk.spmr & SPMR_SPMF) >> SPMR_SPMF_SHIFT; + csb_clk = pci_sync_in * (1 + clkin_div) * spmf; + + if (index) + testval = (sccr & SCCR_PCIEXP2CM) >> SCCR_PCIEXP2CM_SHIFT; + else + testval = (sccr & SCCR_PCIEXP1CM) >> SCCR_PCIEXP1CM_SHIFT; + + switch (testval) { + case 0: + return 0; + case 1: + return csb_clk; + case 2: + return csb_clk / 2; + case 3: + return csb_clk / 3; + } + + return 0; +} + static void mpc83xx_pcie_init_bus(int bus, struct pci_region *reg) { immap_t *immr = (immap_t *)CONFIG_SYS_IMMR; @@ -271,11 +306,9 @@ static void mpc83xx_pcie_init_bus(int bus, struct pci_region *reg) /* Hose configure header is memory-mapped */ hose_cfg_base = (void *)pex; - get_clocks(); /* Configure the PCIE controller core clock ratio */ out_le32(hose_cfg_base + PEX_GCLK_RATIO, - (((bus ? gd->arch.pciexp2_clk : gd->arch.pciexp1_clk) - / 100) * 16) / 333); + ((get_pcie_clk(bus) / 100) * 16) / 333); udelay(100); /* Do Type 1 bridge configuration */ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 33/58] powerpc: Migrate HIGH_BATS to Kconfig
Migrate the CONFIG_HIGH_BATS variable to Kconfig. Signed-off-by: Mario Six --- v1 -> v2: * Removed config option from whitelist --- arch/powerpc/Kconfig | 6 ++ configs/MPC8313ERDB_33_defconfig | 1 + configs/MPC8313ERDB_66_defconfig | 1 + configs/MPC8313ERDB_NAND_33_defconfig | 1 + configs/MPC8313ERDB_NAND_66_defconfig | 1 + configs/MPC8315ERDB_defconfig | 1 + configs/MPC8323ERDB_defconfig | 1 + configs/MPC832XEMDS_ATM_defconfig | 1 + configs/MPC832XEMDS_HOST_33_defconfig | 1 + configs/MPC832XEMDS_HOST_66_defconfig | 1 + configs/MPC832XEMDS_SLAVE_defconfig | 1 + configs/MPC832XEMDS_defconfig | 1 + configs/MPC8349EMDS_PCI64_defconfig | 1 + configs/MPC8349EMDS_SDRAM_defconfig | 1 + configs/MPC8349EMDS_SLAVE_defconfig | 1 + configs/MPC8349EMDS_defconfig | 1 + configs/MPC8349ITXGP_defconfig| 1 + configs/MPC8349ITX_LOWBOOT_defconfig | 1 + configs/MPC8349ITX_defconfig | 1 + configs/MPC837XEMDS_HOST_defconfig| 1 + configs/MPC837XEMDS_defconfig | 1 + configs/MPC837XERDB_defconfig | 1 + configs/MPC8610HPCD_defconfig | 1 + configs/MPC8641HPCN_36BIT_defconfig | 1 + configs/MPC8641HPCN_defconfig | 1 + configs/TQM834x_defconfig | 1 + configs/caddy2_defconfig | 1 + configs/ids8313_defconfig | 1 + configs/kmcoge5ne_defconfig | 1 + configs/kmopti2_defconfig | 1 + configs/kmsupx5_defconfig | 1 + configs/kmtegr1_defconfig | 1 + configs/kmtepr2_defconfig | 1 + configs/kmvect1_defconfig | 1 + configs/sbc8349_PCI_33_defconfig | 1 + configs/sbc8349_PCI_66_defconfig | 1 + configs/sbc8349_defconfig | 1 + configs/sbc8641d_defconfig| 1 + configs/suvd3_defconfig | 1 + configs/tuge1_defconfig | 1 + configs/tuxx1_defconfig | 1 + configs/ve8313_defconfig | 1 + configs/vme8349_defconfig | 1 + configs/xpedite517x_defconfig | 1 + include/configs/MPC8313ERDB_NAND.h| 2 -- include/configs/MPC8313ERDB_NOR.h | 2 -- include/configs/MPC8315ERDB.h | 1 - include/configs/MPC8323ERDB.h | 1 - include/configs/MPC832XEMDS.h | 2 -- include/configs/MPC8349EMDS.h | 1 - include/configs/MPC8349EMDS_SDRAM.h | 1 - include/configs/MPC8349ITX.h | 1 - include/configs/MPC837XEMDS.h | 1 - include/configs/MPC837XERDB.h | 2 -- include/configs/MPC8610HPCD.h | 1 - include/configs/MPC8641HPCN.h | 1 - include/configs/TQM834x.h | 2 -- include/configs/caddy2.h | 2 -- include/configs/ids8313.h | 1 - include/configs/kmcoge5ne.h | 2 -- include/configs/kmeter1.h | 2 -- include/configs/kmopti2.h | 2 -- include/configs/kmsupx5.h | 2 -- include/configs/kmtegr1.h | 2 -- include/configs/kmtepr2.h | 2 -- include/configs/kmvect1.h | 2 -- include/configs/sbc8349.h | 2 -- include/configs/sbc8641d.h| 1 - include/configs/suvd3.h | 2 -- include/configs/tuge1.h | 2 -- include/configs/tuxx1.h | 2 -- include/configs/ve8313.h | 2 -- include/configs/vme8349.h | 2 -- include/configs/xpedite517x.h | 1 - scripts/config_whitelist.txt | 1 - 75 files changed, 49 insertions(+), 50 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index c727d9162c4..ab9eefef153 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -39,6 +39,12 @@ config MPC8xx endchoice +config HIGH_BATS + bool "Enable high BAT registers" + help + Enable BATs (block address translation registers) 4-7 on machines + that support them. + source "arch/powerpc/cpu/mpc83xx/Kconfig" source "arch/powerpc/cpu/mpc85xx/Kconfig" source "arch/powerpc/cpu/mpc86xx/Kconfig" diff --git a/configs/MPC8313ERDB_33_defconfig b/configs/MPC8313ERDB_33_defconfig index c99d7399966..641c6c8545b 100644 --- a/configs/MPC8313ERDB_33_defconfig +++ b/configs/MPC8313ERDB_33_defconfig @@ -2,6 +2,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xFE00 CONFIG_SYS_CLK_FREQ= CONFIG_MPC83xx=y +CONFIG_HIGH_BATS=y CONFIG_TARGET_MPC8313ERDB_NOR=y CONFIG_SYSTEM_PLL_FACTOR_5_1=y CONFIG_CORE_PLL_RATIO_2_1=y diff --git a/configs/MPC8313ERDB_66_defconfig b/configs/MPC8313ERDB_66_defconfig index c1eb49af7bc..b1a4bcbc538 100644 --- a/configs/MPC8313ERDB_66_defconfig +++ b/configs/MPC8313ERDB_66_defconfig @@ -2,6 +2,7 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0xFE00 CONFIG_SYS_CLK_FREQ=6667 CONFIG_MPC83xx=y +CONFIG_HIGH_BATS=y CONFIG_TARGET_MPC8313ERDB_NOR=y CONFIG_CORE_PLL_RATIO_2_1=y CONFIG_PCI_HOST_MODE_ENABLE=y diff --git a/configs/MPC8313ERDB_NAND_33_defconfig b/configs/M
[U-Boot] [PATCH v2 31/58] mpc83xx: Kconfig: Migrate HRCW to Kconfig
The HRCW (hardware reset configuration word) is a constant that must be hard-coded into the boot loader image. So, it must be available at compile time, and cannot be migrated to the DT mechanism, but has to be kept in Kconfig. Configuration of this crucial variable should still be somewhat comfortable. Hence, make its fields configurable in Kconfig, and assemble the final value from these. Signed-off-by: Mario Six --- v1 -> v2: No changes --- arch/powerpc/cpu/mpc83xx/Kconfig| 69 +++ arch/powerpc/cpu/mpc83xx/hrcw/Kconfig | 816 arch/powerpc/cpu/mpc83xx/hrcw/hrcw.h| 37 ++ arch/powerpc/cpu/mpc83xx/start.S| 2 + board/freescale/mpc8315erdb/MAINTAINERS | 1 + board/freescale/mpc8349emds/MAINTAINERS | 1 + board/freescale/mpc8349itx/mpc8349itx.c | 2 + board/freescale/mpc837xemds/MAINTAINERS | 1 + configs/MPC8308RDB_defconfig| 7 + configs/MPC8313ERDB_33_defconfig| 8 + configs/MPC8313ERDB_66_defconfig| 7 + configs/MPC8313ERDB_NAND_33_defconfig | 7 + configs/MPC8313ERDB_NAND_66_defconfig | 6 + configs/MPC8315ERDB_defconfig | 8 + configs/MPC8323ERDB_defconfig | 6 + configs/MPC832XEMDS_ATM_defconfig | 6 + configs/MPC832XEMDS_HOST_33_defconfig | 6 + configs/MPC832XEMDS_HOST_66_defconfig | 6 + configs/MPC832XEMDS_SLAVE_defconfig | 3 + configs/MPC832XEMDS_defconfig | 6 + configs/MPC8349EMDS_PCI64_defconfig | 32 ++ configs/MPC8349EMDS_SDRAM_defconfig | 10 + configs/MPC8349EMDS_SLAVE_defconfig | 12 +- configs/MPC8349EMDS_defconfig | 10 + configs/MPC8349ITXGP_defconfig | 10 + configs/MPC8349ITX_LOWBOOT_defconfig| 10 + configs/MPC8349ITX_defconfig| 9 + configs/MPC837XEMDS_HOST_defconfig | 10 + configs/MPC837XEMDS_SLAVE_defconfig | 33 ++ configs/MPC837XEMDS_defconfig | 10 + configs/MPC837XERDB_SLAVE_defconfig | 7 + configs/MPC837XERDB_defconfig | 10 + configs/TQM834x_defconfig | 9 + configs/caddy2_defconfig| 10 + configs/hrcon_defconfig | 6 + configs/hrcon_dh_defconfig | 6 + configs/ids8313_defconfig | 3 + configs/kmcoge5ne_defconfig | 9 + configs/kmeter1_defconfig | 9 + configs/kmopti2_defconfig | 4 + configs/kmsupx5_defconfig | 4 + configs/kmtegr1_defconfig | 5 + configs/kmtepr2_defconfig | 4 + configs/kmvect1_defconfig | 5 + configs/mpc8308_p1m_defconfig | 5 + configs/sbc8349_PCI_33_defconfig| 10 + configs/sbc8349_PCI_66_defconfig| 10 + configs/sbc8349_defconfig | 10 + configs/strider_con_defconfig | 5 + configs/strider_con_dp_defconfig| 5 + configs/strider_cpu_defconfig | 5 + configs/strider_cpu_dp_defconfig| 5 + configs/suvd3_defconfig | 4 + configs/tuge1_defconfig | 4 + configs/tuxx1_defconfig | 4 + configs/ve8313_defconfig| 7 + configs/vme8349_defconfig | 10 + include/configs/MPC8308RDB.h| 32 -- include/configs/MPC8313ERDB_NAND.h | 38 -- include/configs/MPC8313ERDB_NOR.h | 40 -- include/configs/MPC8315ERDB.h | 34 -- include/configs/MPC8323ERDB.h | 24 - include/configs/MPC832XEMDS.h | 37 -- include/configs/MPC8349EMDS.h | 86 include/configs/MPC8349EMDS_SDRAM.h | 86 include/configs/MPC8349ITX.h| 39 -- include/configs/MPC837XEMDS.h | 42 -- include/configs/MPC837XERDB.h | 40 -- include/configs/TQM834x.h | 35 -- include/configs/caddy2.h| 41 -- include/configs/hrcon.h | 32 -- include/configs/ids8313.h | 21 - include/configs/kmcoge5ne.h | 19 - include/configs/kmeter1.h | 19 - include/configs/kmopti2.h | 22 - include/configs/kmsupx5.h | 22 - include/configs/kmtegr1.h | 22 - include/configs/kmtepr2.h | 22 - include/configs/kmvect1.h | 22 - include/configs/mpc8308_p1m.h | 32 -- include/configs/sbc8349.h | 71 --- include/configs/strider.h | 32 -- include/configs/suvd3.h | 22 - include/configs/tuge1.h | 22 - include/configs/tuxx1.h | 22 - include/configs/ve8313.h| 19 - include/configs/vme8349.h | 43 -- 87 files changed, 1325 insertions(+), 1039 deletions(-) create mode 100644 arch/powerpc/cpu/mpc83xx/hrcw/Kconfig create mode 100644 arch/powerpc/cpu/mpc83xx/hrcw/hrcw.h create mode 100644 configs/MPC8349EMDS_PCI64_defco
[U-Boot] [PATCH v2 37/58] tqm834x: Expand CONFIG_SYS_OR_TIMING_FLASH macro
We want to normalize all BR/OR config lines as much as possible. The TQM834x board uses CONFIG_SYS_OR_TIMING_FLASH in a OR definition, which we want to remove. But CONFIG_SYS_OR_TIMING_FLASH is also used outside of the config file. Replace these usages with the definition of the variable, so we can remove the variable in the next patch. Signed-off-by: Mario Six --- v1 -> v2: No changes --- board/tqc/tqm834x/tqm834x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c index 7c92f4f54c1..c75251e132c 100644 --- a/board/tqc/tqm834x/tqm834x.c +++ b/board/tqc/tqm834x/tqm834x.c @@ -235,8 +235,8 @@ static int detect_num_flash_banks(void) debug("Number of flash banks detected: %d\n", cfi_flash_num_flash_banks); /* set OR0 and BR0 */ - set_lbc_or(0, CONFIG_SYS_OR_TIMING_FLASH | - (-(total_size) & OR_GPCM_AM)); + set_lbc_or(0, OR_GPCM_CSNT | OR_GPCM_ACS_DIV4 | OR_GPCM_SCY_5 | + OR_GPCM_TRLX | (-(total_size) & OR_GPCM_AM)); set_lbc_br(0, (CONFIG_SYS_FLASH_BASE & BR_BA) | (BR_MS_GPCM | BR_PS_32 | BR_V)); -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 38/58] mpc83xx: Simplify BR,OR lines
Re-format all BR,OR #define lines into single lines. This makes them harder to read, but accessible to semi-automatic replacement. Signed-off-by: Mario Six --- v1 -> v2: No changes --- include/configs/MPC8308RDB.h| 46 +--- include/configs/MPC8313ERDB_NAND.h | 67 --- include/configs/MPC8313ERDB_NOR.h | 66 -- include/configs/MPC8315ERDB.h | 34 -- include/configs/MPC8323ERDB.h | 17 ++--- include/configs/MPC832XEMDS.h | 70 - include/configs/MPC8349EMDS.h | 32 - include/configs/MPC8349EMDS_SDRAM.h | 45 +--- include/configs/MPC8349ITX.h| 60 --- include/configs/MPC837XEMDS.h | 52 ++- include/configs/MPC837XERDB.h | 48 +++-- include/configs/TQM834x.h | 19 ++ include/configs/caddy2.h| 31 +--- include/configs/hrcon.h | 32 - include/configs/ids8313.h | 47 ++--- include/configs/kmcoge5ne.h | 55 +++-- include/configs/kmeter1.h | 40 ++--- include/configs/kmopti2.h | 53 include/configs/kmsupx5.h | 43 ++- include/configs/kmtegr1.h | 37 ++-- include/configs/kmtepr2.h | 57 +++--- include/configs/kmvect1.h | 46 +++- include/configs/mpc8308_p1m.h | 40 ++--- include/configs/sbc8349.h | 18 ++ include/configs/strider.h | 31 include/configs/suvd3.h | 46 +++- include/configs/tuge1.h | 43 ++- include/configs/tuxx1.h | 60 +++ include/configs/ve8313.h| 64 +++-- include/configs/vme8349.h | 31 +--- 30 files changed, 302 insertions(+), 1028 deletions(-) diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h index e19bcafd5ce..185f6490d7c 100644 --- a/include/configs/MPC8308RDB.h +++ b/include/configs/MPC8308RDB.h @@ -175,19 +175,9 @@ #define CONFIG_SYS_FLASH_BASE 0xFE00 /* FLASH base address */ #define CONFIG_SYS_FLASH_SIZE 8 /* FLASH size is 8M */ -/* Window base at flash base */ -#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE \ - | BR_PS_16 /* 16 bit port */ \ - | BR_MS_GPCM/* MSEL = GPCM */ \ - | BR_V) /* valid */ -#define CONFIG_SYS_OR0_PRELIM (OR_AM_8MB \ - | OR_UPM_XAM \ - | OR_GPCM_CSNT \ - | OR_GPCM_ACS_DIV2 \ - | OR_GPCM_XACS \ - | OR_GPCM_SCY_15 \ - | OR_GPCM_TRLX_SET \ - | OR_GPCM_EHTR_SET) +/* FLASH */ +#define CONFIG_SYS_BR0_PRELIM (0xFE00 | BR_PS_16 | BR_MS_GPCM | BR_V) +#define CONFIG_SYS_OR0_PRELIM (OR_AM_8MB | OR_UPM_XAM | OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | OR_GPCM_XACS | OR_GPCM_SCY_15 | OR_GPCM_TRLX_SET | OR_GPCM_EHTR_SET) #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */ /* 127 64KB sectors and 8 8KB top sectors per device */ @@ -201,18 +191,9 @@ */ #define CONFIG_SYS_NAND_BASE 0xE060 /* 0xE060 */ #define CONFIG_SYS_NAND_WINDOW_SIZE(32 * 1024) /* 0x8000 */ -#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_NAND_BASE \ - | BR_DECC_CHK_GEN /* Use HW ECC */ \ - | BR_PS_8 /* 8 bit Port */ \ - | BR_MS_FCM /* MSEL = FCM */ \ - | BR_V) /* valid */ -#define CONFIG_SYS_OR1_PRELIM (OR_AM_32KB \ - | OR_FCM_CSCT \ - | OR_FCM_CST \ - | OR_FCM_CHT \ - | OR_FCM_SCY_1 \ - | OR_FCM_TRLX \ - | OR_FCM_EHTR) +/* NAND */ +#define CONFIG_SYS_BR1_PRELIM (0xE060 | BR_DECC_CHK_GEN | BR_PS_8 | BR_MS_FCM | BR_V) +#define CONFIG_SYS_OR1_PRELIM (OR_AM_32KB | OR_FCM_CSCT | OR_FCM_CST | OR_FCM_CHT | OR_FCM_SCY_1 | OR_FCM_TRLX | OR_FCM_EHTR) /* 0x8396 */ #ifdef CONFIG_VSC7385_ENET @@ -220,18 +201,9 @@ /* VSC7385 Base address on CS2 */ #define CONFIG_SYS_VSC7385_BASE0xF000 #define CONFIG_SYS_VSC7385_SIZE
[U-Boot] [PATCH v2 35/58] mpc83xx: Migrate LBLAW_* to Kconfig
The LBLAW_* values determine the window configuration of the memory controller. Hence, they must be known at compile time, and cannot be implemented in the DT mechanism. Configuration of this crucial variable should still be somewhat comfortable. Hence, make its fields configurable in Kconfig, and assemble the final value from these. Signed-off-by: Mario Six --- v1 -> v2: No changes --- arch/powerpc/cpu/mpc83xx/Kconfig | 1 + arch/powerpc/cpu/mpc83xx/cpu_init.c| 2 + arch/powerpc/cpu/mpc83xx/lblaw/Kconfig | 519 + arch/powerpc/cpu/mpc83xx/lblaw/lblaw.h | 55 arch/powerpc/cpu/mpc83xx/spl_minimal.c | 2 + configs/MPC8308RDB_defconfig | 12 + configs/MPC8313ERDB_33_defconfig | 16 + configs/MPC8313ERDB_66_defconfig | 16 + configs/MPC8313ERDB_NAND_33_defconfig | 17 ++ configs/MPC8313ERDB_NAND_66_defconfig | 17 ++ configs/MPC8315ERDB_defconfig | 8 + configs/MPC8323ERDB_defconfig | 4 + configs/MPC832XEMDS_ATM_defconfig | 12 + configs/MPC832XEMDS_HOST_33_defconfig | 12 + configs/MPC832XEMDS_HOST_66_defconfig | 12 + configs/MPC832XEMDS_SLAVE_defconfig| 12 + configs/MPC832XEMDS_defconfig | 12 + configs/MPC8349EMDS_PCI64_defconfig| 8 + configs/MPC8349EMDS_SDRAM_defconfig| 12 + configs/MPC8349EMDS_SLAVE_defconfig| 8 + configs/MPC8349EMDS_defconfig | 8 + configs/MPC8349ITXGP_defconfig | 12 + configs/MPC8349ITX_LOWBOOT_defconfig | 12 + configs/MPC8349ITX_defconfig | 12 + configs/MPC837XEMDS_HOST_defconfig | 12 + configs/MPC837XEMDS_SLAVE_defconfig| 12 + configs/MPC837XEMDS_defconfig | 12 + configs/MPC837XERDB_SLAVE_defconfig| 12 + configs/MPC837XERDB_defconfig | 12 + configs/TQM834x_defconfig | 10 + configs/caddy2_defconfig | 8 + configs/hrcon_defconfig| 8 + configs/hrcon_dh_defconfig | 8 + configs/ids8313_defconfig | 17 ++ configs/kmcoge5ne_defconfig| 12 + configs/kmeter1_defconfig | 12 + configs/kmopti2_defconfig | 16 + configs/kmsupx5_defconfig | 12 + configs/kmtegr1_defconfig | 12 + configs/kmtepr2_defconfig | 16 + configs/kmvect1_defconfig | 16 + configs/mpc8308_p1m_defconfig | 12 + configs/sbc8349_PCI_33_defconfig | 4 + configs/sbc8349_PCI_66_defconfig | 4 + configs/sbc8349_defconfig | 4 + configs/strider_con_defconfig | 8 + configs/strider_con_dp_defconfig | 8 + configs/strider_cpu_defconfig | 8 + configs/strider_cpu_dp_defconfig | 8 + configs/suvd3_defconfig| 16 + configs/tuge1_defconfig| 12 + configs/tuxx1_defconfig| 16 + configs/ve8313_defconfig | 9 + configs/vme8349_defconfig | 8 + include/configs/MPC8308RDB.h | 10 - include/configs/MPC8313ERDB_NAND.h | 18 -- include/configs/MPC8313ERDB_NOR.h | 18 -- include/configs/MPC8315ERDB.h | 10 - include/configs/MPC8323ERDB.h | 3 - include/configs/MPC832XEMDS.h | 8 - include/configs/MPC8349EMDS.h | 6 - include/configs/MPC8349EMDS_SDRAM.h| 8 - include/configs/MPC8349ITX.h | 10 - include/configs/MPC837XEMDS.h | 10 - include/configs/MPC837XERDB.h | 12 - include/configs/TQM834x.h | 11 - include/configs/caddy2.h | 4 - include/configs/hrcon.h| 6 - include/configs/ids8313.h | 12 - include/configs/kmcoge5ne.h| 10 - include/configs/kmeter1.h | 10 - include/configs/kmopti2.h | 13 - include/configs/kmsupx5.h | 11 - include/configs/kmtegr1.h | 9 - include/configs/kmtepr2.h | 13 - include/configs/kmvect1.h | 13 - include/configs/mpc8308_p1m.h | 9 - include/configs/sbc8349.h | 7 - include/configs/strider.h | 6 - include/configs/suvd3.h| 13 - include/configs/tuge1.h| 11 - include/configs/tuxx1.h| 16 - include/configs/ve8313.h | 9 - include/configs/vme8349.h | 4 - scripts/config_whitelist.txt | 16 - 85 files changed, 1125 insertions(+), 316 deletions(-) create mode 100644 arch/powerpc/cpu/mpc83xx/lblaw/Kconfig create mode 100644 arch/powerpc/cpu/mpc83xx/lblaw/lblaw.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index f7f625aea1f..8c84196b978 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -284,6 +284,7 @@ config ARCH_MPC837X source "arch/powerpc/cpu/mpc83xx/hrcw/Kconfig" source "arch/powerpc
[U-Boot] [PATCH v2 36/58] mpc83xx: Normalize BR/OR option lines
All BR/OR option lines should have the same layout to make them easier to migrate to Kconfig. This includes using the same option macros everywhere. The normalize the lines, * replace function macros with their results, and * replace hardcoded hex values with standard macros Signed-off-by: Mario Six --- v1 -> v2: No changes --- include/configs/MPC8308RDB.h| 6 +++--- include/configs/MPC8313ERDB_NAND.h | 4 ++-- include/configs/MPC8313ERDB_NOR.h | 4 ++-- include/configs/MPC8323ERDB.h | 2 +- include/configs/MPC832XEMDS.h | 6 +++--- include/configs/MPC8349EMDS.h | 2 +- include/configs/MPC8349EMDS_SDRAM.h | 2 +- include/configs/MPC8349ITX.h| 2 +- include/configs/MPC837XEMDS.h | 2 +- include/configs/MPC837XERDB.h | 2 +- include/configs/caddy2.h| 2 +- include/configs/hrcon.h | 4 ++-- include/configs/ids8313.h | 10 +- include/configs/kmcoge5ne.h | 12 ++-- include/configs/kmeter1.h | 8 include/configs/kmopti2.h | 8 include/configs/kmsupx5.h | 6 +++--- include/configs/kmtegr1.h | 6 +++--- include/configs/kmtepr2.h | 8 include/configs/kmvect1.h | 8 include/configs/mpc8308_p1m.h | 2 +- include/configs/sbc8349.h | 4 ++-- include/configs/strider.h | 4 ++-- include/configs/suvd3.h | 8 include/configs/tuge1.h | 6 +++--- include/configs/tuxx1.h | 8 include/configs/vme8349.h | 2 +- 27 files changed, 69 insertions(+), 69 deletions(-) diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h index 1953d18e878..e19bcafd5ce 100644 --- a/include/configs/MPC8308RDB.h +++ b/include/configs/MPC8308RDB.h @@ -180,7 +180,7 @@ | BR_PS_16 /* 16 bit port */ \ | BR_MS_GPCM/* MSEL = GPCM */ \ | BR_V) /* valid */ -#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \ +#define CONFIG_SYS_OR0_PRELIM (OR_AM_8MB \ | OR_UPM_XAM \ | OR_GPCM_CSNT \ | OR_GPCM_ACS_DIV2 \ @@ -206,7 +206,7 @@ | BR_PS_8 /* 8 bit Port */ \ | BR_MS_FCM /* MSEL = FCM */ \ | BR_V) /* valid */ -#define CONFIG_SYS_OR1_PRELIM (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \ +#define CONFIG_SYS_OR1_PRELIM (OR_AM_32KB \ | OR_FCM_CSCT \ | OR_FCM_CST \ | OR_FCM_CHT \ @@ -225,7 +225,7 @@ | BR_MS_GPCM/* MSEL = GPCM */ \ | BR_V) /* valid */ /* 0xF801 */ -#define CONFIG_SYS_OR2_PRELIM (P2SZ_TO_AM(CONFIG_SYS_VSC7385_SIZE) \ +#define CONFIG_SYS_OR2_PRELIM (OR_AM_128KB \ | OR_GPCM_CSNT \ | OR_GPCM_XACS \ | OR_GPCM_SCY_15 \ diff --git a/include/configs/MPC8313ERDB_NAND.h b/include/configs/MPC8313ERDB_NAND.h index 79c7f12baee..bbb9d4b936c 100644 --- a/include/configs/MPC8313ERDB_NAND.h +++ b/include/configs/MPC8313ERDB_NAND.h @@ -258,7 +258,7 @@ | BR_MS_GPCM/* MSEL = GPCM */ \ | BR_V) /* valid */ /* 0xFA000801 */ -#define CONFIG_SYS_OR3_PRELIM (P2SZ_TO_AM(CONFIG_SYS_BCSR_SIZE) \ +#define CONFIG_SYS_OR3_PRELIM (OR_AM_32KB \ | OR_GPCM_CSNT \ | OR_GPCM_ACS_DIV2 \ | OR_GPCM_XACS \ @@ -279,7 +279,7 @@ | BR_PS_8 /* 8 bit port */ \ | BR_MS_GPCM/* MSEL = GPCM */ \ | BR_V) /* valid */ -#define CONFIG_SYS_OR2_PRELIM (P2SZ_TO_AM(CONFIG_SYS_VSC7385_SIZE) \ +#define CONFIG_SYS_OR2_PRELIM (OR_AM_128KB \ | OR_GPCM_CSNT \ | OR_GPCM_XACS \ | OR_GPCM_SCY_15 \ diff --git a/include/configs/MPC8313ERDB_NOR.h b/include/configs/MPC8313ERDB_NOR.h index 866ac8faf2a..c1bf62e4055 100644 --- a/include/configs/MPC8313ERDB_NOR.h +++ b/include/configs/MPC8313ERDB_NOR.h @@ -230,7 +230,7 @@ | BR_MS_GPCM/* MSEL = GPCM */ \ | BR_V
[U-Boot] [PATCH v2 45/58] mpc83xx: Prepare usage of DM gpio driver
The MPC85xx GPIO driver was converted to handle a broader range of SoCs. Prepare the MPC83xx code for usage of this driver. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/include/asm/arch-mpc83xx/gpio.h | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h index b5ec50ba44c..385d651d200 100644 --- a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h +++ b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h @@ -17,7 +17,15 @@ #define MAX_NUM_GPIOS (32 * MPC83XX_GPIO_CTRLRS) +struct mpc8xxx_gpio_plat { + ulong addr; + unsigned long size; + uint ngpios; +}; + +#ifndef DM_GPIO void mpc83xx_gpio_init_f(void); void mpc83xx_gpio_init_r(void); +#endif /* DM_GPIO */ #endif /* MPC83XX_GPIO_H_ */ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 39/58] sbc8349: Remove SDRAM functionality
The MPC8349EMDS configuration was the basis for the sbc8349, so it also contains its SDRAM option. Since * the SDRAM has to be soldered onto the board, * the sbc8349 never used the support, and * the support never worked (see previous patch fixing it), we can assume that the support on the sbc8349 is an artifact created by copying the MPC8349EMDS config wholesome. Hence, instead of creating a separate sbc8349 config that supports SDRAM, we can remove the SDRAM option for this board. Should it be needed in the future, it can be copied from the new MPC8349EMDS_SDRAM board. Signed-off-by: Mario Six --- v1 -> v2: No changes --- include/configs/sbc8349.h | 67 --- 1 file changed, 67 deletions(-) diff --git a/include/configs/sbc8349.h b/include/configs/sbc8349.h index 09cdb7c1a8a..42a1e1682d2 100644 --- a/include/configs/sbc8349.h +++ b/include/configs/sbc8349.h @@ -142,73 +142,6 @@ #undef CONFIG_SYS_LB_SDRAM /* if board has SDRAM on local bus */ -#ifdef CONFIG_SYS_LB_SDRAM -/* Local bus BR2, OR2 definition for SDRAM if soldered on the board*/ -/* - * Base Register 2 and Option Register 2 configure SDRAM. - * The SDRAM base address, CONFIG_SYS_LBC_SDRAM_BASE, is 0xf000. - * - * For BR2, need: - *Base address of 0xf000 = BR[0:16] = 0 - *port-size = 32-bits = BR2[19:20] = 11 - *no parity checking = BR2[21:22] = 00 - *SDRAM for MSEL = BR2[24:26] = 011 - *Valid = BR[31] = 1 - * - * 04812 16 20 24 28 - * 0001 1000 0110 0001 = F0001861 - */ - -#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_LBC_SDRAM_BASE \ - | BR_PS_32 \ - | BR_MS_SDRAM \ - | BR_V) - /* 0xF0001861 */ -/* - * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64. - * - * For OR2, need: - *64MB mask for AM, OR2[0:7] = 1100 - * XAM, OR2[17:18] = 11 - *9 columns OR2[19-21] = 010 - *13 rows OR2[23-25] = 100 - *EAD set for extra time OR[31] = 1 - * - * 04812 16 20 24 28 - * 1100 0110 1001 0001 = FC006901 - */ - -#define CONFIG_SYS_OR2_PRELIM (OR_AM_64MB \ - | OR_SDRAM_XAM \ - | ((9 - OR_SDRAM_MIN_COLS) << OR_SDRAM_COLS_SHIFT) \ - | ((13 - OR_SDRAM_MIN_ROWS) << OR_SDRAM_ROWS_SHIFT) \ - | OR_SDRAM_EAD) - /* 0xFC006901 */ - - /* LB sdram refresh timer, about 6us */ -#define CONFIG_SYS_LBC_LSRT0x3200 - /* LB refresh timer prescal, 266MHz/32 */ -#define CONFIG_SYS_LBC_MRTPR 0x2000 - -#define CONFIG_SYS_LBC_LSDMR_COMMON(LSDMR_RFEN \ - | LSDMR_BSMA1516 \ - | LSDMR_RFCR8 \ - | LSDMR_PRETOACT6 \ - | LSDMR_ACTTORW3 \ - | LSDMR_BL8 \ - | LSDMR_WRC3 \ - | LSDMR_CL3) - -/* - * SDRAM Controller configuration sequence. - */ -#define CONFIG_SYS_LBC_LSDMR_1 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_PCHALL) -#define CONFIG_SYS_LBC_LSDMR_2 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH) -#define CONFIG_SYS_LBC_LSDMR_3 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH) -#define CONFIG_SYS_LBC_LSDMR_4 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_MRW) -#define CONFIG_SYS_LBC_LSDMR_5 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_NORMAL) -#endif - /* * Serial Port */ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 46/58] mpc83xx: Migrate HID config to Kconfig
Mirate the HID configuration settings to Kconfig. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/Kconfig | 1 + arch/powerpc/cpu/mpc83xx/hid/Kconfig | 565 ++ arch/powerpc/cpu/mpc83xx/hid/hid.h| 72 + arch/powerpc/cpu/mpc83xx/start.S | 1 + configs/MPC8308RDB_defconfig | 4 + configs/MPC8313ERDB_33_defconfig | 4 + configs/MPC8313ERDB_66_defconfig | 4 + configs/MPC8313ERDB_NAND_33_defconfig | 4 + configs/MPC8313ERDB_NAND_66_defconfig | 4 + configs/MPC8315ERDB_defconfig | 4 + configs/MPC8323ERDB_defconfig | 3 + configs/MPC832XEMDS_ATM_defconfig | 3 + configs/MPC832XEMDS_HOST_33_defconfig | 3 + configs/MPC832XEMDS_HOST_66_defconfig | 3 + configs/MPC832XEMDS_SLAVE_defconfig | 3 + configs/MPC832XEMDS_defconfig | 3 + configs/MPC8349EMDS_PCI64_defconfig | 3 + configs/MPC8349EMDS_SDRAM_defconfig | 3 + configs/MPC8349EMDS_SLAVE_defconfig | 3 + configs/MPC8349EMDS_defconfig | 3 + configs/MPC8349ITXGP_defconfig| 2 + configs/MPC8349ITX_LOWBOOT_defconfig | 2 + configs/MPC8349ITX_defconfig | 2 + configs/MPC837XEMDS_HOST_defconfig| 3 + configs/MPC837XEMDS_SLAVE_defconfig | 3 + configs/MPC837XEMDS_defconfig | 3 + configs/MPC837XERDB_SLAVE_defconfig | 3 + configs/MPC837XERDB_defconfig | 3 + configs/TQM834x_defconfig | 2 + configs/caddy2_defconfig | 3 + configs/hrcon_defconfig | 4 + configs/hrcon_dh_defconfig| 4 + configs/ids8313_defconfig | 3 + configs/kmcoge5ne_defconfig | 3 + configs/kmeter1_defconfig | 3 + configs/kmopti2_defconfig | 3 + configs/kmsupx5_defconfig | 3 + configs/kmtegr1_defconfig | 3 + configs/kmtepr2_defconfig | 3 + configs/kmvect1_defconfig | 3 + configs/mpc8308_p1m_defconfig | 4 + configs/sbc8349_PCI_33_defconfig | 3 + configs/sbc8349_PCI_66_defconfig | 3 + configs/sbc8349_defconfig | 3 + configs/strider_con_defconfig | 4 + configs/strider_con_dp_defconfig | 4 + configs/strider_cpu_defconfig | 4 + configs/strider_cpu_dp_defconfig | 4 + configs/suvd3_defconfig | 3 + configs/tuge1_defconfig | 3 + configs/tuxx1_defconfig | 3 + configs/ve8313_defconfig | 3 + configs/vme8349_defconfig | 3 + include/configs/MPC8308RDB.h | 9 - include/configs/MPC8313ERDB_NAND.h| 7 - include/configs/MPC8313ERDB_NOR.h | 7 - include/configs/MPC8315ERDB.h | 9 - include/configs/MPC8323ERDB.h | 8 - include/configs/MPC832XEMDS.h | 8 - include/configs/MPC8349EMDS.h | 11 - include/configs/MPC8349EMDS_SDRAM.h | 11 - include/configs/MPC8349ITX.h | 5 - include/configs/MPC837XEMDS.h | 8 - include/configs/MPC837XERDB.h | 8 - include/configs/TQM834x.h | 6 - include/configs/caddy2.h | 6 - include/configs/hrcon.h | 9 - include/configs/ids8313.h | 7 - include/configs/kmcoge5ne.h | 8 - include/configs/kmeter1.h | 8 - include/configs/kmopti2.h | 8 - include/configs/kmsupx5.h | 8 - include/configs/kmtegr1.h | 8 - include/configs/kmtepr2.h | 8 - include/configs/kmvect1.h | 8 - include/configs/mpc8308_p1m.h | 9 - include/configs/sbc8349.h | 11 - include/configs/strider.h | 9 - include/configs/suvd3.h | 8 - include/configs/tuge1.h | 8 - include/configs/tuxx1.h | 8 - include/configs/ve8313.h | 6 - include/configs/vme8349.h | 6 - scripts/config_whitelist.txt | 3 - 84 files changed, 795 insertions(+), 243 deletions(-) create mode 100644 arch/powerpc/cpu/mpc83xx/hid/Kconfig create mode 100644 arch/powerpc/cpu/mpc83xx/hid/hid.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 474572f245e..5fb4228076e 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -286,6 +286,7 @@ source "arch/powerpc/cpu/mpc83xx/hrcw/Kconfig" source "arch/powerpc/cpu/mpc83xx/bats/Kconfig" source "arch/powerpc/cpu/mpc83xx/lblaw/Kconfig" source "arch/powerpc/cpu/mpc83xx/elbc/Kconfig" +source "arch/powerpc/cpu/mpc83xx/hid/Kconfig" menu "Legacy options" diff --git a/arch/powerpc/cpu/mpc83xx/hid/Kconfig b/arch/powerpc/cpu/mpc83xx/hid/Kconfig new file mode 100644 index 000..c367ad2ce15 --- /dev/null +++ b/arch/powerpc/cpu/mpc83xx/hid/Kconfig @@ -0,0 +1,565 @@ +menu "HID setup" + +menu "HID0 initia
[U-Boot] [PATCH v2 44/58] mpc83xx: Remove last CONFIG_MPC83xx
Remove the last instances of the CONFIG_MPC83xx symbol. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- include/configs/hrcon.h | 1 - include/configs/strider.h | 1 - 2 files changed, 2 deletions(-) diff --git a/include/configs/hrcon.h b/include/configs/hrcon.h index 9318e6252ae..4001a0a16b0 100644 --- a/include/configs/hrcon.h +++ b/include/configs/hrcon.h @@ -12,7 +12,6 @@ * High Level Configuration Options */ #define CONFIG_E3001 /* E300 family */ -#define CONFIG_MPC83xx 1 /* MPC83xx family */ #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR diff --git a/include/configs/strider.h b/include/configs/strider.h index dd89ee8c815..94164de06c2 100644 --- a/include/configs/strider.h +++ b/include/configs/strider.h @@ -12,7 +12,6 @@ * High Level Configuration Options */ #define CONFIG_E3001 /* E300 family */ -#define CONFIG_MPC83xx 1 /* MPC83xx family */ #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 41/58] powerpc: mpc83xx: Fix MPC8308 IMMR memory layout
The MPC8308 has two I2C controllers, but no PCI controller. Fix the register map layout for this SoC. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/Makefile | 2 ++ arch/powerpc/include/asm/immap_83xx.h | 44 +++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/Makefile b/arch/powerpc/cpu/mpc83xx/Makefile index aa4affa911b..304029977e5 100644 --- a/arch/powerpc/cpu/mpc83xx/Makefile +++ b/arch/powerpc/cpu/mpc83xx/Makefile @@ -29,7 +29,9 @@ obj-y += interrupts.o obj-y += ecc.o obj-$(CONFIG_QE) += qe_io.o obj-$(CONFIG_FSL_SERDES) += serdes.o +ifndef CONFIG_ARCH_MPC8308 obj-$(CONFIG_PCI) += pci.o +endif obj-$(CONFIG_PCIE) += pcie.o obj-$(CONFIG_OF_LIBFDT) += fdt.o diff --git a/arch/powerpc/include/asm/immap_83xx.h b/arch/powerpc/include/asm/immap_83xx.h index 30bbd5671ba..52a93bd81da 100644 --- a/arch/powerpc/include/asm/immap_83xx.h +++ b/arch/powerpc/include/asm/immap_83xx.h @@ -714,7 +714,7 @@ typedef struct immap { u8 res7[0xC]; } immap_t; -#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC8315) +#elif defined(CONFIG_ARCH_MPC8315) typedef struct immap { sysconf83xx_t sysconf;/* System configuration */ wdt83xx_t wdt;/* Watch Dog Timer (WDT) Registers */ @@ -729,8 +729,8 @@ typedef struct immap { gpio83xx_t gpio[1];/* General purpose I/O module */ u8 res0[0x1300]; ddr83xx_t ddr;/* DDR Memory Controller Memory */ - fsl_i2c_t i2c[2]; /* I2C Controllers */ - u8 res1[0x1300]; + fsl_i2c_t i2c[1]; /* I2C Controllers */ + u8 res1[0x1400]; duart83xx_t duart[2]; /* DUART */ u8 res2[0x900]; fsl_lbc_t im_lbc; /* Local Bus Controller Regs */ @@ -759,7 +759,43 @@ typedef struct immap { u8 res12[0x1CF00]; } immap_t; -#elif defined(CONFIG_ARCH_MPC837X) +#elif defined(CONFIG_ARCH_MPC8308) +typedef struct immap { + sysconf83xx_t sysconf;/* System configuration */ + wdt83xx_t wdt;/* Watch Dog Timer (WDT) Registers */ + rtclk83xx_t rtc;/* Real Time Clock Module Registers */ + rtclk83xx_t pit;/* Periodic Interval Timer */ + gtm83xx_t gtm[1]; /* Global Timers Module */ + u8 res0[0x100]; + ipic83xx_t ipic; /* Integrated Programmable Interrupt Controller */ + arbiter83xx_t arbiter;/* System Arbiter Registers */ + reset83xx_t reset; /* Reset Module */ + clk83xx_t clk;/* System Clock Module */ + pmc83xx_t pmc;/* Power Management Control Module */ + gpio83xx_t gpio[1];/* General purpose I/O module */ + u8 res1[0x1300]; + ddr83xx_t ddr;/* DDR Memory Controller Memory */ + fsl_i2c_t i2c[2]; /* I2C Controllers */ + u8 res2[0x1300]; + duart83xx_t duart[2]; /* DUART */ + u8 res3[0x900]; + fsl_lbc_t im_lbc; /* Local Bus Controller Regs */ + u8 res4[0x1000]; + spi8xxx_t spi;/* Serial Peripheral Interface */ + u8 res5[0x1000]; + pex83xx_t pciexp[1]; /* PCI Express Controller */ + u8 res6[0x19000]; + usb83xx_t usb[1]; /* USB DR Controller */ + tsec83xx_t tsec[2]; + u8 res7[0x6000]; + tdmdmac83xx_t tdmdmac;/* TDM DMAC */ + sdhc83xx_t sdhc; /* SDHC Controller */ + u8 res8[0xb4000]; + serdes83xx_tserdes[1]; /* SerDes Registers */ + u8 res9[0x1CF00]; +} immap_t; + +#elif defined(CONFIG_ARCH_MPC837x) typedef struct immap { sysconf83xx_t sysconf;/* System configuration */ wdt83xx_t wdt;/* Watch Dog Timer (WDT) Registers */ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 42/58] powerpc: mpc83xx: Implement get_serial_clock()
DM serial drivers on PowerPC determine their clock frequency via the get_serial_clock function. This function is not Implemented yet for MPC83xx. This patch Implements the function so that DM serial drivers work on MPC83xx. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/speed.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c index e870a23103b..e118a10fa8b 100644 --- a/arch/powerpc/cpu/mpc83xx/speed.c +++ b/arch/powerpc/cpu/mpc83xx/speed.c @@ -516,6 +516,11 @@ ulong get_ddr_freq(ulong dummy) return gd->mem_clk; } +int get_serial_clock(void) +{ + return get_bus_freq(0); +} + static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char buf[32]; -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 51/58] mpc83xx: Migrate CONFIG_LCRR_* to Kconfig
Migrate the CONFIG_LCRR_* settings to Kconfig. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/cpu_init.c | 22 arch/powerpc/cpu/mpc83xx/initreg/Kconfig | 1 + arch/powerpc/cpu/mpc83xx/initreg/Kconfig.lcrr | 139 ++ arch/powerpc/cpu/mpc83xx/initreg/initreg.h| 36 +++ configs/MPC8308RDB_defconfig | 2 + configs/MPC8313ERDB_33_defconfig | 2 + configs/MPC8313ERDB_66_defconfig | 2 + configs/MPC8313ERDB_NAND_33_defconfig | 2 + configs/MPC8313ERDB_NAND_66_defconfig | 2 + configs/MPC8315ERDB_defconfig | 2 + configs/MPC8323ERDB_defconfig | 2 + configs/MPC832XEMDS_ATM_defconfig | 2 + configs/MPC832XEMDS_HOST_33_defconfig | 2 + configs/MPC832XEMDS_HOST_66_defconfig | 2 + configs/MPC832XEMDS_SLAVE_defconfig | 2 + configs/MPC832XEMDS_defconfig | 2 + configs/MPC8349EMDS_PCI64_defconfig | 2 + configs/MPC8349EMDS_SDRAM_defconfig | 2 + configs/MPC8349EMDS_SLAVE_defconfig | 2 + configs/MPC8349EMDS_defconfig | 2 + configs/MPC8349ITXGP_defconfig| 2 + configs/MPC8349ITX_LOWBOOT_defconfig | 2 + configs/MPC8349ITX_defconfig | 2 + configs/MPC837XEMDS_HOST_defconfig| 2 + configs/MPC837XEMDS_SLAVE_defconfig | 2 + configs/MPC837XEMDS_defconfig | 2 + configs/MPC837XERDB_SLAVE_defconfig | 2 + configs/MPC837XERDB_defconfig | 2 + configs/TQM834x_defconfig | 2 + configs/hrcon_defconfig | 2 + configs/hrcon_dh_defconfig| 2 + configs/ids8313_defconfig | 2 + configs/kmcoge5ne_defconfig | 3 + configs/kmeter1_defconfig | 3 + configs/kmopti2_defconfig | 3 + configs/kmsupx5_defconfig | 3 + configs/kmtegr1_defconfig | 3 + configs/kmtepr2_defconfig | 3 + configs/kmvect1_defconfig | 3 + configs/mpc8308_p1m_defconfig | 2 + configs/sbc8349_PCI_33_defconfig | 2 + configs/sbc8349_PCI_66_defconfig | 2 + configs/sbc8349_defconfig | 2 + configs/strider_con_defconfig | 2 + configs/strider_con_dp_defconfig | 2 + configs/strider_cpu_defconfig | 2 + configs/strider_cpu_dp_defconfig | 2 + configs/suvd3_defconfig | 3 + configs/tuge1_defconfig | 3 + configs/tuxx1_defconfig | 3 + configs/ve8313_defconfig | 2 + configs/vme8349_defconfig | 1 + include/configs/MPC8308RDB.h | 2 - include/configs/MPC8313ERDB_NAND.h| 2 - include/configs/MPC8313ERDB_NOR.h | 2 - include/configs/MPC8315ERDB.h | 2 - include/configs/MPC8323ERDB.h | 2 - include/configs/MPC832XEMDS.h | 2 - include/configs/MPC8349EMDS.h | 2 - include/configs/MPC8349EMDS_SDRAM.h | 2 - include/configs/MPC8349ITX.h | 2 - include/configs/MPC837XEMDS.h | 2 - include/configs/MPC837XERDB.h | 2 - include/configs/TQM834x.h | 12 --- include/configs/caddy2.h | 1 - include/configs/hrcon.h | 2 - include/configs/ids8313.h | 2 - include/configs/kmcoge5ne.h | 7 -- include/configs/kmeter1.h | 7 -- include/configs/kmopti2.h | 4 - include/configs/kmsupx5.h | 4 - include/configs/kmtegr1.h | 4 - include/configs/kmtepr2.h | 4 - include/configs/kmvect1.h | 4 - include/configs/mpc8308_p1m.h | 2 - include/configs/sbc8349.h | 2 - include/configs/strider.h | 2 - include/configs/suvd3.h | 4 - include/configs/tuge1.h | 4 - include/configs/tuxx1.h | 4 - include/configs/ve8313.h | 3 - include/configs/vme8349.h | 1 - scripts/config_whitelist.txt | 3 - 83 files changed, 281 insertions(+), 120 deletions(-) create mode 100644 arch/powerpc/cpu/mpc83xx/initreg/Kconfig.lcrr diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c index 59faa78d24c..af8facad534 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu_init.c +
[U-Boot] [PATCH v2 47/58] mpc83xx: Migrate CONFIG_SYS_IMMR to Kconfig
Migrate CONFIG_SYS_IMMR to Kconfig for MPC83xx. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/Kconfig| 7 +++ configs/TQM834x_defconfig | 1 + configs/ids8313_defconfig | 1 + include/configs/MPC8308RDB.h| 5 - include/configs/MPC8313ERDB_NAND.h | 2 -- include/configs/MPC8313ERDB_NOR.h | 2 -- include/configs/MPC8315ERDB.h | 5 - include/configs/MPC8323ERDB.h | 5 - include/configs/MPC832XEMDS.h | 5 - include/configs/MPC8349EMDS.h | 2 -- include/configs/MPC8349EMDS_SDRAM.h | 2 -- include/configs/MPC8349ITX.h| 5 - include/configs/MPC837XEMDS.h | 5 - include/configs/MPC837XERDB.h | 5 - include/configs/TQM834x.h | 3 --- include/configs/caddy2.h| 2 -- include/configs/hrcon.h | 5 - include/configs/ids8313.h | 2 -- include/configs/kmcoge5ne.h | 5 - include/configs/kmeter1.h | 5 - include/configs/kmopti2.h | 5 - include/configs/kmsupx5.h | 5 - include/configs/kmtegr1.h | 5 - include/configs/kmtepr2.h | 5 - include/configs/kmvect1.h | 5 - include/configs/mpc8308_p1m.h | 5 - include/configs/sbc8349.h | 2 -- include/configs/strider.h | 5 - include/configs/suvd3.h | 5 - include/configs/tuge1.h | 5 - include/configs/tuxx1.h | 5 - include/configs/ve8313.h| 2 -- include/configs/vme8349.h | 2 -- 33 files changed, 9 insertions(+), 121 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 5fb4228076e..96376837abb 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -282,6 +282,13 @@ config ARCH_MPC837X select MPC83XX_LDP_PIN select MPC83XX_SECOND_I2C_SUPPORT +config SYS_IMMR + hex "Value for IMMR" + default 0xE000 + help + Address for the Internal Memory-Mapped Registers (IMMR) window used + to configure the features of the SoC. + source "arch/powerpc/cpu/mpc83xx/hrcw/Kconfig" source "arch/powerpc/cpu/mpc83xx/bats/Kconfig" source "arch/powerpc/cpu/mpc83xx/lblaw/Kconfig" diff --git a/configs/TQM834x_defconfig b/configs/TQM834x_defconfig index e85bfaea315..f5746cfad71 100644 --- a/configs/TQM834x_defconfig +++ b/configs/TQM834x_defconfig @@ -4,6 +4,7 @@ CONFIG_SYS_CLK_FREQ=6000 CONFIG_MPC83xx=y CONFIG_HIGH_BATS=y CONFIG_TARGET_TQM834X=y +CONFIG_SYS_IMMR=0xff40 CONFIG_DDR_MC_CLOCK_MODE_1_1=y CONFIG_SYSTEM_PLL_FACTOR_4_1=y CONFIG_CORE_PLL_RATIO_2_1=y diff --git a/configs/ids8313_defconfig b/configs/ids8313_defconfig index 7f57a368558..e9333438800 100644 --- a/configs/ids8313_defconfig +++ b/configs/ids8313_defconfig @@ -4,6 +4,7 @@ CONFIG_SYS_CLK_FREQ=6600 CONFIG_MPC83xx=y CONFIG_HIGH_BATS=y CONFIG_TARGET_IDS8313=y +CONFIG_SYS_IMMR=0xF000 CONFIG_CORE_PLL_RATIO_2_1=y CONFIG_PCI_HOST_MODE_ENABLE=y CONFIG_BOOT_ROM_INTERFACE_GPCM_8BIT=y diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h index 9c4de054403..e825cfbd174 100644 --- a/include/configs/MPC8308RDB.h +++ b/include/configs/MPC8308RDB.h @@ -53,11 +53,6 @@ SICRL_ETSEC1_GTX_CLK125)/* 0x0040 */ /* - * IMMR new address - */ -#define CONFIG_SYS_IMMR0xE000 - -/* * SERDES */ #define CONFIG_FSL_SERDES diff --git a/include/configs/MPC8313ERDB_NAND.h b/include/configs/MPC8313ERDB_NAND.h index 2f48b135c46..e23df14ec17 100644 --- a/include/configs/MPC8313ERDB_NAND.h +++ b/include/configs/MPC8313ERDB_NAND.h @@ -54,8 +54,6 @@ #define CONFIG_VSC7385_ENET #define CONFIG_TSEC2 -#define CONFIG_SYS_IMMR0xE000 - #if !defined(CONFIG_SPL_BUILD) #define CONFIG_DEFAULT_IMMRCONFIG_SYS_IMMR #endif diff --git a/include/configs/MPC8313ERDB_NOR.h b/include/configs/MPC8313ERDB_NOR.h index 21fbadd7cb9..db6114c33ed 100644 --- a/include/configs/MPC8313ERDB_NOR.h +++ b/include/configs/MPC8313ERDB_NOR.h @@ -30,8 +30,6 @@ #define CONFIG_VSC7385_ENET #define CONFIG_TSEC2 -#define CONFIG_SYS_IMMR0xE000 - #define CONFIG_SYS_MEMTEST_START 0x1000 #define CONFIG_SYS_MEMTEST_END 0x07f0 diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h index 5ce213f5949..fbba2fbb50b 100644 --- a/include/configs/MPC8315ERDB.h +++ b/include/configs/MPC8315ERDB.h @@ -32,11 +32,6 @@ #define CONFIG_HWCONFIG /* - * IMMR new address - */ -#define CONFIG_SYS_IMMR0xE000 - -/* * Arbiter Setup */ #define CONFIG_SYS_ACR_PIPE_DEP3 /* Arbiter pipeline depth is 4 */ diff --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h index abc62f7e699..b528c2901b4 100644 --- a/include/configs/MPC8323ERDB.h +++ b/include/configs/MPC8323ERDB.h @@ -21,11
[U-Boot] [PATCH v2 49/58] mpc83xx: Migrate arbiter config to Kconfig
Migrate the arbiter configuration to Kconfig. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/Kconfig | 1 + arch/powerpc/cpu/mpc83xx/arbiter/Kconfig | 139 + arch/powerpc/cpu/mpc83xx/arbiter/arbiter.h | 28 ++ arch/powerpc/cpu/mpc83xx/cpu_init.c| 29 +- arch/powerpc/cpu/mpc83xx/spl_minimal.c | 8 +- configs/MPC8308RDB_defconfig | 2 + configs/MPC8313ERDB_33_defconfig | 2 + configs/MPC8313ERDB_66_defconfig | 2 + configs/MPC8313ERDB_NAND_33_defconfig | 2 + configs/MPC8313ERDB_NAND_66_defconfig | 2 + configs/MPC8315ERDB_defconfig | 2 + configs/MPC8323ERDB_defconfig | 2 + configs/MPC8349EMDS_PCI64_defconfig| 2 + configs/MPC8349EMDS_SDRAM_defconfig| 2 + configs/MPC8349EMDS_SLAVE_defconfig| 2 + configs/MPC8349EMDS_defconfig | 2 + configs/MPC8349ITXGP_defconfig | 2 + configs/MPC8349ITX_LOWBOOT_defconfig | 2 + configs/MPC8349ITX_defconfig | 2 + configs/MPC837XEMDS_HOST_defconfig | 2 + configs/MPC837XEMDS_SLAVE_defconfig| 2 + configs/MPC837XEMDS_defconfig | 2 + configs/MPC837XERDB_SLAVE_defconfig| 2 + configs/MPC837XERDB_defconfig | 2 + configs/hrcon_defconfig| 2 + configs/hrcon_dh_defconfig | 2 + configs/ids8313_defconfig | 2 + configs/kmcoge5ne_defconfig| 4 + configs/kmeter1_defconfig | 4 + configs/kmopti2_defconfig | 4 + configs/kmsupx5_defconfig | 4 + configs/kmtegr1_defconfig | 4 + configs/kmtepr2_defconfig | 4 + configs/kmvect1_defconfig | 4 + configs/mpc8308_p1m_defconfig | 2 + configs/strider_con_defconfig | 2 + configs/strider_con_dp_defconfig | 2 + configs/strider_cpu_defconfig | 2 + configs/strider_cpu_dp_defconfig | 2 + configs/suvd3_defconfig| 4 + configs/tuge1_defconfig| 4 + configs/tuxx1_defconfig| 4 + configs/ve8313_defconfig | 2 + include/configs/MPC8308RDB.h | 5 -- include/configs/MPC8313ERDB_NAND.h | 3 - include/configs/MPC8313ERDB_NOR.h | 3 - include/configs/MPC8315ERDB.h | 5 -- include/configs/MPC8323ERDB.h | 5 -- include/configs/MPC8349EMDS.h | 2 - include/configs/MPC8349EMDS_SDRAM.h| 2 - include/configs/MPC8349ITX.h | 2 - include/configs/MPC837XEMDS.h | 4 - include/configs/MPC837XERDB.h | 4 - include/configs/hrcon.h| 5 -- include/configs/ids8313.h | 3 - include/configs/kmcoge5ne.h| 8 -- include/configs/kmeter1.h | 8 -- include/configs/kmopti2.h | 8 -- include/configs/kmsupx5.h | 8 -- include/configs/kmtegr1.h | 8 -- include/configs/kmtepr2.h | 8 -- include/configs/kmvect1.h | 8 -- include/configs/mpc8308_p1m.h | 5 -- include/configs/strider.h | 5 -- include/configs/suvd3.h| 8 -- include/configs/tuge1.h| 8 -- include/configs/tuxx1.h| 8 -- include/configs/ve8313.h | 3 - scripts/config_whitelist.txt | 4 - 69 files changed, 269 insertions(+), 172 deletions(-) create mode 100644 arch/powerpc/cpu/mpc83xx/arbiter/Kconfig create mode 100644 arch/powerpc/cpu/mpc83xx/arbiter/arbiter.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 9f7b3a2e019..8a3bb10466c 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -295,6 +295,7 @@ source "arch/powerpc/cpu/mpc83xx/lblaw/Kconfig" source "arch/powerpc/cpu/mpc83xx/elbc/Kconfig" source "arch/powerpc/cpu/mpc83xx/hid/Kconfig" source "arch/powerpc/cpu/mpc83xx/sysio/Kconfig" +source "arch/powerpc/cpu/mpc83xx/arbiter/Kconfig" menu "Legacy options" diff --git a/arch/powerpc/cpu/mpc83xx/arbiter/Kconfig b/arch/powerpc/cpu/mpc83xx/arbiter/Kconfig new file mode 100644 index 000..f562476da85 --- /dev/null +++ b/arch/powerpc/cpu/mpc83xx/arbiter/Kconfig @@ -0,0 +1,139 @@ +menu "Arbiter" + +choice + prompt "Pipeline depth" + +config ACR_PIPE_DEP_UNSET + bool "Don't set value" + +config ACR_PIPE_DEP_1 + bool "1" + +config ACR_PIPE_DEP_2 + bool "2" + +config ACR_PIPE_DEP_3 + bool "3" + +config ACR_PIPE_DEP_4 + bool "4" + +endchoice + +choice + prompt "Repeat count" + +config ACR_RPT
[U-Boot] [PATCH v2 57/58] mpc83xx: Replace ppcDWstore with inline assembly
ppcDWstore/ppcDWload are hardly used by any board, but since they're implemented in start.S, they're always present in every U-Boot image, even if they're not needed. Re-implement these fuctions in C with inline assembly, so that the compiler can decide when to actually include them. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/cpu.c | 18 ++ arch/powerpc/cpu/mpc83xx/start.S | 12 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c index 4ea4249aff0..9c67099a17a 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu.c +++ b/arch/powerpc/cpu/mpc83xx/cpu.c @@ -229,3 +229,21 @@ int cpu_mmc_init(bd_t *bis) return 0; #endif } + +void ppcDWstore(unsigned int *addr, unsigned int *value) +{ + asm("lfd 1, 0(%1)\n\t" + "stfd 1, 0(%0)" + : + : "r" (addr), "r" (value) + : "memory"); +} + +void ppcDWload(unsigned int *addr, unsigned int *ret) +{ + asm("lfd 1, 0(%0)\n\t" + "stfd 1, 0(%1)" + : + : "r" (addr), "r" (ret) + : "memory"); +} diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S index 4df22f64fec..ee8c2e68dda 100644 --- a/arch/powerpc/cpu/mpc83xx/start.S +++ b/arch/powerpc/cpu/mpc83xx/start.S @@ -119,18 +119,6 @@ disable_addr_trans: mtspr SRR1, r3 rfi - .globl ppcDWstore -ppcDWstore: - lfd 1, 0(r4) - stfd1, 0(r3) - blr - - .globl ppcDWload -ppcDWload: - lfd 1, 0(r3) - stfd1, 0(r4) - blr - #ifndef CONFIG_DEFAULT_IMMR #error CONFIG_DEFAULT_IMMR must be defined #endif /* CONFIG_DEFAULT_IMMR */ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 43/58] powerpc: mpc83xx: fdt: Use get_serial_clock()
Replace the hard-coded CONFIG_SYS_NS16550_CLK value for the FDT fixup with the previously introduced get_serial_clock function This will make it possible to activate DM for serial devices on MPC83xx later on. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/fdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/fdt.c b/arch/powerpc/cpu/mpc83xx/fdt.c index cfd391b78ab..b487e31cc0f 100644 --- a/arch/powerpc/cpu/mpc83xx/fdt.c +++ b/arch/powerpc/cpu/mpc83xx/fdt.c @@ -116,8 +116,8 @@ void ft_cpu_setup(void *blob, bd_t *bd) #endif #ifdef CONFIG_SYS_NS16550 - do_fixup_by_compat_u32(blob, "ns16550", - "clock-frequency", CONFIG_SYS_NS16550_CLK, 1); +do_fixup_by_compat_u32(blob, "ns16550", +"clock-frequency", get_serial_clock(), 1); #endif fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 48/58] mpc8308: Migrate system io config to Kconfig
Migrate the system IO configuration setting to Kconfig. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/Kconfig | 1 + arch/powerpc/cpu/mpc83xx/cpu_init.c| 1 + arch/powerpc/cpu/mpc83xx/sysio/Kconfig | 7 + arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308 | 323 + arch/powerpc/cpu/mpc83xx/sysio/sysio.h | 32 +++ configs/MPC8308RDB_defconfig | 8 + configs/hrcon_defconfig| 9 + configs/hrcon_dh_defconfig | 9 + configs/mpc8308_p1m_defconfig | 8 + configs/strider_con_defconfig | 9 + configs/strider_con_dp_defconfig | 9 + configs/strider_cpu_defconfig | 9 + configs/strider_cpu_dp_defconfig | 9 + include/configs/MPC8308RDB.h | 25 -- include/configs/hrcon.h| 25 -- include/configs/mpc8308_p1m.h | 25 -- include/configs/strider.h | 25 -- 17 files changed, 434 insertions(+), 100 deletions(-) create mode 100644 arch/powerpc/cpu/mpc83xx/sysio/Kconfig create mode 100644 arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308 create mode 100644 arch/powerpc/cpu/mpc83xx/sysio/sysio.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 96376837abb..9f7b3a2e019 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -294,6 +294,7 @@ source "arch/powerpc/cpu/mpc83xx/bats/Kconfig" source "arch/powerpc/cpu/mpc83xx/lblaw/Kconfig" source "arch/powerpc/cpu/mpc83xx/elbc/Kconfig" source "arch/powerpc/cpu/mpc83xx/hid/Kconfig" +source "arch/powerpc/cpu/mpc83xx/sysio/Kconfig" menu "Legacy options" diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c index 5ce7b794b26..3df01ee1ca1 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu_init.c +++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c @@ -14,6 +14,7 @@ #include "lblaw/lblaw.h" #include "elbc/elbc.h" +#include "sysio/sysio.h" DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/powerpc/cpu/mpc83xx/sysio/Kconfig b/arch/powerpc/cpu/mpc83xx/sysio/Kconfig new file mode 100644 index 000..9e1f1587121 --- /dev/null +++ b/arch/powerpc/cpu/mpc83xx/sysio/Kconfig @@ -0,0 +1,7 @@ +menu "System I/O configuration" + +if ARCH_MPC8308 +source "arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308" +endif + +endmenu diff --git a/arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308 b/arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308 new file mode 100644 index 000..de62171b301 --- /dev/null +++ b/arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308 @@ -0,0 +1,323 @@ +choice + prompt "SPI group" + +config SICR_SPI_SPI + bool "SPI" + +config SICR_SPI_MSRCID + bool "MSRCID" + +config SICR_SPI_LSRCID + bool "LSRCID" + +endchoice + +choice + prompt "UART group" + +config SICR_UART_SPI + bool "UART" + +config SICR_UART_MSRCID + bool "MSRCID" + +config SICR_UART_LSRCID + bool "LSRCID" + +endchoice + +choice + prompt "IRQ group" + +config SICR_IRQ_SPI + bool "IRQ" + +config SICR_IRQ_MCP_CKSTOP + bool "MCP/CKSTOP" + +config SICR_IRQ_INTA + bool "INTA" + +endchoice + +choice + prompt "I2C2 group" + +config SICR_I2C2_I2C + bool "IRQ" + +config SICR_I2C2_CKSTOP + bool "CKSTOP" + +endchoice + +choice + prompt "ETSEC1 A group" + +config SICR_ETSEC1_A_TSEC2 + bool "TSEC1" + +config SICR_ETSEC1_A_TSEC_GTX_CLK125 + bool "TSEC1 GTX_CLK125" + +endchoice + +choice + prompt "eSDHC A group" + +config SICR_ESDHC_A_SD + bool "SD" + +config SICR_ESDHC_A_GTM + bool "GTM" + +config SICR_ESDHC_A_GPIO + bool "GPIO" + +endchoice + +choice + prompt "eSDHC B group" + +config SICR_ESDHC_B_SD + bool "SD" + +config SICR_ESDHC_B_GTM + bool "GTM" + +config SICR_ESDHC_B_GPIO + bool "GPIO" + +endchoice + +choice + prompt "eSDHC C group" + +config SICR_ESDHC_C_SD + bool "SD" + +config SICR_ESDHC_C_GTM + bool "GTM" + +config SICR_ESDHC_C_GPIO + bool "GPIO" + +endchoice + +choice + prompt "GPIO A group" + +config SICR_GPIO_A_GPIO + bool "GPIO" + +config SICR_GPIO_A_TSEC2 + bool "TSEC2" + +endchoice + +choice + prompt "GPIO B group" + +config SICR_GPIO_B_GPIO + bool "GPIO" + +config SICR_GPIO_B_TSEC2 + bool "TSEC2" + +config SICR_GPIO_B_TSEC_GTX_CLK125 + bool "TSEC2 GTX_CLK125" + +endchoice + +choice + prompt "IEEE1588 A group" + +config SICR_IEEE1588_A_TSEC + bool "TSEC" + +config SICR_IEEE1588_A_GPIO + bool "GPIO" + +endchoice + +choice + prompt "USB group" + +config SICR_USB_TSEC + bool "USB" + +endchoice + +choice + prompt "GTM group" + +config SICR_GTM_TSEC + bool "GTM" + +config SICR_GTM_GPIO + bool "GPIO" + +endchoice + +choice + prom
[U-Boot] [PATCH v2 58/58] mpc83xx: Use pre-defined asm functions
For a lot of inline assembly calls in the mpc8xxx and mpc83xx directories, we already have convenient pre-defined helper functions, but they're not used, resulting in hard-to-read code. Use these helper functions where ever possible and useful. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/cpu.c | 19 +-- arch/powerpc/cpu/mpc83xx/ecc.c | 36 ++-- arch/powerpc/cpu/mpc83xx/spd_sdram.c | 36 +++- arch/powerpc/cpu/mpc8xxx/fsl_pamu.c | 12 ++-- arch/powerpc/lib/cache.c | 6 +++--- 5 files changed, 63 insertions(+), 46 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c index 9c67099a17a..3048ecf34ad 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu.c +++ b/arch/powerpc/cpu/mpc83xx/cpu.c @@ -133,18 +133,18 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) #ifdef MPC83xx_RESET /* Interrupts and MMU off */ - __asm__ __volatile__ ("mfmsr%0":"=r" (msr):); - - msr &= ~( MSR_EE | MSR_IR | MSR_DR); - __asm__ __volatile__ ("mtmsr%0"::"r" (msr)); + msr = mfmsr(); + msr &= ~(MSR_EE | MSR_IR | MSR_DR); + mtmsr(msr); /* enable Reset Control Reg */ immap->reset.rpr = 0x52535445; - __asm__ __volatile__ ("sync"); - __asm__ __volatile__ ("isync"); + sync(); + isync(); /* confirm Reset Control Reg is enabled */ - while(!((immap->reset.rcer) & RCER_CRE)); + while(!((immap->reset.rcer) & RCER_CRE)) + ; udelay(200); @@ -156,10 +156,9 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) immap->reset.rmr = RMR_CSRE;/* Checkstop Reset enable */ /* Interrupts and MMU off */ - __asm__ __volatile__ ("mfmsr%0":"=r" (msr):); - + msr = mfmsr(); msr &= ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR); - __asm__ __volatile__ ("mtmsr%0"::"r" (msr)); + mtmsr(msr); /* * Trying to execute the next instruction at a non-existing address diff --git a/arch/powerpc/cpu/mpc83xx/ecc.c b/arch/powerpc/cpu/mpc83xx/ecc.c index 73f0be2a30e..10e9b96add1 100644 --- a/arch/powerpc/cpu/mpc83xx/ecc.c +++ b/arch/powerpc/cpu/mpc83xx/ecc.c @@ -191,8 +191,8 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) } ddr->err_disable = val; - __asm__ __volatile__("sync"); - __asm__ __volatile__("isync"); + sync(); + isync(); return 0; } else if (strcmp(argv[1], "errdetectclr") == 0) { val = ddr->err_detect; @@ -249,8 +249,8 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) printf("Incorrect command\n"); ddr->ecc_err_inject = val; - __asm__ __volatile__("sync"); - __asm__ __volatile__("isync"); + sync(); + isync(); return 0; } else if (strcmp(argv[1], "mirror") == 0) { val = ddr->ecc_err_inject; @@ -282,26 +282,26 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) /* enable injects */ ddr->ecc_err_inject |= ECC_ERR_INJECT_EIEN; - __asm__ __volatile__("sync"); - __asm__ __volatile__("isync"); + sync(); + isync(); /* write memory location injecting errors */ ppcDWstore((u32 *) i, pattern); - __asm__ __volatile__("sync"); + sync(); /* disable injects */ ddr->ecc_err_inject &= ~ECC_ERR_INJECT_EIEN; - __asm__ __volatile__("sync"); - __asm__ __volatile__("isync"); + sync(); + isync(); /* read data, this generates ECC error */ ppcDWload((u32 *) i, ret); - __asm__ __volatile__("sync"); + sync(); /* re-initialize memory, double word write the location again, * generates new ECC code this time */ ppcDWstore((u32 *) i, writeback); - __asm__ __volatile__("sync"); + sync(); }
[U-Boot] [PATCH v2 55/58] mpc83xx: Add arch clock.h to make SDHC work
The fsl-esdhc driver can be used for the SDHC functionality on MPC83xx, but it needs some additional definitions. Add a clock.h file, so we can use the driver for MPC83xx. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/include/asm/arch-mpc83xx/clock.h | 22 ++ 1 file changed, 22 insertions(+) create mode 100644 arch/powerpc/include/asm/arch-mpc83xx/clock.h diff --git a/arch/powerpc/include/asm/arch-mpc83xx/clock.h b/arch/powerpc/include/asm/arch-mpc83xx/clock.h new file mode 100644 index 000..d57e93c2df9 --- /dev/null +++ b/arch/powerpc/include/asm/arch-mpc83xx/clock.h @@ -0,0 +1,22 @@ +/* + * (C) Copyright 2018 + * Mario Six, Guntermann & Drunck GmbH, mario@gdsys.cc + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#ifndef __ASM_POWERPC_CLOCK_H +#define __ASM_POWERPC_CLOCK_H + +/* Make fsl_esdhc driver happy */ +enum mxc_clock { + MXC_ESDHC_CLK, +}; + +DECLARE_GLOBAL_DATA_PTR; + +uint mxc_get_clock(int clk) +{ + return gd->arch.sdhc_clk; +} +#endif /* __ASM_POWERPC_CLOCK_H */ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 53/58] mpc83xx: Get rid of CONFIG_SYS_DDR_SDRAM_BASE
CONFIG_SYS_DDR_SDRAM_BASE is set to the same value as CONFIG_SYS_SDRAM_BASE on all existing boards. Just use CONFIG_SYS_SDRAM_BASE instead. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/spd_sdram.c | 2 +- board/freescale/mpc8308rdb/sdram.c| 4 ++-- board/freescale/mpc8313erdb/sdram.c | 8 board/freescale/mpc8315erdb/sdram.c | 2 +- board/freescale/mpc8349emds/mpc8349emds.c | 8 board/freescale/mpc8349itx/mpc8349itx.c | 8 board/freescale/mpc837xemds/mpc837xemds.c | 2 +- board/freescale/mpc837xerdb/mpc837xerdb.c | 2 +- board/gdsys/mpc8308/sdram.c | 4 ++-- board/ids/ids8313/ids8313.c | 2 +- board/mpc8308_p1m/sdram.c | 4 ++-- board/sbc8349/sbc8349.c | 8 board/ve8313/ve8313.c | 8 drivers/ddr/fsl/main.c| 4 include/configs/MPC8308RDB.h | 1 - include/configs/MPC8313ERDB_NAND.h| 1 - include/configs/MPC8313ERDB_NOR.h | 1 - include/configs/MPC8315ERDB.h | 1 - include/configs/MPC8323ERDB.h | 1 - include/configs/MPC832XEMDS.h | 1 - include/configs/MPC8349EMDS.h | 1 - include/configs/MPC8349EMDS_SDRAM.h | 1 - include/configs/MPC8349ITX.h | 1 - include/configs/MPC837XEMDS.h | 1 - include/configs/MPC837XERDB.h | 1 - include/configs/TQM834x.h | 1 - include/configs/caddy2.h | 1 - include/configs/hrcon.h | 1 - include/configs/ids8313.h | 1 - include/configs/kmcoge5ne.h | 1 - include/configs/kmeter1.h | 1 - include/configs/kmopti2.h | 1 - include/configs/kmsupx5.h | 1 - include/configs/kmtegr1.h | 1 - include/configs/kmtepr2.h | 1 - include/configs/kmvect1.h | 1 - include/configs/mpc8308_p1m.h | 1 - include/configs/sbc8349.h | 1 - include/configs/strider.h | 1 - include/configs/suvd3.h | 1 - include/configs/tuge1.h | 1 - include/configs/tuxx1.h | 1 - include/configs/ve8313.h | 1 - include/configs/vme8349.h | 1 - 44 files changed, 35 insertions(+), 61 deletions(-) diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c b/arch/powerpc/cpu/mpc83xx/spd_sdram.c index b3cbf9f8823..5ca307ca583 100644 --- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c +++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c @@ -281,7 +281,7 @@ long int spd_sdram() /* * Set up LAWBAR for all of DDR. */ - ecm->bar = CONFIG_SYS_DDR_SDRAM_BASE & 0xf000; + ecm->bar = CONFIG_SYS_SDRAM_BASE & 0xf000; ecm->ar = (LAWAR_EN | LAWAR_TRGT_IF_DDR | (LAWAR_SIZE & law_size)); debug("DDR:bar=0x%08x\n", ecm->bar); debug("DDR:ar=0x%08x\n", ecm->ar); diff --git a/board/freescale/mpc8308rdb/sdram.c b/board/freescale/mpc8308rdb/sdram.c index e64b3107b5f..317e63ea6a1 100644 --- a/board/freescale/mpc8308rdb/sdram.c +++ b/board/freescale/mpc8308rdb/sdram.c @@ -33,7 +33,7 @@ static long fixed_sdram(void) u32 msize_log2 = __ilog2(msize); out_be32(&im->sysconf.ddrlaw[0].bar, - CONFIG_SYS_DDR_SDRAM_BASE & 0xf000); + CONFIG_SYS_SDRAM_BASE & 0xf000); out_be32(&im->sysconf.ddrlaw[0].ar, LBLAWAR_EN | (msize_log2 - 1)); out_be32(&im->sysconf.ddrcdr, CONFIG_SYS_DDRCDR_VALUE); @@ -61,7 +61,7 @@ static long fixed_sdram(void) setbits_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); sync(); - return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); + return get_ram_size(CONFIG_SYS_SDRAM_BASE, msize); } int dram_init(void) diff --git a/board/freescale/mpc8313erdb/sdram.c b/board/freescale/mpc8313erdb/sdram.c index 5e074e3d87b..090412d4b6c 100644 --- a/board/freescale/mpc8313erdb/sdram.c +++ b/board/freescale/mpc8313erdb/sdram.c @@ -47,7 +47,7 @@ static long fixed_sdram(void) volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; u32 msize_log2 = __ilog2(msize); - im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_SDRAM_BASE & 0xf000; + im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & 0xf000; im->sysconf.ddrlaw[0].ar = LBLAWAR_EN | (msize_log2 - 1); im->sysconf.ddrcdr = CONFIG_SYS_DDRCDR_VALUE; @@ -57,12 +57,12 @@ static long fixed_sdram(void) */ __udelay(5); -#if ((CONFIG_SYS_DDR_SDRAM_BASE & 0x00FF) != 0) +#if ((CONFIG_SYS_SDRAM_BASE & 0x00FF) != 0) #warning Chip select bounds is only configurable in 16MB increments #endif im->ddr.csbnds[0].csbnds = - ((CONFIG_SYS_DDR_SDRAM_BASE >> CSBNDS_SA_SHIFT) & CSBNDS_SA) | - (((CONFIG_SYS_DDR_
[U-Boot] [PATCH v2 52/58] mpc83xx: Get rid of CONFIG_SYS_DDR_BASE
CONFIG_SYS_DDR_BASE is specific to mpc83xx an is always set to the same value as CONFIG_SYS_SDRAM_BASE. Just use CONFIG_SYS_SDRAM_BASE instead. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- board/esd/vme8349/vme8349.c | 2 +- board/freescale/mpc8323erdb/mpc8323erdb.c | 2 +- board/freescale/mpc832xemds/mpc832xemds.c | 2 +- board/freescale/mpc8349emds/mpc8349emds.c | 2 +- board/freescale/mpc8349itx/mpc8349itx.c | 2 +- board/ids/ids8313/ids8313.c | 2 +- board/keymile/km83xx/km83xx.c | 4 ++-- board/sbc8349/sbc8349.c | 2 +- board/tqc/tqm834x/tqm834x.c | 6 +++--- board/ve8313/ve8313.c | 2 +- include/configs/MPC8308RDB.h | 5 ++--- include/configs/MPC8313ERDB_NAND.h| 5 ++--- include/configs/MPC8313ERDB_NOR.h | 5 ++--- include/configs/MPC8315ERDB.h | 5 ++--- include/configs/MPC8323ERDB.h | 5 ++--- include/configs/MPC832XEMDS.h | 5 ++--- include/configs/MPC8349EMDS.h | 5 ++--- include/configs/MPC8349EMDS_SDRAM.h | 5 ++--- include/configs/MPC8349ITX.h | 5 ++--- include/configs/MPC837XEMDS.h | 5 ++--- include/configs/MPC837XERDB.h | 5 ++--- include/configs/TQM834x.h | 5 ++--- include/configs/caddy2.h | 5 ++--- include/configs/hrcon.h | 5 ++--- include/configs/ids8313.h | 5 ++--- include/configs/kmcoge5ne.h | 5 ++--- include/configs/kmeter1.h | 5 ++--- include/configs/kmopti2.h | 5 ++--- include/configs/kmsupx5.h | 5 ++--- include/configs/kmtegr1.h | 5 ++--- include/configs/kmtepr2.h | 5 ++--- include/configs/kmvect1.h | 5 ++--- include/configs/mpc8308_p1m.h | 5 ++--- include/configs/sbc8349.h | 5 ++--- include/configs/strider.h | 5 ++--- include/configs/suvd3.h | 5 ++--- include/configs/tuge1.h | 5 ++--- include/configs/tuxx1.h | 5 ++--- include/configs/ve8313.h | 5 ++--- include/configs/vme8349.h | 5 ++--- scripts/config_whitelist.txt | 1 - 41 files changed, 73 insertions(+), 104 deletions(-) diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c index a46d0b6da63..4c220fa8e13 100644 --- a/board/esd/vme8349/vme8349.c +++ b/board/esd/vme8349/vme8349.c @@ -38,7 +38,7 @@ int dram_init(void) return -ENXIO; /* DDR SDRAM - Main memory */ - im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; + im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR; msize = spd_sdram(); diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c b/board/freescale/mpc8323erdb/mpc8323erdb.c index 772688186b5..2dc6d7f5f5f 100644 --- a/board/freescale/mpc8323erdb/mpc8323erdb.c +++ b/board/freescale/mpc8323erdb/mpc8323erdb.c @@ -79,7 +79,7 @@ int dram_init(void) return -ENXIO; /* DDR SDRAM - Main SODIMM */ - im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; + im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR; msize = fixed_sdram(); diff --git a/board/freescale/mpc832xemds/mpc832xemds.c b/board/freescale/mpc832xemds/mpc832xemds.c index 869538feb92..61b95c601e6 100644 --- a/board/freescale/mpc832xemds/mpc832xemds.c +++ b/board/freescale/mpc832xemds/mpc832xemds.c @@ -98,7 +98,7 @@ int dram_init(void) return -ENXIO; /* DDR SDRAM - Main SODIMM */ - im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; + im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR; msize = fixed_sdram(); diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c index 4ec0af4d1c5..1c34f1dc38c 100644 --- a/board/freescale/mpc8349emds/mpc8349emds.c +++ b/board/freescale/mpc8349emds/mpc8349emds.c @@ -56,7 +56,7 @@ int dram_init(void) return -ENXIO; /* DDR SDRAM - Main SODIMM */ - im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; + im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR; #if defined(CONFIG_SPD_EEPROM) #ifndef CONFIG_SYS_FSL_DDR2 msize = spd_sdram() * 1024 * 1024; diff --git a/board/freescale/mpc8349itx/mpc8349itx.c b/board/freescale/mpc8349itx/mpc8349itx.c index 62bcf235711..aaaea7ce89f 100644 --- a/board/freescale/mpc8349itx/mpc8349itx.c +++ b/board/freescale/mpc8349itx/mpc8349itx.c @@ -132,7 +132,7 @@ int dram_init(void) return -ENXIO; /* DDR SDRAM - Main SODIMM */ - im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; + im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR; #ifdef CONFIG_SPD_EEPROM
[U-Boot] [PATCH v2 50/58] mpc83xx: Migrate SPCR to Kconfig
Migrate the SPCR setting to Kconfig. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/Kconfig | 1 + arch/powerpc/cpu/mpc83xx/cpu_init.c | 29 +-- arch/powerpc/cpu/mpc83xx/initreg/Kconfig | 5 ++ arch/powerpc/cpu/mpc83xx/initreg/Kconfig.spcr | 115 ++ arch/powerpc/cpu/mpc83xx/initreg/initreg.h| 43 ++ configs/MPC8308RDB_defconfig | 1 + configs/MPC8315ERDB_defconfig | 1 + configs/MPC8323ERDB_defconfig | 1 + configs/MPC8349EMDS_PCI64_defconfig | 2 + configs/MPC8349EMDS_SLAVE_defconfig | 2 + configs/MPC8349EMDS_defconfig | 2 + configs/MPC8349ITXGP_defconfig| 2 + configs/MPC8349ITX_LOWBOOT_defconfig | 2 + configs/MPC8349ITX_defconfig | 2 + configs/MPC837XEMDS_HOST_defconfig| 1 + configs/MPC837XEMDS_SLAVE_defconfig | 1 + configs/MPC837XEMDS_defconfig | 1 + configs/MPC837XERDB_SLAVE_defconfig | 1 + configs/MPC837XERDB_defconfig | 1 + configs/hrcon_defconfig | 1 + configs/hrcon_dh_defconfig| 1 + configs/mpc8308_p1m_defconfig | 1 + configs/strider_con_defconfig | 1 + configs/strider_con_dp_defconfig | 1 + configs/strider_cpu_defconfig | 1 + configs/strider_cpu_dp_defconfig | 1 + include/configs/MPC8308RDB.h | 2 - include/configs/MPC8315ERDB.h | 2 - include/configs/MPC8323ERDB.h | 3 - include/configs/MPC8349EMDS.h | 2 - include/configs/MPC8349ITX.h | 2 - include/configs/MPC837XEMDS.h | 3 - include/configs/MPC837XERDB.h | 3 - include/configs/hrcon.h | 2 - include/configs/mpc8308_p1m.h | 2 - include/configs/strider.h | 2 - scripts/config_whitelist.txt | 1 - 37 files changed, 192 insertions(+), 52 deletions(-) create mode 100644 arch/powerpc/cpu/mpc83xx/initreg/Kconfig create mode 100644 arch/powerpc/cpu/mpc83xx/initreg/Kconfig.spcr create mode 100644 arch/powerpc/cpu/mpc83xx/initreg/initreg.h diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig index 8a3bb10466c..fe20e85086b 100644 --- a/arch/powerpc/cpu/mpc83xx/Kconfig +++ b/arch/powerpc/cpu/mpc83xx/Kconfig @@ -296,6 +296,7 @@ source "arch/powerpc/cpu/mpc83xx/elbc/Kconfig" source "arch/powerpc/cpu/mpc83xx/hid/Kconfig" source "arch/powerpc/cpu/mpc83xx/sysio/Kconfig" source "arch/powerpc/cpu/mpc83xx/arbiter/Kconfig" +source "arch/powerpc/cpu/mpc83xx/initreg/Kconfig" menu "Legacy options" diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c index 77502567a70..59faa78d24c 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu_init.c +++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c @@ -16,6 +16,7 @@ #include "elbc/elbc.h" #include "sysio/sysio.h" #include "arbiter/arbiter.h" +#include "initreg/initreg.h" DECLARE_GLOBAL_DATA_PTR; @@ -52,34 +53,6 @@ static void config_qe_ioports(void) */ void cpu_init_f (volatile immap_t * im) { - __be32 spcr_mask = -#ifdef CONFIG_SYS_SPCR_OPT /* Optimize transactions between CSB and other dev */ - SPCR_OPT | -#endif -#ifdef CONFIG_SYS_SPCR_TSECEP /* all eTSEC's Emergency priority */ - SPCR_TSECEP | -#endif -#ifdef CONFIG_SYS_SPCR_TSEC1EP /* TSEC1 Emergency priority */ - SPCR_TSEC1EP | -#endif -#ifdef CONFIG_SYS_SPCR_TSEC2EP /* TSEC2 Emergency priority */ - SPCR_TSEC2EP | -#endif - 0; - __be32 spcr_val = -#ifdef CONFIG_SYS_SPCR_OPT - (CONFIG_SYS_SPCR_OPT << SPCR_OPT_SHIFT) | -#endif -#ifdef CONFIG_SYS_SPCR_TSECEP /* all eTSEC's Emergency priority */ - (CONFIG_SYS_SPCR_TSECEP << SPCR_TSECEP_SHIFT) | -#endif -#ifdef CONFIG_SYS_SPCR_TSEC1EP /* TSEC1 Emergency priority */ - (CONFIG_SYS_SPCR_TSEC1EP << SPCR_TSEC1EP_SHIFT) | -#endif -#ifdef CONFIG_SYS_SPCR_TSEC2EP /* TSEC2 Emergency priority */ - (CONFIG_SYS_SPCR_TSEC2EP << SPCR_TSEC2EP_SHIFT) | -#endif - 0; __be32 sccr_mask = #ifdef CONFIG_SYS_SCCR_ENCCM /* Encryption clock mode */ SCCR_ENCCM | diff --git a/arch/powerpc/cpu/mpc83xx/initreg/Kconfig b/arch/powerpc/cpu/mpc83xx/initreg/Kconfig new file mode 100644 index 000..82c24891784 --- /dev/null +++ b/arch/powerpc/cpu/mpc83xx/initreg/Kconfig @@ -0,0 +1,5 @@ +menu "Initial register configuration" + +source "arch/powerpc/cpu/mpc83xx/initreg/Kconfig.spcr" + +endmenu diff --git a/arch/powerpc/cpu/mpc83xx/initreg/Kconfig.spcr b/arch/powerpc/cpu/mpc83xx/initreg/Kconfig.spcr new file mode 100644 index 000
[U-Boot] [PATCH v2 54/58] mpc83xx: Get rid of CONFIG_SYS_LBC_*
Except for one counter example, CONFIG_SYS_LBC_LBCR always has a value of either 0x0004 or 0x. CONFIG_SYS_LBC_MRTPR always has the value 0x2000. CONFIG_SYS_LBC_LSDMR_{1,2,4,5} are not set for any mpc83xx board. CONFIG_SYS_LBC_LSRT is set by one board (to 0x3200). To simplify the configuration files, hardcode the setting of these values for mpc83xx. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- board/freescale/mpc8313erdb/sdram.c | 5 +++-- board/freescale/mpc8349emds/mpc8349emds.c | 27 ++- board/ids/ids8313/ids8313.c | 4 ++-- board/sbc8349/sbc8349.c | 25 + board/ve8313/ve8313.c | 4 ++-- include/configs/MPC8308RDB.h | 5 - include/configs/MPC8313ERDB_NAND.h| 10 -- include/configs/MPC8313ERDB_NOR.h | 10 -- include/configs/MPC8315ERDB.h | 6 +- include/configs/MPC8323ERDB.h | 5 - include/configs/MPC832XEMDS.h | 5 - include/configs/MPC8349EMDS.h | 8 include/configs/MPC8349EMDS_SDRAM.h | 8 include/configs/MPC8349ITX.h | 13 - include/configs/MPC837XEMDS.h | 4 include/configs/MPC837XERDB.h | 4 include/configs/caddy2.h | 8 include/configs/hrcon.h | 5 - include/configs/ids8313.h | 9 - include/configs/kmopti2.h | 5 - include/configs/kmsupx5.h | 5 - include/configs/kmtegr1.h | 5 - include/configs/kmtepr2.h | 5 - include/configs/kmvect1.h | 5 - include/configs/mpc8308_p1m.h | 5 - include/configs/sbc8349.h | 8 include/configs/strider.h | 5 - include/configs/suvd3.h | 5 - include/configs/tuge1.h | 5 - include/configs/tuxx1.h | 5 - include/configs/ve8313.h | 7 --- include/configs/vme8349.h | 8 32 files changed, 43 insertions(+), 195 deletions(-) diff --git a/board/freescale/mpc8313erdb/sdram.c b/board/freescale/mpc8313erdb/sdram.c index 090412d4b6c..c8e30a09478 100644 --- a/board/freescale/mpc8313erdb/sdram.c +++ b/board/freescale/mpc8313erdb/sdram.c @@ -109,8 +109,9 @@ int dram_init(void) msize = fixed_sdram(); /* Local Bus setup lbcr and mrtpr */ - lbc->lbcr = CONFIG_SYS_LBC_LBCR; - lbc->mrtpr = CONFIG_SYS_LBC_MRTPR; + lbc->lbcr = (0x0004 | (0xFF << LBCR_BMT_SHIFT) | 0xF); + /* LB refresh timer prescal, 266MHz/32 */ + lbc->mrtpr = 0x2000; sync(); #ifndef CONFIG_SYS_8313ERDB_BROKEN_PMC diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c index cfa2524df6d..334eae25422 100644 --- a/board/freescale/mpc8349emds/mpc8349emds.c +++ b/board/freescale/mpc8349emds/mpc8349emds.c @@ -183,28 +183,36 @@ void sdram_init(void) volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; volatile fsl_lbc_t *lbc = &immap->im_lbc; uint *sdram_addr = (uint *)CONFIG_SYS_LBC_SDRAM_BASE; - + const u32 lsdmr_common = LSDMR_RFEN | LSDMR_BSMA1516 | LSDMR_RFCR8 | +LSDMR_PRETOACT6 | LSDMR_ACTTORW3 | LSDMR_BL8 | +LSDMR_WRC3 | LSDMR_CL3; /* * Setup SDRAM Base and Option Registers, already done in cpu_init.c */ /* setup mtrpt, lsrt and lbcr for LB bus */ - lbc->lbcr = CONFIG_SYS_LBC_LBCR; - lbc->mrtpr = CONFIG_SYS_LBC_MRTPR; - lbc->lsrt = CONFIG_SYS_LBC_LSRT; + lbc->lbcr = 0x; + /* LB refresh timer prescal, 266MHz/32 */ + lbc->mrtpr = 0x2000; + /* LB sdram refresh timer, about 6us */ + lbc->lsrt = 0x3200; asm("sync"); /* * Configure the SDRAM controller Machine Mode Register. */ - lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_5; /* 0x40636733; normal operation */ - lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_1; /* 0x68636733; precharge all the banks */ + /* 0x40636733; normal operation */ + lbc->lsdmr = lsdmr_common | LSDMR_OP_NORMAL; + + /* 0x68636733; precharge all the banks */ + lbc->lsdmr = lsdmr_common | LSDMR_OP_PCHALL; asm("sync"); *sdram_addr = 0xff; udelay(100); - lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_2; /* 0x48636733; auto refresh */ + /* 0x48636733; auto refresh */ + lbc->lsdmr = lsdmr_common | LSDMR_OP_ARFRSH; asm("sync"); /*1 times*/ *sdram_addr = 0xff; @@ -232,12 +240,13 @@ void sdram_init(void) udelay(100); /* 0x58636733; mode register write operation */ - lbc->lsdmr = CONFIG_S
[U-Boot] [PATCH v2 56/58] mpc83xx: Don't define cpu_eth_init for DM eth
Don't use the legacy method of initializing the ethernet controller on MPC83xx when DM is active. Signed-off-by: Mario Six --- v1 -> v2: New in v2 --- arch/powerpc/cpu/mpc83xx/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c index 8a88068fdba..4ea4249aff0 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu.c +++ b/arch/powerpc/cpu/mpc83xx/cpu.c @@ -199,6 +199,7 @@ void watchdog_reset (void) } #endif +#ifndef CONFIG_DM_ETH /* * Initializes on-chip ethernet controllers. * to override, implement board_eth_init() @@ -214,6 +215,7 @@ int cpu_eth_init(bd_t *bis) #endif return 0; } +#endif /* !CONFIG_DM_ETH */ /* * Initializes on-chip MMC controllers. -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] board: allwinner: sun50i-h6: Add Orangepi Lite2 support
On Mon, Nov 05, 2018 at 01:20:40PM +0530, Jagan Teki wrote: > OrangePi Lite2 is Allwinner H6 based open-source SBC, > which support: > - Allwinner H6 Quad-core 64-bit ARM Cortex-A53 > - GPU Mali-T720 > - 1GB LPDDR3 RAM > - AXP805 PMIC > - AP6356S Wifi/BT > - USB 2.0, USB 3.0 Host, OTG > - HDMI port > - 5V/2A DC power supply > > Signed-off-by: Jagan Teki For both patches, Acked-by: Maxime Ripard Thanks! Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v4 0/5] Add support for Pinebook
El sáb, 03-11-2018 a las 17:12 -0700, Vasily Khoruzhick escribió: > On Sat, Nov 3, 2018 at 2:15 PM André Przywara > wrote: > > On 11/3/18 8:19 PM, Vasily Khoruzhick wrote: > > > You need "allwinner" branch from this repo. > > > > I deliberately switched the standard branch away, since everything > > is > > merged in mainline ATF now (including PMIC support). I will post U- > > Boot > > patches to change the instructions soon, but just use the master > > branch > > from the official repo (and report back any issues!): > > https://github.com/ARM-Software/arm-trusted-firmware.git > > > > You might need the latest DT in U-Boot (patches are queued, AFAIK) > > to > > let ATF know about your PMIC requirements. > > Thanks, I just tested it - and my patches work fine with ATF from > official repo. I have just tested with ATF from the official repo and it all works. Thanks Dennis ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v1] dm: Fix typo - missed semicolon
The commit 484fdf5ba058 ("dm: Add support for all targets which requires MANUAL_RELOC") introduces subtle typo, i.e. missed semicolon. Fixes: 484fdf5ba058 ("dm: Add support for all targets which requires MANUAL_RELOC") Cc: Michal Simek Signed-off-by: Andy Shevchenko --- drivers/serial/serial-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index e50f0aa851..665cca85cb 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -423,7 +423,7 @@ static int serial_post_probe(struct udevice *dev) ops->setconfig += gd->reloc_off; #if CONFIG_POST & CONFIG_SYS_POST_UART if (ops->loop) - ops->loop += gd->reloc_off + ops->loop += gd->reloc_off; #endif #endif /* Set the baud rate */ -- 2.19.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] Aquantia: Print information about system interface and firmaware version
Hi Valentin-catalin, There is a typo in your commit title. Regards, Clement On Tue, 30 Oct 2018 at 11:44, Valentin-catalin Neacsu wrote: > > Print information about Aquantia firmware loaded on the phy > Signed-off-by: Valentin Catalin Neacsu > --- > drivers/net/phy/aquantia.c | 21 + > 1 file changed, 21 insertions(+) > > diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c > index 603abb5a7f..eb3950092d 100644 > --- a/drivers/net/phy/aquantia.c > +++ b/drivers/net/phy/aquantia.c > @@ -23,6 +23,11 @@ > > #define AQUANTIA_SYSTEM_INTERFACE_SR 0xe812 > #define AQUANTIA_VENDOR_PROVISIONING_REG 0xC441 > +#define AQUANTIA_FIRMWARE_ID0x20 > +#define AQUANTIA_RESERVED_STATUS0xc885 > +#define AQUANTIA_FIRMWARE_MAJOR_MASK0xff00 > +#define AQUANTIA_FIRMWARE_MINOR_MASK0xff > +#define AQUANTIA_FIRMWARE_BUILD_MASK0xf0 > > #define AQUANTIA_USX_AUTONEG_CONTROL_ENA 0x0008 > #define AQUANTIA_SI_IN_USE_MASK 0x0078 > @@ -31,6 +36,7 @@ > int aquantia_config(struct phy_device *phydev) > { > u32 val = phy_read(phydev, MDIO_MMD_PMAPMD, MII_BMCR); > + u32 reg_val1 = 0; > > if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { > /* 1000BASE-T mode */ > @@ -57,6 +63,11 @@ int aquantia_config(struct phy_device *phydev) > phy_write(phydev, MDIO_MMD_PHYXS, > AQUANTIA_VENDOR_PROVISIONING_REG, > AQUANTIA_USX_AUTONEG_CONTROL_ENA); > + printf("%s: system interface USXGMII\n", > + phydev->dev->name); > + } else { > + printf("%s: system interface XFI\n", > + phydev->dev->name); > } > > } else if (phydev->interface == PHY_INTERFACE_MODE_SGMII_2500) { > @@ -74,6 +85,16 @@ int aquantia_config(struct phy_device *phydev) > val = (val & ~AQUNTIA_SPEED_MSB_MASK) | > AQUNTIA_SPEED_LSB_MASK; > phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR, val); > } > + > + val = phy_read(phydev, MDIO_MMD_VEND1, AQUANTIA_RESERVED_STATUS); > + reg_val1 = phy_read(phydev, MDIO_MMD_VEND1, AQUANTIA_FIRMWARE_ID); > + > + printf("%s: %s Firmware Version %x.%x.%x\n", phydev->dev->name, > + phydev->drv->name, > + (reg_val1 & AQUANTIA_FIRMWARE_MAJOR_MASK) >> 8, > + reg_val1 & AQUANTIA_FIRMWARE_MINOR_MASK, > + (val & AQUANTIA_FIRMWARE_BUILD_MASK) >> 4); > + > return 0; > } > > -- > 2.17.1 > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > https://lists.denx.de/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot