[PATCH 3/3] ARM: omap3: evm: Fix 'fitImage' booting

2022-05-15 Thread Derald D. Woods
This commit sets two additional variables in the default BOOTCOMMAND.
Adding 'boot=mmc' and 'addr_fit=0x8b00' removes the need for a
special 'uEnv.txt' to be created. The 'addr_fit' variable is the key
piece here. It is normally defined as 0x9000, in the macro
DEFAULT_FIT_TI_ARGS. For this OMAP34XX board, 0x8b00 works without
touching other varibles. This was tested with a 'fitImage' created
using the following FIT source:

--
/dts-v1/;

/ {
description = "Simple image with single Linux kernel and FDT blob";
#address-cells = <1>;

images {
kernel {
description = "Linux kernel: omap2plus";
data = /incbin/("./zImage");
type = "kernel";
arch = "arm";
os = "linux";
compression = "none";
load = <0x80008000>;
entry = <0x80008000>;
hash-1 {
algo = "sha256";
};
};
fdt-omap3-evm.dtb {
description = "FDT: omap3-evm.dtb";
data = /incbin/("./omap3-evm.dtb");
type = "flat_dt";
arch = "arm";
compression = "none";
load = <0x8ff0>;
hash-1 {
algo = "sha256";
};
};
};

configurations {
default = "conf-omap3-evm.dtb";
conf-omap3-evm.dtb {
description = "Boot Linux kernel with FDT blob";
kernel = "kernel";
fdt = "fdt-omap3-evm.dtb";
};
};
};
--

Additionally, the default environment is now stored in "uboot.env" on
the FAT partition of MMC '0'.

Fixes: 11e2ab3f0b ("ARM: omap3: evm: Enable booting 'fitImage' with 
DEFAULT_FIT_TI_ARGS")
Signed-off-by: Derald D. Woods 
---
 configs/omap3_evm_defconfig | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 2d8e627171..e2e29e2eb6 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -10,7 +10,7 @@ CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run 
envboot; run distro_bootcmd"
+CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then setenv boot mmc; setenv 
addr_fit 0x8b00; run update_to_fit; run mmcboot; fi; run envboot; run 
distro_bootcmd"
 CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
@@ -48,7 +48,10 @@ CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_SPL_REMOVE_PROPS="clocks clock-names interrupt-parent"
 CONFIG_ENV_OVERWRITE=y
-CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_IS_IN_FAT=y
+CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
-- 
2.36.1



[PATCH 2/3] ARM: omap3: evm: Complete DM_I2C migration

2022-05-15 Thread Derald D. Woods
This commits enables DM_I2C and sets the default bus to 0.

Signed-off-by: Derald D. Woods 
---
 configs/omap3_evm_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index d451e201c7..2d8e627171 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -56,8 +56,8 @@ CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x8200
 CONFIG_GPIO_HOG=y
-CONFIG_SYS_I2C_LEGACY=y
-CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_DM_I2C=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
-- 
2.36.1



[PATCH 1/3] ARM: omap3: evm: Power on MMC when setting up PMIC

2022-05-15 Thread Derald D. Woods
This commit copies the related code changes from the BeagleBoard.

Reference:
- 
https://source.denx.de/u-boot/u-boot/-/commit/848cfe098f59c47a2542385513fb554430b874d6

Signed-off-by: Derald D. Woods 
---
 board/ti/evm/evm.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 96434b3ba0..39b5c706a9 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -159,6 +159,7 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
 int misc_init_r(void)
 {
twl4030_power_init();
+   twl4030_power_mmc_init(0);
 
 #if defined(CONFIG_SMC911X)
setup_net_chip();
@@ -247,10 +248,3 @@ static void reset_net_chip(void)
gpio_set_value(rst_gpio, 1);
 }
 #endif /* CONFIG_SMC911X */
-
-#if defined(CONFIG_MMC)
-void board_mmc_power_init(void)
-{
-   twl4030_power_mmc_init(0);
-}
-#endif /* CONFIG_MMC */
-- 
2.36.1



[PATCH 0/3] Updates for omap3-evm

2022-05-15 Thread Derald D. Woods
This patch set brings omap3-evm inline with similar boards and improves
the ability to boot a 'fitImage' using DEFAULT_FIT_TI_ARGS.

Derald D. Woods (3):
  ARM: omap3: evm: Power on MMC when setting up PMIC
  ARM: omap3: evm: Complete DM_I2C migration
  ARM: omap3: evm: Fix 'fitImage' booting

 board/ti/evm/evm.c  |  8 +---
 configs/omap3_evm_defconfig | 11 +++
 2 files changed, 8 insertions(+), 11 deletions(-)

-- 
2.36.1



[PATCH] ARM: omap3: evm: Enable booting 'fitImage' with DEFAULT_FIT_TI_ARGS

2021-08-01 Thread Derald D. Woods
This commit uses the existing DEFAULT_MMC_TI_ARGS and
DEFAULT_FIT_TI_ARGS defintions to replace the 'mmc*' environment
variables in the configuration. The check for the 'boot_fit' is handled
like the 'am335x_*' boards with 'CONFIG_BOOTCOMMAND'.

Signed-off-by: Derald D. Woods 
---
 configs/omap3_evm_defconfig |  1 +
 include/configs/omap3_evm.h | 45 +
 2 files changed, 6 insertions(+), 40 deletions(-)

diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 4d96505e36..6a6bf64526 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -10,6 +10,7 @@ CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run 
envboot; run distro_bootcmd"
 CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index e2e871a9cb..2ce3c867cb 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -50,9 +50,6 @@
 #endif /* CONFIG_SPL_OS_BOOT */
 #endif /* CONFIG_MTD_RAW_NAND */
 
-#define MEM_LAYOUT_ENV_SETTINGS \
-   DEFAULT_LINUX_BOOT_ENV
-
 #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
"bootcmd_" #devtypel #instance "=" \
"setenv mmcdev " #instance "; " \
@@ -88,8 +85,12 @@
 
 #include 
 
+#include 
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   MEM_LAYOUT_ENV_SETTINGS \
+   DEFAULT_LINUX_BOOT_ENV \
+   DEFAULT_MMC_TI_ARGS \
+   DEFAULT_FIT_TI_ARGS \
"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
@@ -102,42 +103,6 @@
"bootubivol=rootfs\0" \
"bootubipart=rootfs\0" \
"optargs=\0" \
-   "mmcdev=0\0" \
-   "mmcpart=2\0" \
-   "mmcroot=/dev/mmcblk0p2 rw\0" \
-   "mmcrootfstype=ext4 rootwait\0" \
-   "mmcargs=setenv bootargs console=${console} " \
-   "${mtdparts} " \
-   "${optargs} " \
-   "root=${mmcroot} " \
-   "rootfstype=${mmcrootfstype}\0" \
-   "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
-   "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} 
${bootdir}/${bootenv}\0" \
-   "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
-   "env import -t ${loadaddr} ${filesize}\0" \
-   "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
-   "mmc dev ${mmcdev}; " \
-   "if mmc rescan; then " \
-   "run loadbootenv && run importbootenv; " \
-   "run ext4bootenv && run importbootenv; " \
-   "if test -n $uenvcmd; then " \
-   "echo Running uenvcmd ...; " \
-   "run uenvcmd; " \
-   "fi; " \
-   "fi\0" \
-   "loadimage=ext4load mmc ${bootpart} ${loadaddr} 
${bootdir}/${bootfile}\0" \
-   "loaddtb=ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
-   "mmcboot=run mmcbootenv; " \
-   "if run loadimage && run loaddtb; then " \
-   "echo Booting ${bootdir}/${bootfile} from mmc 
${bootpart} ...; " \
-   "run mmcargs; " \
-   "if test ${bootfile} = uImage; then " \
-   "bootm ${loadaddr} - ${fdtaddr}; " \
-   "fi; " \
-   "if test ${bootfile} = zImage; then " \
-   "bootz ${loadaddr} - ${fdtaddr}; " \
-   "fi; " \
-   "fi\0" \
"nandroot=ubi0:rootfs ubi.mtd=rootfs rw noinitrd\0" \
"nandrootfstype=ubifs rootwait\0" \
"nandargs=setenv bootargs console=${console} " \
-- 
2.32.0



Re: [PATCH] configs: am3517_evm: Fix boot hang

2021-06-26 Thread Derald D. Woods
On Sat, Jun 26, 2021 at 08:42:58AM -0500, Adam Ford wrote:
> SPL is really tight on space, so decrease a little memory that we
> allocate in order to fix boot hang.
> 
> Signed-off-by: Adam Ford 
> 
> diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig
> index 0b9bd0e475..9611d33bec 100644
> --- a/configs/am3517_evm_defconfig
> +++ b/configs/am3517_evm_defconfig
> @@ -9,7 +9,7 @@ CONFIG_NR_DRAM_BANKS=2
>  CONFIG_SPL_TEXT_BASE=0x4020
>  CONFIG_TARGET_AM3517_EVM=y
>  CONFIG_EMIF4=y
> -CONFIG_SPL_SYS_MALLOC_F_LEN=0x3000
> +CONFIG_SPL_SYS_MALLOC_F_LEN=0x2500
>  CONFIG_SPL=y
>  CONFIG_DEFAULT_DEVICE_TREE="am3517-evm"
>  CONFIG_LTO=y
> @@ -53,8 +53,6 @@ CONFIG_ENV_IS_IN_NAND=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_BOOTP_SEND_HOSTNAME=y
>  CONFIG_SPL_DM=y
> -CONFIG_SPL_DM_SEQ_ALIAS=y
> -CONFIG_SPL_OF_TRANSLATE=y
>  CONFIG_DM_PCA953X=y
>  CONFIG_MMC_OMAP_HS=y
>  CONFIG_MTD=y
> @@ -84,3 +82,4 @@ CONFIG_USB_MUSB_HOST=y
>  CONFIG_USB_MUSB_AM35X=y
>  CONFIG_BCH=y
>  CONFIG_SPL_TINY_MEMSET=y
> +# CONFIG_EFI_LOADER is not set
> -- 
> 2.25.1
> 

Works for me on Zoom AM3517 eXperimenter.

Tested-by: Derald D. Woods 

Boot Capture


U-Boot SPL 2021.07-rc4-169-g4d8c21da41 (Jun 26 2021 - 18:34:45 -0500)
Trying to boot from MMC1
spl_load_image_fat_os: error reading image args, err - -2


U-Boot 2021.07-rc4-169-g4d8c21da41 (Jun 26 2021 - 18:34:45 -0500)

AM35XX-GP ES2.0, CPU-OPP2, L3-165MHz, Max CPU Clock 600 MHz
Model: TI AM3517 EVM (AM3517/05 TMDSEVM3517)
DRAM:  256 MiB
NAND:  512 MiB
MMC:   OMAP SD/MMC: 0
Loading Environment from FAT... Unable to read "uboot.env" from
mmc0:1... Loading Environment from NAND... OK
In:serial@4902
Out:   serial@4902
Err:   serial@4902
OMAP die ID: 1268000101685a201600f00c
Net:   eth0: ethernet@5c00
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
Failed to load 'uEnv.txt'
Checking if uenvcmd is set ...
Running default loadimage ...
5080632 bytes read in 452 ms (10.7 MiB/s)
61310 bytes read in 8 ms (7.3 MiB/s)
Booting from mmc ...
Kernel image @ 0x8200 [ 0x00 - 0x4d8638 ]
## Flattened Device Tree blob at 82c0
   Booting using the fdt blob at 0x82c0
   Loading Device Tree to 8df25000, end 8df36f7d ... OK

Starting kernel ...

[0.00] Booting Linux on physical CPU 0x0
...

Derald



[PATCH v3] ARM: omap3: evm: Complete DM_ETH and DM_USB migrations

2020-07-18 Thread Derald D. Woods
This commit completes the migrations for DM_ETH and DM_USB. The board
is now consistent with omap3_beagle and other remaining OMAP3 boards.

Cc: Tom Rini 
Cc: Adam Ford 
Signed-off-by: Derald D. Woods 
---
Changes for v3:
- Also handle 37xx 'dtsi' variant
- My testing is with the 3530 processor variant

Changes for v2:
- Add omitted ethernet node to omap3-evm-u-boot.dtsi
  * Based on similar changes found in logicpd-torpedo-35xx-devkit.dtsi
---
 arch/arm/dts/omap3-evm-37xx-u-boot.dtsi | 10 +++
 arch/arm/dts/omap3-evm-u-boot.dtsi  | 10 +++
 arch/arm/mach-omap2/omap3/Kconfig   |  3 +
 board/ti/evm/evm.c  | 82 -
 configs/omap3_evm_defconfig | 14 +++--
 5 files changed, 43 insertions(+), 76 deletions(-)

diff --git a/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi 
b/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
index b9e433f873..97a8141c8a 100644
--- a/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
+++ b/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
@@ -11,4 +11,14 @@
chosen {
stdout-path = 
};
+
+   ethernet@2c00 {
+   compatible = "smsc,lan9221","smsc,lan9115";
+   reg = <0x2c00 0xff>;
+   bank-width = <2>;
+   vddvario-supply = <>;
+   vdd33a-supply = <>;
+   reg-io-width = <4>;
+   smsc,save-mac-address;
+   };
 };
diff --git a/arch/arm/dts/omap3-evm-u-boot.dtsi 
b/arch/arm/dts/omap3-evm-u-boot.dtsi
index b9e433f873..97a8141c8a 100644
--- a/arch/arm/dts/omap3-evm-u-boot.dtsi
+++ b/arch/arm/dts/omap3-evm-u-boot.dtsi
@@ -11,4 +11,14 @@
chosen {
stdout-path = 
};
+
+   ethernet@2c00 {
+   compatible = "smsc,lan9221","smsc,lan9115";
+   reg = <0x2c00 0xff>;
+   bank-width = <2>;
+   vddvario-supply = <>;
+   vdd33a-supply = <>;
+   reg-io-width = <4>;
+   smsc,save-mac-address;
+   };
 };
diff --git a/arch/arm/mach-omap2/omap3/Kconfig 
b/arch/arm/mach-omap2/omap3/Kconfig
index cf11e5707f..0a6eb4cb26 100644
--- a/arch/arm/mach-omap2/omap3/Kconfig
+++ b/arch/arm/mach-omap2/omap3/Kconfig
@@ -61,7 +61,10 @@ config TARGET_OMAP3_EVM
select DM
select DM_GPIO
select DM_SERIAL
+   select OMAP3_GPIO_2
select OMAP3_GPIO_3
+   select OMAP3_GPIO_5
+   select OMAP3_GPIO_6
imply CMD_DM
 
 config TARGET_OMAP3_IGEP00X0
diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 193b3eb576..ecbd843676 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -24,20 +23,17 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include "evm.h"
 
 #define OMAP3EVM_GPIO_ETH_RST_GEN1 64
 #define OMAP3EVM_GPIO_ETH_RST_GEN2 7
 
+#define CONFIG_SMC911X_BASE 0x2C00
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static u32 omap3_evm_version;
@@ -49,7 +45,7 @@ u32 get_omap3_evm_rev(void)
 
 static void omap3_evm_get_revision(void)
 {
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
/*
 * Board revision can be ascertained only by identifying
 * the Ethernet chipset.
@@ -70,7 +66,7 @@ static void omap3_evm_get_revision(void)
default:
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
}
-#else /* !CONFIG_CMD_NET */
+#else /* !CONFIG_SMC911X */
 #if defined(CONFIG_STATIC_BOARD_REV)
/* Look for static defintion of the board revision */
omap3_evm_version = CONFIG_STATIC_BOARD_REV;
@@ -78,7 +74,7 @@ static void omap3_evm_get_revision(void)
/* Fallback to the default above */
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
 #endif /* CONFIG_STATIC_BOARD_REV */
-#endif /* CONFIG_CMD_NET */
+#endif /* CONFIG_SMC911X */
 }
 
 #if defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)
@@ -155,33 +151,6 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
 }
 #endif /* CONFIG_SPL_BUILD */
 
-#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
-static struct musb_hdrc_config musb_config = {
-   .multipoint = 1,
-   .dyn_fifo   = 1,
-   .num_eps= 16,
-   .ram_bits   = 12,
-};
-
-static struct omap_musb_board_data musb_board_data = {
-   .interface_type = MUSB_INTERFACE_ULPI,
-};
-
-static struct musb_hdrc_platform_data musb_plat = {
-#if defined(CONFIG_USB_MUSB_HOST)
-   .mode   = MUSB_HOST,
-#elif defined(CONFIG_USB_MUSB_GADGET)
-   .mode   = MUSB_PERIPHERAL,
-#else
-#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
-#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */
-   .config = _config,
-   .power  = 100,
-   .pla

[PATCH v2] ARM: omap3: evm: Complete DM_ETH and DM_USB migrations

2020-07-18 Thread Derald D. Woods
This commit completes the migrations for DM_ETH and DM_USB. The board
is now consistent with omap3_beagle and other remaining OMAP3 boards.

Cc: Tom Rini 
Cc: Adam Ford 
Signed-off-by: Derald D. Woods 
---
Changes for v2:
- Add omitted ethernet node to omap3-evm-u-boot.dtsi
  * Based on similar changes found in logicpd-torpedo-35xx-devkit.dtsi
---
 arch/arm/dts/omap3-evm-u-boot.dtsi | 10 
 arch/arm/mach-omap2/omap3/Kconfig  |  3 ++
 board/ti/evm/evm.c | 82 --
 configs/omap3_evm_defconfig| 14 +++--
 4 files changed, 33 insertions(+), 76 deletions(-)

diff --git a/arch/arm/dts/omap3-evm-u-boot.dtsi 
b/arch/arm/dts/omap3-evm-u-boot.dtsi
index b9e433f873..97a8141c8a 100644
--- a/arch/arm/dts/omap3-evm-u-boot.dtsi
+++ b/arch/arm/dts/omap3-evm-u-boot.dtsi
@@ -11,4 +11,14 @@
chosen {
stdout-path = 
};
+
+   ethernet@2c00 {
+   compatible = "smsc,lan9221","smsc,lan9115";
+   reg = <0x2c00 0xff>;
+   bank-width = <2>;
+   vddvario-supply = <>;
+   vdd33a-supply = <>;
+   reg-io-width = <4>;
+   smsc,save-mac-address;
+   };
 };
diff --git a/arch/arm/mach-omap2/omap3/Kconfig 
b/arch/arm/mach-omap2/omap3/Kconfig
index cf11e5707f..0a6eb4cb26 100644
--- a/arch/arm/mach-omap2/omap3/Kconfig
+++ b/arch/arm/mach-omap2/omap3/Kconfig
@@ -61,7 +61,10 @@ config TARGET_OMAP3_EVM
select DM
select DM_GPIO
select DM_SERIAL
+   select OMAP3_GPIO_2
select OMAP3_GPIO_3
+   select OMAP3_GPIO_5
+   select OMAP3_GPIO_6
imply CMD_DM
 
 config TARGET_OMAP3_IGEP00X0
diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 193b3eb576..ecbd843676 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -24,20 +23,17 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include "evm.h"
 
 #define OMAP3EVM_GPIO_ETH_RST_GEN1 64
 #define OMAP3EVM_GPIO_ETH_RST_GEN2 7
 
+#define CONFIG_SMC911X_BASE 0x2C00
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static u32 omap3_evm_version;
@@ -49,7 +45,7 @@ u32 get_omap3_evm_rev(void)
 
 static void omap3_evm_get_revision(void)
 {
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
/*
 * Board revision can be ascertained only by identifying
 * the Ethernet chipset.
@@ -70,7 +66,7 @@ static void omap3_evm_get_revision(void)
default:
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
}
-#else /* !CONFIG_CMD_NET */
+#else /* !CONFIG_SMC911X */
 #if defined(CONFIG_STATIC_BOARD_REV)
/* Look for static defintion of the board revision */
omap3_evm_version = CONFIG_STATIC_BOARD_REV;
@@ -78,7 +74,7 @@ static void omap3_evm_get_revision(void)
/* Fallback to the default above */
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
 #endif /* CONFIG_STATIC_BOARD_REV */
-#endif /* CONFIG_CMD_NET */
+#endif /* CONFIG_SMC911X */
 }
 
 #if defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)
@@ -155,33 +151,6 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
 }
 #endif /* CONFIG_SPL_BUILD */
 
-#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
-static struct musb_hdrc_config musb_config = {
-   .multipoint = 1,
-   .dyn_fifo   = 1,
-   .num_eps= 16,
-   .ram_bits   = 12,
-};
-
-static struct omap_musb_board_data musb_board_data = {
-   .interface_type = MUSB_INTERFACE_ULPI,
-};
-
-static struct musb_hdrc_platform_data musb_plat = {
-#if defined(CONFIG_USB_MUSB_HOST)
-   .mode   = MUSB_HOST,
-#elif defined(CONFIG_USB_MUSB_GADGET)
-   .mode   = MUSB_PERIPHERAL,
-#else
-#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
-#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */
-   .config = _config,
-   .power  = 100,
-   .platform_ops   = _ops,
-   .board_data = _board_data,
-};
-#endif /* CONFIG_USB_MUSB_OMAP2PLUS */
-
 /*
  * Routine: misc_init_r
  * Description: Init ethernet (done here so udelay works)
@@ -190,25 +159,18 @@ int misc_init_r(void)
 {
twl4030_power_init();
 
-#ifdef CONFIG_SYS_I2C_OMAP24XX
-   i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-#endif
-
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
setup_net_chip();
 #endif
omap3_evm_get_revision();
 
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
reset_net_chip();
 #endif
omap_die_id_display();
 
-#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
-   musb_register(_plat, _board_data, (void *)MUSB_BASE);
-#endif
-
-#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB

[PATCH] ARM: omap3: evm: Complete DM_ETH and DM_USB migrations

2020-07-18 Thread Derald D. Woods
This commit completes the migrations for DM_ETH and DM_USB. The board
is now consistent with omap3_beagle and other remaining OMAP3 boards.

Cc: Tom Rini 
Cc: Adam Ford 
Signed-off-by: Derald D. Woods 
---
 arch/arm/mach-omap2/omap3/Kconfig |  3 ++
 board/ti/evm/evm.c| 82 +--
 configs/omap3_evm_defconfig   | 14 --
 3 files changed, 23 insertions(+), 76 deletions(-)

diff --git a/arch/arm/mach-omap2/omap3/Kconfig 
b/arch/arm/mach-omap2/omap3/Kconfig
index cf11e5707f..0a6eb4cb26 100644
--- a/arch/arm/mach-omap2/omap3/Kconfig
+++ b/arch/arm/mach-omap2/omap3/Kconfig
@@ -61,7 +61,10 @@ config TARGET_OMAP3_EVM
select DM
select DM_GPIO
select DM_SERIAL
+   select OMAP3_GPIO_2
select OMAP3_GPIO_3
+   select OMAP3_GPIO_5
+   select OMAP3_GPIO_6
imply CMD_DM
 
 config TARGET_OMAP3_IGEP00X0
diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 193b3eb576..ecbd843676 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -24,20 +23,17 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include "evm.h"
 
 #define OMAP3EVM_GPIO_ETH_RST_GEN1 64
 #define OMAP3EVM_GPIO_ETH_RST_GEN2 7
 
+#define CONFIG_SMC911X_BASE 0x2C00
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static u32 omap3_evm_version;
@@ -49,7 +45,7 @@ u32 get_omap3_evm_rev(void)
 
 static void omap3_evm_get_revision(void)
 {
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
/*
 * Board revision can be ascertained only by identifying
 * the Ethernet chipset.
@@ -70,7 +66,7 @@ static void omap3_evm_get_revision(void)
default:
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
}
-#else /* !CONFIG_CMD_NET */
+#else /* !CONFIG_SMC911X */
 #if defined(CONFIG_STATIC_BOARD_REV)
/* Look for static defintion of the board revision */
omap3_evm_version = CONFIG_STATIC_BOARD_REV;
@@ -78,7 +74,7 @@ static void omap3_evm_get_revision(void)
/* Fallback to the default above */
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
 #endif /* CONFIG_STATIC_BOARD_REV */
-#endif /* CONFIG_CMD_NET */
+#endif /* CONFIG_SMC911X */
 }
 
 #if defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)
@@ -155,33 +151,6 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
 }
 #endif /* CONFIG_SPL_BUILD */
 
-#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
-static struct musb_hdrc_config musb_config = {
-   .multipoint = 1,
-   .dyn_fifo   = 1,
-   .num_eps= 16,
-   .ram_bits   = 12,
-};
-
-static struct omap_musb_board_data musb_board_data = {
-   .interface_type = MUSB_INTERFACE_ULPI,
-};
-
-static struct musb_hdrc_platform_data musb_plat = {
-#if defined(CONFIG_USB_MUSB_HOST)
-   .mode   = MUSB_HOST,
-#elif defined(CONFIG_USB_MUSB_GADGET)
-   .mode   = MUSB_PERIPHERAL,
-#else
-#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
-#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */
-   .config = _config,
-   .power  = 100,
-   .platform_ops   = _ops,
-   .board_data = _board_data,
-};
-#endif /* CONFIG_USB_MUSB_OMAP2PLUS */
-
 /*
  * Routine: misc_init_r
  * Description: Init ethernet (done here so udelay works)
@@ -190,25 +159,18 @@ int misc_init_r(void)
 {
twl4030_power_init();
 
-#ifdef CONFIG_SYS_I2C_OMAP24XX
-   i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-#endif
-
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
setup_net_chip();
 #endif
omap3_evm_get_revision();
 
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
reset_net_chip();
 #endif
omap_die_id_display();
 
-#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
-   musb_register(_plat, _board_data, (void *)MUSB_BASE);
-#endif
-
-#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET)
+#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) && \
+   !defined(CONFIG_SMC911X)
omap_die_id_usbethaddr();
 #endif
return 0;
@@ -225,7 +187,7 @@ void set_muxconf_regs(void)
MUX_EVM();
 }
 
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
 /*
  * Routine: setup_net_chip
  * Description: Setting up the configuration GPMC registers specific to the
@@ -283,33 +245,11 @@ static void reset_net_chip(void)
udelay(1);
gpio_set_value(rst_gpio, 1);
 }
-
-int board_eth_init(struct bd_info *bis)
-{
-#if defined(CONFIG_SMC911X)
-   env_set("ethaddr", NULL);
-   return smc911x_initialize(0, CONFIG_SMC911X_BASE);
-#else
-   return 0;
-#endif
-}
-#endif /* CONFIG_CMD_NET */
+#endif /* CONFIG_SMC911X */
 
 #if defin

Re: [PATCH] omap3_beagle: Finish current outstanding DM migrations

2020-07-02 Thread Derald D. Woods
On Wed, Jul 01, 2020 at 08:50:19PM -0400, Tom Rini wrote:
> On Wed, Jul 01, 2020 at 07:17:04PM -0500, Derald D. Woods wrote:
> > On Tue, Jun 30, 2020 at 03:02:27PM -0400, Tom Rini wrote:
> > > At this point in time we can now remove our legacy code and switch to
> > > enabling DM for USB and Ethernet.
> > > 
> > > Cc: Derald D. Woods 
> > > Cc: Adam Ford 
> > > Signed-off-by: Tom Rini 
> > > ---
> > >  board/ti/beagle/beagle.c   | 70 --
> > >  configs/omap3_beagle_defconfig |  5 ++-
> > >  2 files changed, 4 insertions(+), 71 deletions(-)
> > > 
> > > diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
> > > index 9139ad87d400..9ccd566da370 100644
> > > --- a/board/ti/beagle/beagle.c
> > > +++ b/board/ti/beagle/beagle.c
> > > @@ -40,11 +40,6 @@
> > >  #include "beagle.h"
> > >  #include 
> > >  
> > > -#ifdef CONFIG_USB_EHCI_HCD
> > > -#include 
> > > -#include 
> > > -#endif
> > > -
> > >  #define TWL4030_I2C_BUS  0
> > >  #define EXPANSION_EEPROM_I2C_BUS 1
> > >  #define EXPANSION_EEPROM_I2C_ADDRESS 0x50
> > > @@ -297,33 +292,6 @@ static void beagle_dvi_pup(void)
> > >  }
> > >  #endif
> > >  
> > > -#ifdef CONFIG_USB_MUSB_OMAP2PLUS
> > > -static struct musb_hdrc_config musb_config = {
> > > - .multipoint = 1,
> > > - .dyn_fifo   = 1,
> > > - .num_eps= 16,
> > > - .ram_bits   = 12,
> > > -};
> > > -
> > > -static struct omap_musb_board_data musb_board_data = {
> > > - .interface_type = MUSB_INTERFACE_ULPI,
> > > -};
> > > -
> > > -static struct musb_hdrc_platform_data musb_plat = {
> > > -#if defined(CONFIG_USB_MUSB_HOST)
> > > - .mode   = MUSB_HOST,
> > > -#elif defined(CONFIG_USB_MUSB_GADGET)
> > > - .mode   = MUSB_PERIPHERAL,
> > > -#else
> > > -#error "Please define either CONFIG_USB_MUSB_HOST or 
> > > CONFIG_USB_MUSB_GADGET"
> > > -#endif
> > > - .config = _config,
> > > - .power  = 100,
> > > - .platform_ops   = _ops,
> > > - .board_data = _board_data,
> > > -};
> > > -#endif
> > > -
> > >  /*
> > >   * Routine: misc_init_r
> > >   * Description: Configure board specific parts
> > > @@ -506,10 +474,6 @@ int misc_init_r(void)
> > >   omap3_dss_enable();
> > >  #endif
> > >  
> > > -#ifdef CONFIG_USB_MUSB_OMAP2PLUS
> > > - musb_register(_plat, _board_data, (void *)MUSB_BASE);
> > > -#endif
> > > -
> > >   if (generate_fake_mac)
> > >   omap_die_id_usbethaddr();
> > >  
> > > @@ -548,37 +512,3 @@ void board_mmc_power_init(void)
> > >   twl4030_power_mmc_init(0);
> > >  }
> > >  #endif
> > > -
> > > -#if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD)
> > > -/* Call usb_stop() before starting the kernel */
> > > -void show_boot_progress(int val)
> > > -{
> > > - if (val == BOOTSTAGE_ID_RUN_OS)
> > > - usb_stop();
> > > -}
> > > -
> > > -static struct omap_usbhs_board_data usbhs_bdata = {
> > > - .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
> > > - .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
> > > - .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
> > > -};
> > > -
> > > -int ehci_hcd_init(int index, enum usb_init_type init,
> > > - struct ehci_hccr **hccr, struct ehci_hcor **hcor)
> > > -{
> > > - return omap_ehci_hcd_init(index, _bdata, hccr, hcor);
> > > -}
> > > -
> > > -int ehci_hcd_stop(int index)
> > > -{
> > > - return omap_ehci_hcd_stop();
> > > -}
> > > -
> > > -#endif /* CONFIG_USB_EHCI_HCD */
> > > -
> > > -#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET)
> > > -int board_eth_init(bd_t *bis)
> > > -{
> > > - return usb_eth_initialize(bis);
> > > -}
> > > -#endif
> > > diff --git a/configs/omap3_beagle_defconfig 
> > > b/configs/omap3_beagle_defconfig
> > > index ed7cb8f2ff63..b08ffc062d29 100644
> > > --- a/configs/omap3_beagle_defconfig
> > > +++ b/configs/omap3_beagle_defconfig
> > > @@ -3,11 +3,11 @@ CONFIG_ARM=y
> > >  # CONFIG_SPL_USE

Re: [PATCH] omap3_beagle: Finish current outstanding DM migrations

2020-07-02 Thread Derald D. Woods
On Tue, Jun 30, 2020 at 03:02:27PM -0400, Tom Rini wrote:
> At this point in time we can now remove our legacy code and switch to
> enabling DM for USB and Ethernet.
> 
> Cc: Derald D. Woods 
> Cc: Adam Ford 
> Signed-off-by: Tom Rini 
> ---
>  board/ti/beagle/beagle.c   | 70 --
>  configs/omap3_beagle_defconfig |  5 ++-
>  2 files changed, 4 insertions(+), 71 deletions(-)
> 
> diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
> index 9139ad87d400..9ccd566da370 100644
> --- a/board/ti/beagle/beagle.c
> +++ b/board/ti/beagle/beagle.c
> @@ -40,11 +40,6 @@
>  #include "beagle.h"
>  #include 
>  
> -#ifdef CONFIG_USB_EHCI_HCD
> -#include 
> -#include 
> -#endif
> -
>  #define TWL4030_I2C_BUS  0
>  #define EXPANSION_EEPROM_I2C_BUS 1
>  #define EXPANSION_EEPROM_I2C_ADDRESS 0x50
> @@ -297,33 +292,6 @@ static void beagle_dvi_pup(void)
>  }
>  #endif
>  
> -#ifdef CONFIG_USB_MUSB_OMAP2PLUS
> -static struct musb_hdrc_config musb_config = {
> - .multipoint = 1,
> - .dyn_fifo   = 1,
> - .num_eps= 16,
> - .ram_bits   = 12,
> -};
> -
> -static struct omap_musb_board_data musb_board_data = {
> - .interface_type = MUSB_INTERFACE_ULPI,
> -};
> -
> -static struct musb_hdrc_platform_data musb_plat = {
> -#if defined(CONFIG_USB_MUSB_HOST)
> - .mode   = MUSB_HOST,
> -#elif defined(CONFIG_USB_MUSB_GADGET)
> - .mode   = MUSB_PERIPHERAL,
> -#else
> -#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
> -#endif
> - .config = _config,
> - .power  = 100,
> - .platform_ops   = _ops,
> - .board_data = _board_data,
> -};
> -#endif
> -
>  /*
>   * Routine: misc_init_r
>   * Description: Configure board specific parts
> @@ -506,10 +474,6 @@ int misc_init_r(void)
>   omap3_dss_enable();
>  #endif
>  
> -#ifdef CONFIG_USB_MUSB_OMAP2PLUS
> - musb_register(_plat, _board_data, (void *)MUSB_BASE);
> -#endif
> -
>   if (generate_fake_mac)
>   omap_die_id_usbethaddr();
>  
> @@ -548,37 +512,3 @@ void board_mmc_power_init(void)
>   twl4030_power_mmc_init(0);
>  }
>  #endif
> -
> -#if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD)
> -/* Call usb_stop() before starting the kernel */
> -void show_boot_progress(int val)
> -{
> - if (val == BOOTSTAGE_ID_RUN_OS)
> - usb_stop();
> -}
> -
> -static struct omap_usbhs_board_data usbhs_bdata = {
> - .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
> - .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
> - .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
> -};
> -
> -int ehci_hcd_init(int index, enum usb_init_type init,
> - struct ehci_hccr **hccr, struct ehci_hcor **hcor)
> -{
> - return omap_ehci_hcd_init(index, _bdata, hccr, hcor);
> -}
> -
> -int ehci_hcd_stop(int index)
> -{
> - return omap_ehci_hcd_stop();
> -}
> -
> -#endif /* CONFIG_USB_EHCI_HCD */
> -
> -#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET)
> -int board_eth_init(bd_t *bis)
> -{
> - return usb_eth_initialize(bis);
> -}
> -#endif
> diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
> index ed7cb8f2ff63..b08ffc062d29 100644
> --- a/configs/omap3_beagle_defconfig
> +++ b/configs/omap3_beagle_defconfig
> @@ -3,11 +3,11 @@ CONFIG_ARM=y
>  # CONFIG_SPL_USE_ARCH_MEMSET is not set
>  CONFIG_ARCH_OMAP2PLUS=y
>  CONFIG_SYS_MALLOC_F_LEN=0x4000
> +CONFIG_SPL_TEXT_BASE=0x4020
>  CONFIG_TARGET_OMAP3_BEAGLE=y
>  CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
>  CONFIG_NR_DRAM_BANKS=2
>  CONFIG_SPL=y
> -CONFIG_SPL_TEXT_BASE=0x4020
>  CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd"
>  CONFIG_USE_PREBOOT=y
> @@ -73,10 +73,13 @@ CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
>  CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
>  CONFIG_SYS_NAND_U_BOOT_OFFS=0x8
>  CONFIG_SPL_NAND_SIMPLE=y
> +CONFIG_DM_ETH=y
>  CONFIG_SPI=y
>  CONFIG_DM_SPI=y
>  CONFIG_OMAP3_SPI=y
>  CONFIG_USB=y
> +CONFIG_DM_USB=y
> +# CONFIG_SPL_DM_USB is not set
>  CONFIG_USB_EHCI_HCD=y
>  CONFIG_USB_OMAP3=y
>  CONFIG_USB_MUSB_GADGET=y
> -- 
> 2.17.1
> 

I tested this patch on my BeagleBoard Rev. C4 and BeagleBoard xM.

Tested-by: Derald D. Woods 

NOTE:

I did have to perform a 'make menuconfig' and set DM_ETH and DM_USB
manually though. It may be something cached in my build environment. I
mention this because I did perform an additional operation before build.

After first use of defconfig:
---8

Re: [PATCH] omap3_beagle: Change NAND ECC scheme back to OMAP_ECC_HAM1_CODE_HW

2019-12-26 Thread Derald D. Woods
On Thu, Dec 26, 2019 at 10:24:24PM +0100, Patrik Dahlstrom wrote:
> On 12/26/19 10:22 PM, Derald D. Woods wrote:
> > On Thu, Dec 26, 2019 at 02:57:44PM -0600, Adam Ford wrote:
> >> On Thu, Dec 26, 2019 at 12:02 PM Patrik Dahlstrom  
> >> wrote:
> >>>
> >>> On 12/22/19 3:48 PM, Adam Ford wrote:
> >>>> On Sun, Dec 22, 2019 at 8:28 AM Tom Rini  wrote:
> >>>>>
> >>>>> On Sun, Dec 22, 2019 at 08:24:14AM -0600, Derald D. Woods wrote:
> >>>>>> On Sun, Dec 22, 2019 at 09:10:50AM -0500, Tom Rini wrote:
> >>>>>>> On Sun, Dec 22, 2019 at 09:46:27AM +0100, Patrik Dahlstrom wrote:
> >>>>>>>> On 12/22/19 4:24 AM, Derald D. Woods wrote:
> >>>>>>>>> On Sat, Dec 21, 2019 at 05:18:22PM +0100, Patrik Dahlström wrote:
> >>>>>>>>>> The omap3_beagle NAND ECC scheme was changed in 4b37928d357 for 
> >>>>>>>>>> unknown
> >>>>>>>>>> reasons, leading to uncorrectible ecc errors. This commit changes 
> >>>>>>>>>> it
> >>>>>>>>>> back to what it was before.
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Hello Patrick,
> >>>>>>>>>
> >>>>>>>>> Is there a setup/test that you are using for OMAP_ECC_HAM1_CODE_HW? 
> >>>>>>>>> I
> >>>>>>>>> just want to give it a try. I have three OMAP3 boards, with NAND, 
> >>>>>>>>> that
> >>>>>>>>> I would like to test.
> >>>>>>>>
> >>>>>>>> I'm using a BeagleBoard rev. C4 (yes, the one that came out in 2009)
> >>>>>>>> for testing.
> >>>>>>>>
> >>>>>>>>>
> >>>>>>>>> I also see that the SYS_NAND_ECC_BYTES should have been changed to 
> >>>>>>>>> '14'
> >>>>>>>>> per the 'doc/README.nand' for OMAP_ECC_BCH8_CODE_HW_DETECTION_SW. 
> >>>>>>>>> This
> >>>>>>>>> may be the issue with this particular ECC scheme.
> >>>>>>>>>
> >>>>>>>> I based my changes on reverting 4b37928d357, which did this:
> >>>>>>>>
> >>>>>>>> 
> >>>>>>>>  +#define CONFIG_NAND_OMAP_ECCSCHEME  
> >>>>>>>> OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
> >>>>>>>> 
> >>>>>>>>  -#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_HW
> >>>>>>>> 
> >>>>>>>>
> >>>>>>>> Based on your comment, I tested this configuration:
> >>>>>>>>
> >>>>>>>>  #define CONFIG_SYS_NAND_ECCBYTES14
> >>>>>>>>  #define CONFIG_NAND_OMAP_ECCSCHEME  
> >>>>>>>> OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
> >>>>>>>>
> >>>>>>>> It worked to boot from SD card (only had to do saveenv), but only
> >>>>>>>> partly from NAND:
> >>>>>>>>
> >>>>>>>>  U-Boot SPL 2020.01-rc5-6-gda26dd89c8-dirty (Dec 22 2019 - 
> >>>>>>>> 09:26:14 +0100)
> >>>>>>>>  Trying to boot from NAND
> >>>>>>>>
> >>>>>>>> Then it just hangs. Here's how I flashed SPL and U-Boot:
> >>>>>>>>
> >>>>>>>>  mmc rescan
> >>>>>>>>  fatload mmc 0 8000 MLO
> >>>>>>>>  nand erase 0 8
> >>>>>>>>  nandecc hw
> >>>>>>>>  cp.b 8000 8002 2
> >>>>>>>>  cp.b 8000 8004 2
> >>>>>>>>  cp.b 8000 8006 2
> >>>>>>>>  nand write 8000 0 8
> >>>>>>>>  fatload mmc 0 8000 u-boot.img
> >>>>>>>>  nand erase 8 16
> >>>>>>>>  nand write 8000 8 16
> >>>>>>>>
> >>>>>>>> I then tried adjusting the "nandecc hw" line, but here's how t

Re: [PATCH] omap3_beagle: Change NAND ECC scheme back to OMAP_ECC_HAM1_CODE_HW

2019-12-26 Thread Derald D. Woods
On Thu, Dec 26, 2019 at 02:57:44PM -0600, Adam Ford wrote:
> On Thu, Dec 26, 2019 at 12:02 PM Patrik Dahlstrom  
> wrote:
> >
> > On 12/22/19 3:48 PM, Adam Ford wrote:
> > > On Sun, Dec 22, 2019 at 8:28 AM Tom Rini  wrote:
> > >>
> > >> On Sun, Dec 22, 2019 at 08:24:14AM -0600, Derald D. Woods wrote:
> > >>> On Sun, Dec 22, 2019 at 09:10:50AM -0500, Tom Rini wrote:
> > >>>> On Sun, Dec 22, 2019 at 09:46:27AM +0100, Patrik Dahlstrom wrote:
> > >>>>> On 12/22/19 4:24 AM, Derald D. Woods wrote:
> > >>>>>> On Sat, Dec 21, 2019 at 05:18:22PM +0100, Patrik Dahlström wrote:
> > >>>>>>> The omap3_beagle NAND ECC scheme was changed in 4b37928d357 for 
> > >>>>>>> unknown
> > >>>>>>> reasons, leading to uncorrectible ecc errors. This commit changes it
> > >>>>>>> back to what it was before.
> > >>>>>>>
> > >>>>>>
> > >>>>>> Hello Patrick,
> > >>>>>>
> > >>>>>> Is there a setup/test that you are using for OMAP_ECC_HAM1_CODE_HW? I
> > >>>>>> just want to give it a try. I have three OMAP3 boards, with NAND, 
> > >>>>>> that
> > >>>>>> I would like to test.
> > >>>>>
> > >>>>> I'm using a BeagleBoard rev. C4 (yes, the one that came out in 2009)
> > >>>>> for testing.
> > >>>>>
> > >>>>>>
> > >>>>>> I also see that the SYS_NAND_ECC_BYTES should have been changed to 
> > >>>>>> '14'
> > >>>>>> per the 'doc/README.nand' for OMAP_ECC_BCH8_CODE_HW_DETECTION_SW. 
> > >>>>>> This
> > >>>>>> may be the issue with this particular ECC scheme.
> > >>>>>>
> > >>>>> I based my changes on reverting 4b37928d357, which did this:
> > >>>>>
> > >>>>> 
> > >>>>>  +#define CONFIG_NAND_OMAP_ECCSCHEME  
> > >>>>> OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
> > >>>>> 
> > >>>>>  -#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_HW
> > >>>>> 
> > >>>>>
> > >>>>> Based on your comment, I tested this configuration:
> > >>>>>
> > >>>>>  #define CONFIG_SYS_NAND_ECCBYTES14
> > >>>>>  #define CONFIG_NAND_OMAP_ECCSCHEME  
> > >>>>> OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
> > >>>>>
> > >>>>> It worked to boot from SD card (only had to do saveenv), but only
> > >>>>> partly from NAND:
> > >>>>>
> > >>>>>  U-Boot SPL 2020.01-rc5-6-gda26dd89c8-dirty (Dec 22 2019 - 
> > >>>>> 09:26:14 +0100)
> > >>>>>  Trying to boot from NAND
> > >>>>>
> > >>>>> Then it just hangs. Here's how I flashed SPL and U-Boot:
> > >>>>>
> > >>>>>  mmc rescan
> > >>>>>  fatload mmc 0 8000 MLO
> > >>>>>  nand erase 0 8
> > >>>>>  nandecc hw
> > >>>>>  cp.b 8000 8002 2
> > >>>>>  cp.b 8000 8004 2
> > >>>>>  cp.b 8000 8006 2
> > >>>>>  nand write 8000 0 8
> > >>>>>  fatload mmc 0 8000 u-boot.img
> > >>>>>  nand erase 8 16
> > >>>>>  nand write 8000 8 16
> > >>>>>
> > >>>>> I then tried adjusting the "nandecc hw" line, but here's how that 
> > >>>>> went:
> > >>>>>
> > >>>>>  BeagleBoard # nandecc hw bch8
> > >>>>>  nand: error: CONFIG_NAND_OMAP_ELM required for ECC
> > >>>>>
> > >>>>> Unfortunately CONFIG_NAND_OMAP_ELM is not available for OMAP34XX.
> > >>>>
> > >>>> Yeah, ugh, I'm sorry I didn't catch this at the time (my Beagleboard is
> > >>>> old and I worry about killing the NAND but I guess I need to move it to
> > >>>> manual testing a few releases a year).  For the beagleboard I believe
> > >>>> the right answer is to move back 

Re: [PATCH] omap3_beagle: Change NAND ECC scheme back to OMAP_ECC_HAM1_CODE_HW

2019-12-22 Thread Derald D. Woods
On Sun, Dec 22, 2019 at 09:10:50AM -0500, Tom Rini wrote:
> On Sun, Dec 22, 2019 at 09:46:27AM +0100, Patrik Dahlstrom wrote:
> > On 12/22/19 4:24 AM, Derald D. Woods wrote:
> > > On Sat, Dec 21, 2019 at 05:18:22PM +0100, Patrik Dahlström wrote:
> > >> The omap3_beagle NAND ECC scheme was changed in 4b37928d357 for unknown
> > >> reasons, leading to uncorrectible ecc errors. This commit changes it
> > >> back to what it was before.
> > >>
> > > 
> > > Hello Patrick,
> > > 
> > > Is there a setup/test that you are using for OMAP_ECC_HAM1_CODE_HW? I
> > > just want to give it a try. I have three OMAP3 boards, with NAND, that
> > > I would like to test.
> > 
> > I'm using a BeagleBoard rev. C4 (yes, the one that came out in 2009)
> > for testing.
> > 
> > > 
> > > I also see that the SYS_NAND_ECC_BYTES should have been changed to '14'
> > > per the 'doc/README.nand' for OMAP_ECC_BCH8_CODE_HW_DETECTION_SW. This
> > > may be the issue with this particular ECC scheme.
> > > 
> > I based my changes on reverting 4b37928d357, which did this:
> > 
> > 
> >  +#define CONFIG_NAND_OMAP_ECCSCHEME  OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
> > 
> >  -#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_HW
> > 
> > 
> > Based on your comment, I tested this configuration:
> > 
> >  #define CONFIG_SYS_NAND_ECCBYTES14
> >  #define CONFIG_NAND_OMAP_ECCSCHEME  OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
> > 
> > It worked to boot from SD card (only had to do saveenv), but only
> > partly from NAND:
> > 
> >  U-Boot SPL 2020.01-rc5-6-gda26dd89c8-dirty (Dec 22 2019 - 09:26:14 
> > +0100)
> >  Trying to boot from NAND
> > 
> > Then it just hangs. Here's how I flashed SPL and U-Boot:
> > 
> >  mmc rescan
> >  fatload mmc 0 8000 MLO
> >  nand erase 0 8
> >  nandecc hw
> >  cp.b 8000 8002 2
> >  cp.b 8000 8004 2
> >  cp.b 8000 8006 2
> >  nand write 8000 0 8
> >  fatload mmc 0 8000 u-boot.img
> >  nand erase 8 16
> >  nand write 8000 8 16
> > 
> > I then tried adjusting the "nandecc hw" line, but here's how that went:
> > 
> >  BeagleBoard # nandecc hw bch8
> >  nand: error: CONFIG_NAND_OMAP_ELM required for ECC
> > 
> > Unfortunately CONFIG_NAND_OMAP_ELM is not available for OMAP34XX.
> 
> Yeah, ugh, I'm sorry I didn't catch this at the time (my Beagleboard is
> old and I worry about killing the NAND but I guess I need to move it to
> manual testing a few releases a year).  For the beagleboard I believe
> the right answer is to move back to the ECC scheme that it was before as
> that's what's deployed and used by anyone that's using the boards.  If
> memory serves there is a way to switch to doing SW and BCH8 but that's
> not going to be a win for these boards both for speed and for the
> incompatibility.
> 

Tom,

Are you going to modify the remaining affected OMAP34XX boards? Or will this
patchset be expanded?

Derald


Re: [PATCH] omap3_beagle: Change NAND ECC scheme back to OMAP_ECC_HAM1_CODE_HW

2019-12-21 Thread Derald D. Woods
On Sat, Dec 21, 2019 at 05:18:22PM +0100, Patrik Dahlström wrote:
> The omap3_beagle NAND ECC scheme was changed in 4b37928d357 for unknown
> reasons, leading to uncorrectible ecc errors. This commit changes it
> back to what it was before.
> 

Hello Patrick,

Is there a setup/test that you are using for OMAP_ECC_HAM1_CODE_HW? I
just want to give it a try. I have three OMAP3 boards, with NAND, that
I would like to test.

I also see that the SYS_NAND_ECC_BYTES should have been changed to '14'
per the 'doc/README.nand' for OMAP_ECC_BCH8_CODE_HW_DETECTION_SW. This
may be the issue with this particular ECC scheme.

Derald


> Signed-off-by: Patrik Dahlström 
> ---
>  include/configs/omap3_beagle.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
> index 4157d7614f..bc8aa7adf5 100644
> --- a/include/configs/omap3_beagle.h
> +++ b/include/configs/omap3_beagle.h
> @@ -37,7 +37,7 @@
>   10, 11, 12, 13}
>  #define CONFIG_SYS_NAND_ECCSIZE 512
>  #define CONFIG_SYS_NAND_ECCBYTES3
> -#define CONFIG_NAND_OMAP_ECCSCHEME  OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
> +#define CONFIG_NAND_OMAP_ECCSCHEME  OMAP_ECC_HAM1_CODE_HW
>  #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x8
>  #define CONFIG_SYS_ENV_SECT_SIZESZ_128K
>  #define CONFIG_ENV_OVERWRITE
> -- 
> 2.17.1
> 


Re: [U-Boot] [PATCH 3/3] usb: musb-new: omap2430: Fix compilation warning with USB_MUSB_GADGET

2019-05-29 Thread Derald D. Woods
On Wed, May 29, 2019 at 02:17:03PM +0200, Marek Vasut wrote:
> On 5/29/19 1:44 PM, Derald Woods wrote:
> > 
> > 
> > On Wed, 29 May 2019, 05:07 Marek Vasut,  > <mailto:marek.va...@gmail.com>> wrote:
> > 
> > On 5/29/19 3:34 AM, Derald Woods wrote:
> > > On Tue, May 28, 2019 at 7:49 PM Marek Vasut  > <mailto:marek.va...@gmail.com>> wrote:
> > >>
> > >> On 5/29/19 2:00 AM, Derald Woods wrote:
> > >>> On Tue, May 28, 2019 at 6:27 PM Marek Vasut
> > mailto:marek.va...@gmail.com>> wrote:
> > >>>>
> > >>>> On 5/29/19 1:16 AM, Derald Woods wrote:
> >     >>>>> On Tue, May 28, 2019 at 4:16 PM Marek Vasut
> > mailto:marek.va...@gmail.com>> wrote:
> > >>>>>>
> > >>>>>> On 5/28/19 4:22 AM, Derald D. Woods wrote:
> > >>>>>>> This commit addresses the following warning, when _NOT_
> > USB_MUSB_HOST:
> > >>>>>>>
> > >>>>>>> [...]
> > >>>>>>>   CC      drivers/usb/gadget/f_mass_storage.o
> > >>>>>>>   CC      drivers/usb/musb-new/omap2430.o
> > >>>>>>>   CC      drivers/usb/gadget/f_fastboot.o
> > >>>>>>>   CC      env/common.o
> > >>>>>>>   CC      env/env.o
> > >>>>>>>
> > /src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c:
> > In function ‘omap2430_musb_probe’:
> > >>>>>>>
> > 
> > /src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c:239:6:
> > warning: assignment to ‘int’ from ‘struct musb *’ makes integer from
> > pointer without a cast [-Wint-conversion]
> > >>>>>>>   ret = musb_register(>plat,
> > >>>>>>>       ^
> > >>>>>>>   LD      drivers/usb/host/built-in.o
> > >>>>>>>   CC      drivers/usb/gadget/f_sdp.o
> > >>>>>>>   CC      fs/ext4/ext4fs.o
> > >>>>>>> [...]
> > >>>>
> > >>>> Skip to the end first
> > >>>>
> > >>>>>>> Signed-off-by: Derald D. Woods  > <mailto:woods.techni...@gmail.com>>
> > >>>>>>> ---
> > >>>>>>>  drivers/usb/musb-new/omap2430.c | 8 ++--
> > >>>>>>>  1 file changed, 6 insertions(+), 2 deletions(-)
> > >>>>>>>
> > >>>>>>> diff --git a/drivers/usb/musb-new/omap2430.c
> > b/drivers/usb/musb-new/omap2430.c
> > >>>>>>> index 32743aa72c..cca1653f1e 100644
> > >>>>>>> --- a/drivers/usb/musb-new/omap2430.c
> > >>>>>>> +++ b/drivers/usb/musb-new/omap2430.c
> > >>>>>>> @@ -215,11 +215,13 @@ static int omap2430_musb_probe(struct
> > udevice *dev)
> > >>>>>>>  {
> > >>>>>>>  #ifdef CONFIG_USB_MUSB_HOST
> > >>>>>>>       struct musb_host_data *host = dev_get_priv(dev);
> > >>>>>>> +#else
> > >>>>>>> +     struct musb *musbp;
> > >>>>
> > >>>> Drop this hunk
> > >>>>
> > >>>>>>>  #endif
> > >>>>>>>       struct omap2430_musb_platdata *platdata =
> > dev_get_platdata(dev);
> > >>>>>>>       struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
> > >>>>>>>       struct omap_musb_board_data *otg_board_data;
> > >>>>>>> -     int ret;
> > >>>>>>> +     int ret = 0;
> > >>>>>>>       void *base = dev_read_addr_ptr(dev);
> > >>>>>>>
> > >>>>>>>       priv->desc_before_addr = true;
> > >>>>>>> @@ -236,9 +238,11 @@ static int omap2430_musb_probe(struct
> > udevice *dev)
> > >>>>>>>
> > >>>>>>>       ret = musb_lowlevel_init(host);
> > >>>>>>>  #else
> > >>>>>>> -     ret

[U-Boot] [PATCH 3/3] usb: musb-new: omap2430: Fix compilation warning with USB_MUSB_GADGET

2019-05-27 Thread Derald D. Woods
This commit addresses the following warning, when _NOT_ USB_MUSB_HOST:

[...]
  CC  drivers/usb/gadget/f_mass_storage.o
  CC  drivers/usb/musb-new/omap2430.o
  CC  drivers/usb/gadget/f_fastboot.o
  CC  env/common.o
  CC  env/env.o
/src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c: In 
function ‘omap2430_musb_probe’:
/src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c:239:6: 
warning: assignment to ‘int’ from ‘struct musb *’ makes integer from pointer 
without a cast [-Wint-conversion]
  ret = musb_register(>plat,
  ^
  LD  drivers/usb/host/built-in.o
  CC  drivers/usb/gadget/f_sdp.o
  CC  fs/ext4/ext4fs.o
[...]

Signed-off-by: Derald D. Woods 
---
 drivers/usb/musb-new/omap2430.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c
index 32743aa72c..cca1653f1e 100644
--- a/drivers/usb/musb-new/omap2430.c
+++ b/drivers/usb/musb-new/omap2430.c
@@ -215,11 +215,13 @@ static int omap2430_musb_probe(struct udevice *dev)
 {
 #ifdef CONFIG_USB_MUSB_HOST
struct musb_host_data *host = dev_get_priv(dev);
+#else
+   struct musb *musbp;
 #endif
struct omap2430_musb_platdata *platdata = dev_get_platdata(dev);
struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
struct omap_musb_board_data *otg_board_data;
-   int ret;
+   int ret = 0;
void *base = dev_read_addr_ptr(dev);
 
priv->desc_before_addr = true;
@@ -236,9 +238,11 @@ static int omap2430_musb_probe(struct udevice *dev)
 
ret = musb_lowlevel_init(host);
 #else
-   ret = musb_register(>plat,
+   musbp = musb_register(>plat,
  (struct device *)otg_board_data,
  platdata->base);
+   if (IS_ERR_OR_NULL(musbp))
+   return -EINVAL;
 #endif
return ret;
 }
-- 
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/3] ARM: omap3: evm: Enable DM_USB in defconfig

2019-05-27 Thread Derald D. Woods
This addresses the following warning message:

= WARNING ==
This board does not use CONFIG_DM_USB. Please update
the board to use CONFIG_DM_USB before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.


As USB support for older OMAP3 SoC's improves, OMAP3 EVM can be
readily adapted. There is some additional 'gpio-hog' support
needed to fully setup USB in a similar manner to Linux.

Signed-off-by: Derald D. Woods 
---
 board/ti/evm/evm.c  | 31 ---
 configs/omap3_evm_defconfig |  3 +++
 include/configs/omap3_evm.h |  2 --
 3 files changed, 3 insertions(+), 33 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index daecb4af3e..93408047b2 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -30,11 +30,6 @@
 #include 
 #include "evm.h"
 
-#ifdef CONFIG_USB_EHCI_HCD
-#include 
-#include 
-#endif
-
 #define OMAP3EVM_GPIO_ETH_RST_GEN1 64
 #define OMAP3EVM_GPIO_ETH_RST_GEN2 7
 
@@ -307,32 +302,6 @@ void board_mmc_power_init(void)
 }
 #endif /* CONFIG_MMC */
 
-#if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD)
-/* Call usb_stop() before starting the kernel */
-void show_boot_progress(int val)
-{
-   if (val == BOOTSTAGE_ID_RUN_OS)
-   usb_stop();
-}
-
-static struct omap_usbhs_board_data usbhs_bdata = {
-   .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
-   .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-   .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
-};
-
-int ehci_hcd_init(int index, enum usb_init_type init,
-   struct ehci_hccr **hccr, struct ehci_hcor **hcor)
-{
-   return omap_ehci_hcd_init(index, _bdata, hccr, hcor);
-}
-
-int ehci_hcd_stop(int index)
-{
-   return omap_ehci_hcd_stop();
-}
-#endif /* CONFIG_USB_EHCI_HCD */
-
 #if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) && 
!defined(CONFIG_CMD_NET)
 int board_eth_init(bd_t *bis)
 {
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index a3b662db2b..26d0e65589 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -66,7 +66,10 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OMAP3=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
 CONFIG_USB_GADGET=y
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 5b9d8a57e3..082a4edb2b 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -56,8 +56,6 @@
 /* Environment */
 #define CONFIG_ENV_SIZE SZ_128K
 
-#define CONFIG_PREBOOT  "usb start"
-
 #define MEM_LAYOUT_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV
 
-- 
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/3] ARM: dts: omap3-evm: Sync dts(i) files from Linux 5.1.5

2019-05-27 Thread Derald D. Woods
Signed-off-by: Derald D. Woods 
---
 arch/arm/dts/omap3-evm-37xx.dts  |  8 
 arch/arm/dts/omap3-evm-common.dtsi   |  7 +--
 arch/arm/dts/omap3-evm-processor-common.dtsi | 10 +-
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/arch/arm/dts/omap3-evm-37xx.dts b/arch/arm/dts/omap3-evm-37xx.dts
index 5a4ba0aea4..a14303b09a 100644
--- a/arch/arm/dts/omap3-evm-37xx.dts
+++ b/arch/arm/dts/omap3-evm-37xx.dts
@@ -90,19 +90,19 @@
label = "X-Loader";
reg = <0 0x8>;
};
-   partition@0x8 {
+   partition@8 {
label = "U-Boot";
reg = <0x8 0x1c>;
};
-   partition@0x1c {
+   partition@1c {
label = "Environment";
reg = <0x24 0x4>;
};
-   partition@0x28 {
+   partition@28 {
label = "Kernel";
reg = <0x28 0x50>;
};
-   partition@0x78 {
+   partition@78 {
label = "Filesystem";
reg = <0x78 0x1f88>;
};
diff --git a/arch/arm/dts/omap3-evm-common.dtsi 
b/arch/arm/dts/omap3-evm-common.dtsi
index ee64191e41..17c89df6ce 100644
--- a/arch/arm/dts/omap3-evm-common.dtsi
+++ b/arch/arm/dts/omap3-evm-common.dtsi
@@ -122,6 +122,7 @@
 };
 
  {
+   interrupts-extended = < 86 _pmx_core 0x12e>;
vmmc-supply = <_vmmc>;
non-removable;
bus-width = <4>;
@@ -132,8 +133,10 @@
wlcore: wlcore@2 {
compatible = "ti,wl1271";
reg = <2>;
-   interrupt-parent = <>;
-   interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 149 */
+   /* gpio_149 with uart1_rts pad as wakeirq */
+   interrupts-extended = < 21 IRQ_TYPE_EDGE_RISING>,
+ <_pmx_core 0x14e>;
+   interrupt-names = "irq", "wakeup";
ref-clock-frequency = <3840>;
};
 };
diff --git a/arch/arm/dts/omap3-evm-processor-common.dtsi 
b/arch/arm/dts/omap3-evm-processor-common.dtsi
index ce7f42f944..b4109f48ec 100644
--- a/arch/arm/dts/omap3-evm-processor-common.dtsi
+++ b/arch/arm/dts/omap3-evm-processor-common.dtsi
@@ -86,6 +86,10 @@
OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE0) 
/* sdmmc2_dat1.sdmmc2_dat1 */
OMAP3_CORE1_IOPAD(0x2160, PIN_INPUT_PULLUP | MUX_MODE0) 
/* sdmmc2_dat2.sdmmc2_dat2 */
OMAP3_CORE1_IOPAD(0x2162, PIN_INPUT_PULLUP | MUX_MODE0) 
/* sdmmc2_dat3.sdmmc2_dat3 */
+   OMAP3_CORE1_IOPAD(0x2164, PIN_OUTPUT | MUX_MODE1)   
/* sdmmc2_dat4.sdmmc2_dir_dat0 */
+   OMAP3_CORE1_IOPAD(0x2166, PIN_OUTPUT | MUX_MODE1)   
/* sdmmc2_dat5.sdmmc2_dir_dat1 */
+   OMAP3_CORE1_IOPAD(0x2168, PIN_OUTPUT | MUX_MODE1)   
/* sdmmc2_dat6.sdmmc2_dir_cmd */
+   OMAP3_CORE1_IOPAD(0x216a, PIN_INPUT | MUX_MODE1)
/* sdmmc2_dat7.sdmmc2_clkin */
>;
};
 
@@ -127,9 +131,13 @@
>;
};
 
+   /*
+* Note that gpio_150 pulled high with internal pull to prevent wlcore
+* reset on return from off mode in idle.
+*/
wl12xx_gpio: pinmux_wl12xx_gpio {
pinctrl-single,pins = <
-   OMAP3_CORE1_IOPAD(0x2180, PIN_OUTPUT | MUX_MODE4)   
/* uart1_cts.gpio_150 */
+   OMAP3_CORE1_IOPAD(0x2180, PIN_INPUT_PULLUP | MUX_MODE7) 
/* uart1_cts.gpio_150 */
OMAP3_CORE1_IOPAD(0x217e, PIN_INPUT | MUX_MODE4)
/* uart1_rts.gpio_149 */
>;
};
-- 
2.21.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] ARM: at91: Apply PMECC header for NAND_BOOT only

2019-02-16 Thread Derald D. Woods
This commit guards against applying the PMECC header in a non-NAND_BOOT
scenario. This a modified version of a previous patch found here:

https://patchwork.ozlabs.org/patch/1009885/

Now that SPL_GENERATE_ATMEL_PMECC_HEADER has been converted to Kconfig,
this provides an additional guard for building and using the
'atmel_pmecc_params' tool.

Signed-off-by: Derald D. Woods 
---
 scripts/Makefile.spl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 9d5921606e..8732479f39 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -177,10 +177,12 @@ ifeq ($(CONFIG_SYS_SOC),"at91")
 MKIMAGEFLAGS_boot.bin = -T atmelimage
 
 ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y)
+ifeq ($(CONFIG_NAND_BOOT),y)
 MKIMAGEFLAGS_boot.bin += -n $(shell $(obj)/../tools/atmel_pmecc_params)
 
 boot.bin: $(obj)/../tools/atmel_pmecc_params
 endif
+endif
 
 boot.bin: $(obj)/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] omap3_beagle: Update for DM SPL support

2019-02-16 Thread Derald D. Woods
On Sat, Feb 16, 2019 at 04:36:29PM -0500, Tom Rini wrote:
> - Switch to using the omap3-u-boot.dtsi file for needed properties.
> - Remove a few SPL features to free up more SRAM space.
> - Switch CONFIG_SYS_TEXT_BASE to the normal default, we don't need to
>   worry about X-Loader at this point anymore.
> - A few related updates to SPL options as part of switching to DM SPL.
> 
> Signed-off-by: Tom Rini 


For BeagleBoard (Rev. C4) and BeagleBoard-xM (Rev. C):

Tested-by: Derald D. Woods 


> ---
>  arch/arm/dts/omap3-beagle-u-boot.dtsi   | 14 ++
>  arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi | 14 ++
>  arch/arm/dts/omap3-beagle-xm-u-boot.dtsi| 14 ++
>  board/ti/beagle/beagle.c| 12 
>  configs/omap3_beagle_defconfig  | 17 ++---
>  5 files changed, 20 insertions(+), 51 deletions(-)
> 
> diff --git a/arch/arm/dts/omap3-beagle-u-boot.dtsi 
> b/arch/arm/dts/omap3-beagle-u-boot.dtsi
> index 41beaf0900c3..2c03701c896a 100644
> --- a/arch/arm/dts/omap3-beagle-u-boot.dtsi
> +++ b/arch/arm/dts/omap3-beagle-u-boot.dtsi
> @@ -5,20 +5,10 @@
>   * (C) Copyright 2017 Derald D. Woods 
>   */
>  
> +#include "omap3-u-boot.dtsi"
> +
>  / {
>   chosen {
>   stdout-path = 
>   };
>  };
> -
> - {
> - reg-shift = <2>;
> -};
> -
> - {
> - reg-shift = <2>;
> -};
> -
> - {
> - reg-shift = <2>;
> -};
> diff --git a/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi 
> b/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi
> index 41beaf0900c3..2c03701c896a 100644
> --- a/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi
> +++ b/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi
> @@ -5,20 +5,10 @@
>   * (C) Copyright 2017 Derald D. Woods 
>   */
>  
> +#include "omap3-u-boot.dtsi"
> +
>  / {
>   chosen {
>   stdout-path = 
>   };
>  };
> -
> - {
> - reg-shift = <2>;
> -};
> -
> - {
> - reg-shift = <2>;
> -};
> -
> - {
> - reg-shift = <2>;
> -};
> diff --git a/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi 
> b/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi
> index 41beaf0900c3..2c03701c896a 100644
> --- a/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi
> +++ b/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi
> @@ -5,20 +5,10 @@
>   * (C) Copyright 2017 Derald D. Woods 
>   */
>  
> +#include "omap3-u-boot.dtsi"
> +
>  / {
>   chosen {
>   stdout-path = 
>   };
>  };
> -
> - {
> - reg-shift = <2>;
> -};
> -
> - {
> - reg-shift = <2>;
> -};
> -
> - {
> - reg-shift = <2>;
> -};
> diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
> index 826aace3fba2..91e0a4c026de 100644
> --- a/board/ti/beagle/beagle.c
> +++ b/board/ti/beagle/beagle.c
> @@ -71,18 +71,6 @@ static struct {
>   char env_setting[64];
>  } expansion_config;
>  
> -static const struct ns16550_platdata beagle_serial = {
> - .base = OMAP34XX_UART3,
> - .reg_shift = 2,
> - .clock = V_NS16550_CLK,
> - .fcr = UART_FCR_DEFVAL,
> -};
> -
> -U_BOOT_DEVICE(beagle_uart) = {
> - "ns16550_serial",
> - _serial
> -};
> -
>  /*
>   * Routine: board_init
>   * Description: Early hardware init.
> diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
> index e199673207a3..f6d522a5f103 100644
> --- a/configs/omap3_beagle_defconfig
> +++ b/configs/omap3_beagle_defconfig
> @@ -1,17 +1,22 @@
>  CONFIG_ARM=y
> +# CONFIG_SPL_USE_ARCH_MEMCPY is not set
> +# CONFIG_SPL_USE_ARCH_MEMSET is not set
>  CONFIG_ARCH_OMAP2PLUS=y
> -CONFIG_SYS_TEXT_BASE=0x8010
> +CONFIG_SYS_MALLOC_F_LEN=0x4000
>  CONFIG_TARGET_OMAP3_BEAGLE=y
> +CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
>  CONFIG_SPL=y
>  CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_NR_DRAM_BANKS=2
> +CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
>  CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd"
>  CONFIG_SYS_CONSOLE_INFO_QUIET=y
>  CONFIG_DEFAULT_FDT_FILE="omap3-beagle.dtb"
>  CONFIG_VERSION_VARIABLE=y
> +CONFIG_SPL_SYS_MALLOC_SIMPLE=y
> +CONFIG_SPL_SEPARATE_BSS=y
>  # CONFIG_SPL_FS_EXT4 is not set
>  CONFIG_SPL_MTD_SUPPORT=y
> -CONFIG_SPL_OS_BOOT=y
>  CONFIG_SYS_PROMPT="BeagleBoard # "
>  CONFIG_CMD_SPL=y
>  CONFIG_CMD_SPL_NAND_OFS=0x28
> @@ -33,10 +38,16 @@ CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
>  
> CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1920k(u-boot),128k(u-boot-env),128k(dtb),6m(kernel),-(rootfs)"
>  CONFIG_CMD_UBI=y
>  # CONFIG_

[U-Boot] [PATCH] ARM: omap3: evm: Update DM SPL support

2019-02-16 Thread Derald D. Woods
- Switch to using the omap3-u-boot.dtsi file for needed properties
- Enable SPL_OF_CONTROL

This commit is based on the following series:

https://patchwork.ozlabs.org/project/uboot/list/?series=92472
https://patchwork.ozlabs.org/project/uboot/list/?series=92462

Signed-off-by: Derald D. Woods 
---
 arch/arm/dts/omap3-evm-37xx-u-boot.dtsi | 14 ++
 arch/arm/dts/omap3-evm-u-boot.dtsi  | 14 ++
 board/ti/evm/evm.c  | 12 
 configs/omap3_evm_defconfig | 14 +++---
 4 files changed, 15 insertions(+), 39 deletions(-)

diff --git a/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi 
b/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
index de411316d8..b9e433f873 100644
--- a/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
+++ b/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
@@ -5,20 +5,10 @@
  * (C) Copyright 2017 Derald D. Woods 
  */
 
+#include "omap3-u-boot.dtsi"
+
 / {
chosen {
stdout-path = 
};
 };
-
- {
-   reg-shift = <2>;
-};
-
- {
-   reg-shift = <2>;
-};
-
- {
-   reg-shift = <2>;
-};
diff --git a/arch/arm/dts/omap3-evm-u-boot.dtsi 
b/arch/arm/dts/omap3-evm-u-boot.dtsi
index de411316d8..b9e433f873 100644
--- a/arch/arm/dts/omap3-evm-u-boot.dtsi
+++ b/arch/arm/dts/omap3-evm-u-boot.dtsi
@@ -5,20 +5,10 @@
  * (C) Copyright 2017 Derald D. Woods 
  */
 
+#include "omap3-u-boot.dtsi"
+
 / {
chosen {
stdout-path = 
};
 };
-
- {
-   reg-shift = <2>;
-};
-
- {
-   reg-shift = <2>;
-};
-
- {
-   reg-shift = <2>;
-};
diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index c59aff595a..daecb4af3e 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -40,18 +40,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static const struct ns16550_platdata omap3_evm_serial = {
-   .base = OMAP34XX_UART1,
-   .reg_shift = 2,
-   .clock = V_NS16550_CLK,
-   .fcr = UART_FCR_DEFVAL,
-};
-
-U_BOOT_DEVICE(omap3_evm_uart) = {
-   "ns16550_serial",
-   _evm_serial
-};
-
 static u32 omap3_evm_version;
 
 u32 get_omap3_evm_rev(void)
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 22e623381f..aa9928e208 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -1,17 +1,21 @@
 CONFIG_ARM=y
+# CONFIG_SPL_USE_ARCH_MEMCPY is not set
+# CONFIG_SPL_USE_ARCH_MEMSET is not set
 CONFIG_ARCH_OMAP2PLUS=y
-CONFIG_SYS_TEXT_BASE=0x8010
-CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_TARGET_OMAP3_EVM=y
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=2
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_VERSION_VARIABLE=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_SEPARATE_BSS=y
 # CONFIG_SPL_FS_EXT4 is not set
 CONFIG_SPL_MTD_SUPPORT=y
-CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_PROMPT="OMAP3_EVM # "
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x28
@@ -36,9 +40,13 @@ CONFIG_CMD_UBI=y
 # CONFIG_EFI_PARTITION is not set
 CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="omap3-evm"
+CONFIG_OF_SPL_REMOVE_PROPS="clocks clock-names interrupt-parent"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SPL_DM=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_OF_TRANSLATE=y
 # CONFIG_SPL_BLK is not set
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x8200
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] ARM: DTS: omap3-u-boot.dtsi

2019-02-16 Thread Derald D. Woods
On Sat, Feb 16, 2019 at 01:31:23PM -0600, Adam Ford wrote:
> Create generic omap3-u-boot.dtsi file that omap3 based boards
> can include to generate device tree in SPL for booting MLO.
> 
> Credit should go to Tom Rini.
> 
> Signed-off-by: Adam Ford 
> 


For OMAP3-EVM (3530):

Tested-by: Derald D. Woods 


> diff --git a/arch/arm/dts/omap3-u-boot.dtsi b/arch/arm/dts/omap3-u-boot.dtsi
> new file mode 100644
> index 00..32bea6b6d9
> --- /dev/null
> +++ b/arch/arm/dts/omap3-u-boot.dtsi
> @@ -0,0 +1,81 @@
> +/*
> + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + * Based on "omap5-u-boot.dtsi"
> + */
> +
> +/{
> + ocp@6800 {
> + u-boot,dm-spl;
> +
> + bandgap@48002524 {
> + u-boot,dm-spl;
> + };
> + };
> +};
> +
> + {
> + u-boot,dm-spl;
> + reg-shift = <2>;
> +};
> +
> + {
> + u-boot,dm-spl;
> + reg-shift = <2>;
> +};
> +
> + {
> + u-boot,dm-spl;
> + reg-shift = <2>;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> +_core {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> +_conf {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> +
> + {
> + u-boot,dm-spl;
> +};
> -- 
> 2.17.1
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] ARM: omap3_logic: Enable SPL booting device tree

2019-02-16 Thread Derald D. Woods
On Sat, Feb 16, 2019 at 04:22:44PM -0500, Tom Rini wrote:
> On Sat, Feb 16, 2019 at 03:08:02PM -0600, Derald D. Woods wrote:
> > On Sat, Feb 16, 2019 at 03:49:01PM -0500, Tom Rini wrote:
> > > On Sat, Feb 16, 2019 at 01:31:24PM -0600, Adam Ford wrote:
> > > 
> > > > With the generic omap3-u-boot.dtsi file available, this patch
> > > > increased the memory of the various incarnations of the omap3_logic
> > > > board, and points their respective u-boot.dtsi files to the newly
> > > > created generic one, and removes the PLATDATA from the board file.
> > > > 
> > > > These are all done at once because the're all utilizing the same
> > > > omap3logic.c board file.
> > > > 
> > > > Signed-off-by: Adam Ford 
> > > 
> > > Ah-haha!  Thank you!  I also needed to delete the platform data and then
> > > beagleboard is also booting.
> > > 
> > 
> > Can we get a quick summary of the conversion steps? My omap3-evm did not
> > get a serial console when applying patch[1] and using example
> > modifications from patch[2].
> 
> I'm cleaning up Beagle now but:
> - Switch to using the new omap3-u-boot.dtsi
> - Remove all platdata from the board files
> - These are a must:
> CONFIG_SYS_MALLOC_F_LEN=0x4000
> CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
> CONFIG_SPL_SYS_MALLOC_SIMPLE=y
> CONFIG_SPL_SEPARATE_BSS=y
> CONFIG_SPL_OF_CONTROL=y
> CONFIG_SPL_DM_SEQ_ALIAS=y
> CONFIG_SPL_OF_TRANSLATE=y
> 

Success. I followed the example of your recent beagleboard patch and can
now boot as described. I will push a patch after a clean build of the
default config for the OMAP3-EVM. 

Thanks.

Derald

> And we tend to drop falcon mode due to size, but could find other things
> instead.
> 
> -- 
> Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] ARM: omap3_logic: Enable SPL booting device tree

2019-02-16 Thread Derald D. Woods
On Sat, Feb 16, 2019 at 03:49:01PM -0500, Tom Rini wrote:
> On Sat, Feb 16, 2019 at 01:31:24PM -0600, Adam Ford wrote:
> 
> > With the generic omap3-u-boot.dtsi file available, this patch
> > increased the memory of the various incarnations of the omap3_logic
> > board, and points their respective u-boot.dtsi files to the newly
> > created generic one, and removes the PLATDATA from the board file.
> > 
> > These are all done at once because the're all utilizing the same
> > omap3logic.c board file.
> > 
> > Signed-off-by: Adam Ford 
> 
> Ah-haha!  Thank you!  I also needed to delete the platform data and then
> beagleboard is also booting.
> 

Can we get a quick summary of the conversion steps? My omap3-evm did not
get a serial console when applying patch[1] and using example
modifications from patch[2].

Derald

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 1/1] ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig

2019-01-19 Thread Derald D. Woods
This commit converts the following items to Kconfig:

CONFIG_ATMEL_NAND_HWECC
CONFIG_ATMEL_NAND_HW_PMECC
CONFIG_PMECC_CAP
CONFIG_PMECC_SECTOR_SIZE
CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER

Config files not explicitly containing the name *nandflash* will have
PMECC disabled. PMECC support requires that a header be applied to
"boot.bin". The generated PMECC "boot.bin" is intended for NAND media.

[PMECC References]
https://www.at91.com/linux4sam/bin/view/Linux4SAM/PmeccConfigure
https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap

[Mailing List Thread]
https://lists.denx.de/pipermail/u-boot/2018-December/350666.html

Fixes: 5541543f ("configs: at91: Remove CONFIG_SYS_EXTRA_OPTIONS assignment")
Reported-by: Daniel Evans 
Cc: Eugen Hristev 
Signed-off-by: Derald D. Woods 
---
 configs/at91sam9n12ek_mmc_defconfig  |  1 +
 configs/at91sam9n12ek_nandflash_defconfig|  3 ++
 configs/at91sam9n12ek_spiflash_defconfig |  1 +
 configs/at91sam9x5ek_dataflash_defconfig |  1 +
 configs/at91sam9x5ek_mmc_defconfig   |  1 +
 configs/at91sam9x5ek_nandflash_defconfig |  3 ++
 configs/at91sam9x5ek_spiflash_defconfig  |  1 +
 configs/sama5d2_ptc_ek_mmc_defconfig |  1 +
 configs/sama5d2_ptc_ek_nandflash_defconfig   |  1 +
 configs/sama5d3_xplained_mmc_defconfig   |  1 +
 configs/sama5d3_xplained_nandflash_defconfig |  3 ++
 configs/sama5d3xek_mmc_defconfig |  1 +
 configs/sama5d3xek_nandflash_defconfig   |  3 ++
 configs/sama5d3xek_spiflash_defconfig|  1 +
 configs/sama5d4_xplained_mmc_defconfig   |  1 +
 configs/sama5d4_xplained_nandflash_defconfig |  3 ++
 configs/sama5d4_xplained_spiflash_defconfig  |  1 +
 configs/sama5d4ek_mmc_defconfig  |  1 +
 configs/sama5d4ek_nandflash_defconfig|  3 ++
 configs/sama5d4ek_spiflash_defconfig |  1 +
 configs/wb45n_defconfig  |  3 ++
 configs/wb50n_defconfig  |  3 ++
 doc/README.atmel_pmecc   | 13 +++
 drivers/mtd/nand/raw/Kconfig | 39 
 include/configs/at91sam9n12ek.h  |  7 
 include/configs/at91sam9x5ek.h   |  7 
 include/configs/sama5d2_ptc_ek.h | 15 ++--
 include/configs/sama5d3_xplained.h   |  7 
 include/configs/sama5d3xek.h |  7 
 include/configs/sama5d4_xplained.h   |  6 ---
 include/configs/sama5d4ek.h  |  6 ---
 include/configs/wb45n.h  |  7 
 include/configs/wb50n.h  |  6 ---
 scripts/config_whitelist.txt |  5 ---
 34 files changed, 95 insertions(+), 68 deletions(-)

---
v3:
- Added sama5d2_ptc_ek board which also defines ATMEL_NAND_HW_PMECC

v2:
- Make ATMEL_NAND_HW_PMECC dependent on ATMEL_NAND_HWECC
- Make SPL_GENERATE_ATMEL_PMECC_HEADER dependent on NAND_BOOT
- Remove PMECC from non-NAND_BOOT configs

diff --git a/configs/at91sam9n12ek_mmc_defconfig 
b/configs/at91sam9n12ek_mmc_defconfig
index 6b2cfe9c42..7b46eb498d 100644
--- a/configs/at91sam9n12ek_mmc_defconfig
+++ b/configs/at91sam9n12ek_mmc_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9N12EK=y
+# CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER is not set
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9n12ek_nandflash_defconfig 
b/configs/at91sam9n12ek_nandflash_defconfig
index 354c24ff16..4e34a517fd 100644
--- a/configs/at91sam9n12ek_nandflash_defconfig
+++ b/configs/at91sam9n12ek_nandflash_defconfig
@@ -2,6 +2,9 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9N12EK=y
+CONFIG_PMECC_CAP=2
+CONFIG_PMECC_SECTOR_SIZE=512
+CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9n12ek_spiflash_defconfig 
b/configs/at91sam9n12ek_spiflash_defconfig
index 63889355bf..7ba1d167e7 100644
--- a/configs/at91sam9n12ek_spiflash_defconfig
+++ b/configs/at91sam9n12ek_spiflash_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9N12EK=y
+# CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER is not set
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9x5ek_dataflash_defconfig 
b/configs/at91sam9x5ek_dataflash_defconfig
index dc13509715..1aa6ce7185 100644
--- a/configs/at91sam9x5ek_dataflash_defconfig
+++ b/configs/at91sam9x5ek_dataflash_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9X5EK=y
+# CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER is not set
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/conf

[U-Boot] [PATCH v2 0/1] ARM: at91: NAND PMECC Kconfig conversion

2019-01-19 Thread Derald D. Woods
This series converts to SPL_GENERATE_ATMEL_PMECC_HEADER Kconfig. The
focus is Kconfig conversion and clean build for the affected boards.

Derald D. Woods (1):
  ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig

 configs/at91sam9n12ek_mmc_defconfig  |  1 +
 configs/at91sam9n12ek_nandflash_defconfig|  3 ++
 configs/at91sam9n12ek_spiflash_defconfig |  1 +
 configs/at91sam9x5ek_dataflash_defconfig |  1 +
 configs/at91sam9x5ek_mmc_defconfig   |  1 +
 configs/at91sam9x5ek_nandflash_defconfig |  3 ++
 configs/at91sam9x5ek_spiflash_defconfig  |  1 +
 configs/sama5d2_ptc_ek_mmc_defconfig |  1 +
 configs/sama5d2_ptc_ek_nandflash_defconfig   |  1 +
 configs/sama5d3_xplained_mmc_defconfig   |  1 +
 configs/sama5d3_xplained_nandflash_defconfig |  3 ++
 configs/sama5d3xek_mmc_defconfig |  1 +
 configs/sama5d3xek_nandflash_defconfig   |  3 ++
 configs/sama5d3xek_spiflash_defconfig|  1 +
 configs/sama5d4_xplained_mmc_defconfig   |  1 +
 configs/sama5d4_xplained_nandflash_defconfig |  3 ++
 configs/sama5d4_xplained_spiflash_defconfig  |  1 +
 configs/sama5d4ek_mmc_defconfig  |  1 +
 configs/sama5d4ek_nandflash_defconfig|  3 ++
 configs/sama5d4ek_spiflash_defconfig |  1 +
 configs/wb45n_defconfig  |  3 ++
 configs/wb50n_defconfig  |  3 ++
 doc/README.atmel_pmecc   | 13 +++
 drivers/mtd/nand/raw/Kconfig | 39 
 include/configs/at91sam9n12ek.h  |  7 
 include/configs/at91sam9x5ek.h   |  7 
 include/configs/sama5d2_ptc_ek.h | 15 ++--
 include/configs/sama5d3_xplained.h   |  7 
 include/configs/sama5d3xek.h |  7 
 include/configs/sama5d4_xplained.h   |  6 ---
 include/configs/sama5d4ek.h  |  6 ---
 include/configs/wb45n.h  |  7 
 include/configs/wb50n.h  |  6 ---
 scripts/config_whitelist.txt |  5 ---
 34 files changed, 95 insertions(+), 68 deletions(-)

---
v2:
- Dropped SYS_NAND_ECC_BASE patch due to multiple config failures
- Added sama5d2_ptc_ek board which also defines ATMEL_NAND_HW_PMECC

-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/2] nand: atmel: Replace SYS_NAND_ECC_BASE with ATMEL_BASE_ECC

2019-01-19 Thread Derald D. Woods
This commit removes remaining uses of SYS_NAND_ECC_BASE. Including
"" in "drivers/mtd/nand/raw/atmel_nand.c" provides
access to ATMEL_BASE_ECC.

Cc: Simon Glass 
Signed-off-by: Derald D. Woods 
---
 drivers/mtd/nand/raw/atmel_nand.c | 19 ++-
 include/configs/snapper9g45.h |  1 -
 scripts/config_whitelist.txt  |  1 -
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/nand/raw/atmel_nand.c 
b/drivers/mtd/nand/raw/atmel_nand.c
index 31ad2cfa88..0563472b9d 100644
--- a/drivers/mtd/nand/raw/atmel_nand.c
+++ b/drivers/mtd/nand/raw/atmel_nand.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -995,13 +996,13 @@ static int atmel_nand_calculate(struct mtd_info *mtd,
unsigned int ecc_value;
 
/* get the first 2 ECC bytes */
-   ecc_value = ecc_readl(CONFIG_SYS_NAND_ECC_BASE, PR);
+   ecc_value = ecc_readl(ATMEL_BASE_ECC, PR);
 
ecc_code[0] = ecc_value & 0xFF;
ecc_code[1] = (ecc_value >> 8) & 0xFF;
 
/* get the last 2 ECC bytes */
-   ecc_value = ecc_readl(CONFIG_SYS_NAND_ECC_BASE, NPR) & 
ATMEL_ECC_NPARITY;
+   ecc_value = ecc_readl(ATMEL_BASE_ECC, NPR) & ATMEL_ECC_NPARITY;
 
ecc_code[2] = ecc_value & 0xFF;
ecc_code[3] = (ecc_value >> 8) & 0xFF;
@@ -1084,16 +1085,16 @@ static int atmel_nand_correct(struct mtd_info *mtd, 
u_char *dat,
unsigned int ecc_word, ecc_bit;
 
/* get the status from the Status Register */
-   ecc_status = ecc_readl(CONFIG_SYS_NAND_ECC_BASE, SR);
+   ecc_status = ecc_readl(ATMEL_BASE_ECC, SR);
 
/* if there's no error */
if (likely(!(ecc_status & ATMEL_ECC_RECERR)))
return 0;
 
/* get error bit offset (4 bits) */
-   ecc_bit = ecc_readl(CONFIG_SYS_NAND_ECC_BASE, PR) & ATMEL_ECC_BITADDR;
+   ecc_bit = ecc_readl(ATMEL_BASE_ECC, PR) & ATMEL_ECC_BITADDR;
/* get word address (12 bits) */
-   ecc_word = ecc_readl(CONFIG_SYS_NAND_ECC_BASE, PR) & ATMEL_ECC_WORDADDR;
+   ecc_word = ecc_readl(ATMEL_BASE_ECC, PR) & ATMEL_ECC_WORDADDR;
ecc_word >>= 4;
 
/* if there are multiple errors */
@@ -1164,22 +1165,22 @@ int atmel_hwecc_nand_init_param(struct nand_chip *nand, 
struct mtd_info *mtd)
switch (mtd->writesize) {
case 512:
nand->ecc.layout = _oobinfo_small;
-   ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+   ecc_writel(ATMEL_BASE_ECC, MR,
ATMEL_ECC_PAGESIZE_528);
break;
case 1024:
nand->ecc.layout = _oobinfo_large;
-   ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+   ecc_writel(ATMEL_BASE_ECC, MR,
ATMEL_ECC_PAGESIZE_1056);
break;
case 2048:
nand->ecc.layout = _oobinfo_large;
-   ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+   ecc_writel(ATMEL_BASE_ECC, MR,
ATMEL_ECC_PAGESIZE_2112);
break;
case 4096:
nand->ecc.layout = _oobinfo_large;
-   ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+   ecc_writel(ATMEL_BASE_ECC, MR,
ATMEL_ECC_PAGESIZE_4224);
break;
default:
diff --git a/include/configs/snapper9g45.h b/include/configs/snapper9g45.h
index f2c47dabc5..4b384641d1 100644
--- a/include/configs/snapper9g45.h
+++ b/include/configs/snapper9g45.h
@@ -36,7 +36,6 @@
 
 /* NAND Flash */
 #define CONFIG_ATMEL_NAND_HWECC
-#define CONFIG_SYS_NAND_ECC_BASE   ATMEL_BASE_ECC
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
 #define CONFIG_SYS_NAND_BASE   ATMEL_BASE_CS3
 #define CONFIG_SYS_NAND_DBW_8
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index e2c2889acf..6fee575a43 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -3543,7 +3543,6 @@ CONFIG_SYS_NAND_ECCPOS
 CONFIG_SYS_NAND_ECCSIZE
 CONFIG_SYS_NAND_ECCSTEPS
 CONFIG_SYS_NAND_ECCTOTAL
-CONFIG_SYS_NAND_ECC_BASE
 CONFIG_SYS_NAND_ENABLE_PIN
 CONFIG_SYS_NAND_ENABLE_PIN_SPL
 CONFIG_SYS_NAND_FTIM0
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig

2019-01-19 Thread Derald D. Woods
This commit converts the following items to Kconfig:

CONFIG_ATMEL_NAND_HWECC
CONFIG_ATMEL_NAND_HW_PMECC
CONFIG_PMECC_CAP
CONFIG_PMECC_SECTOR_SIZE
CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER

Config files not explicitly containing the name *nandflash* will have
PMECC disabled. PMECC support requires that a header be applied to
"boot.bin". The generated PMECC "boot.bin" is intended for NAND media.

[PMECC References]
https://www.at91.com/linux4sam/bin/view/Linux4SAM/PmeccConfigure
https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap

[Mailing List Thread]
https://lists.denx.de/pipermail/u-boot/2018-December/350666.html

Fixes: 5541543f ("configs: at91: Remove CONFIG_SYS_EXTRA_OPTIONS assignment")
Reported-by: Daniel Evans 
Cc: Eugen Hristev 
Signed-off-by: Derald D. Woods 
---
v2:
- Make ATMEL_NAND_HW_PMECC dependent on ATMEL_NAND_HWECC
- Make SPL_GENERATE_ATMEL_PMECC_HEADER dependent on NAND_BOOT
- Remove PMECC from non-NAND_BOOT configs

---
 configs/at91sam9n12ek_mmc_defconfig  |  1 +
 configs/at91sam9n12ek_nandflash_defconfig|  3 ++
 configs/at91sam9n12ek_spiflash_defconfig |  1 +
 configs/at91sam9x5ek_dataflash_defconfig |  1 +
 configs/at91sam9x5ek_mmc_defconfig   |  1 +
 configs/at91sam9x5ek_nandflash_defconfig |  3 ++
 configs/at91sam9x5ek_spiflash_defconfig  |  1 +
 configs/sama5d3_xplained_mmc_defconfig   |  1 +
 configs/sama5d3_xplained_nandflash_defconfig |  3 ++
 configs/sama5d3xek_mmc_defconfig |  1 +
 configs/sama5d3xek_nandflash_defconfig   |  3 ++
 configs/sama5d3xek_spiflash_defconfig|  1 +
 configs/sama5d4_xplained_mmc_defconfig   |  1 +
 configs/sama5d4_xplained_nandflash_defconfig |  3 ++
 configs/sama5d4_xplained_spiflash_defconfig  |  1 +
 configs/sama5d4ek_mmc_defconfig  |  1 +
 configs/sama5d4ek_nandflash_defconfig|  3 ++
 configs/sama5d4ek_spiflash_defconfig |  1 +
 configs/wb45n_defconfig  |  3 ++
 configs/wb50n_defconfig  |  3 ++
 doc/README.atmel_pmecc   | 13 +++
 drivers/mtd/nand/raw/Kconfig | 39 
 include/configs/at91sam9n12ek.h  |  7 
 include/configs/at91sam9x5ek.h   |  7 
 include/configs/sama5d3_xplained.h   |  7 
 include/configs/sama5d3xek.h |  7 
 include/configs/sama5d4_xplained.h   |  6 ---
 include/configs/sama5d4ek.h  |  6 ---
 include/configs/wb45n.h  |  7 
 include/configs/wb50n.h  |  6 ---
 scripts/config_whitelist.txt |  5 ---
 31 files changed, 81 insertions(+), 65 deletions(-)

diff --git a/configs/at91sam9n12ek_mmc_defconfig 
b/configs/at91sam9n12ek_mmc_defconfig
index 6b2cfe9c42..7b46eb498d 100644
--- a/configs/at91sam9n12ek_mmc_defconfig
+++ b/configs/at91sam9n12ek_mmc_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9N12EK=y
+# CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER is not set
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9n12ek_nandflash_defconfig 
b/configs/at91sam9n12ek_nandflash_defconfig
index 354c24ff16..4e34a517fd 100644
--- a/configs/at91sam9n12ek_nandflash_defconfig
+++ b/configs/at91sam9n12ek_nandflash_defconfig
@@ -2,6 +2,9 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9N12EK=y
+CONFIG_PMECC_CAP=2
+CONFIG_PMECC_SECTOR_SIZE=512
+CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9n12ek_spiflash_defconfig 
b/configs/at91sam9n12ek_spiflash_defconfig
index 63889355bf..7ba1d167e7 100644
--- a/configs/at91sam9n12ek_spiflash_defconfig
+++ b/configs/at91sam9n12ek_spiflash_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9N12EK=y
+# CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER is not set
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9x5ek_dataflash_defconfig 
b/configs/at91sam9x5ek_dataflash_defconfig
index dc13509715..1aa6ce7185 100644
--- a/configs/at91sam9x5ek_dataflash_defconfig
+++ b/configs/at91sam9x5ek_dataflash_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9X5EK=y
+# CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER is not set
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9x5ek_mmc_defconfig 
b/configs/at91sam9x5ek_mmc_defconfig
index ff86f93e61..75f7fbd199 100644
--- a/configs/at91sam9x5ek_mmc_defconfig
+++ b/configs/at91sam9x5ek_mmc_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 C

[U-Boot] [PATCH 0/2] ARM: at91: NAND PMECC Kconfig conversion

2019-01-19 Thread Derald D. Woods
This series converts to SPL_GENERATE_ATMEL_PMECC_HEADER Kconfig. The
focus is Kconfig conversion and clean build for the affected boards.

Derald D. Woods (2):
  nand: atmel: Replace SYS_NAND_ECC_BASE with ATMEL_BASE_ECC
  ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig

 configs/at91sam9n12ek_mmc_defconfig  |  1 +
 configs/at91sam9n12ek_nandflash_defconfig|  3 ++
 configs/at91sam9n12ek_spiflash_defconfig |  1 +
 configs/at91sam9x5ek_dataflash_defconfig |  1 +
 configs/at91sam9x5ek_mmc_defconfig   |  1 +
 configs/at91sam9x5ek_nandflash_defconfig |  3 ++
 configs/at91sam9x5ek_spiflash_defconfig  |  1 +
 configs/sama5d3_xplained_mmc_defconfig   |  1 +
 configs/sama5d3_xplained_nandflash_defconfig |  3 ++
 configs/sama5d3xek_mmc_defconfig |  1 +
 configs/sama5d3xek_nandflash_defconfig   |  3 ++
 configs/sama5d3xek_spiflash_defconfig|  1 +
 configs/sama5d4_xplained_mmc_defconfig   |  1 +
 configs/sama5d4_xplained_nandflash_defconfig |  3 ++
 configs/sama5d4_xplained_spiflash_defconfig  |  1 +
 configs/sama5d4ek_mmc_defconfig  |  1 +
 configs/sama5d4ek_nandflash_defconfig|  3 ++
 configs/sama5d4ek_spiflash_defconfig |  1 +
 configs/wb45n_defconfig  |  3 ++
 configs/wb50n_defconfig  |  3 ++
 doc/README.atmel_pmecc   | 13 +++
 drivers/mtd/nand/raw/Kconfig | 39 
 drivers/mtd/nand/raw/atmel_nand.c| 19 +-
 include/configs/at91sam9n12ek.h  |  7 
 include/configs/at91sam9x5ek.h   |  7 
 include/configs/sama5d3_xplained.h   |  7 
 include/configs/sama5d3xek.h |  7 
 include/configs/sama5d4_xplained.h   |  6 ---
 include/configs/sama5d4ek.h  |  6 ---
 include/configs/snapper9g45.h|  1 -
 include/configs/wb45n.h  |  7 
 include/configs/wb50n.h  |  6 ---
 scripts/config_whitelist.txt |  6 ---
 33 files changed, 91 insertions(+), 76 deletions(-)

-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig

2019-01-18 Thread Derald D. Woods
On Fri, Jan 18, 2019 at 08:37:48AM +, eugen.hris...@microchip.com wrote:
> 
> 
> On 11.01.2019 18:53, Derald Woods wrote:
> > 
> > 
> > On Fri, Jan 11, 2019, 10:51 AM Derald Woods  > <mailto:woods.techni...@gmail.com> wrote:
> > 
> > 
> > On Fri, Jan 11, 2019, 5:27 AM  > <mailto:eugen.hris...@microchip.com> wrote:
> > 
> > 
> > 
> > On 10.01.2019 03:00, Derald Woods wrote:
> >  > On Mon, Jan 7, 2019 at 3:40 AM  > <mailto:eugen.hris...@microchip.com>
> >  > <mailto:eugen.hris...@microchip.com
> > <mailto:eugen.hris...@microchip.com>>> wrote:
> >  >
> >  >     Hi Derald,
> >  >
> >  >     Thank you for the patch,
> >  >
> >  >     Some minor questions inline.
> >  >
> >  >
> >  >
> >  > Sorry for the late response. Family and day job take priority.
> >  >
> >  > The patch is the simplest technical conversion that I could
> > produce with
> >  > my board (SAMA5D3-XPLD) as the test platform. I was very
> > careful not to
> >  > touch anything unrelated. It is not intended to address
> > permutations
> >  > outside of the PMECC Kconfig scope. I have submitted these
> > type of
> >  > conversions to U-Boot in the past. Adding speculative things
> > is risky
> >  > when you only have one development board. The patch works
> > well, for me,
> >  > and addresses the original need. All items, in the patch, are
> > currently
> >  > in scope. If there are additions and/or modifications, feel
> > free to
> >  > modify the patch. It is complete from my perspective. I do
> > not have any
> >  > additional time to chase this any further. I have been
> > developing for
> >  > some time now and can handle an 'out of tree' patch, in my
> > environment,
> >  > until something better comes along. This patch is just my
> > contribution
> >  > to the process.
> > 
> > Hello Derald,
> > 
> >   From my point of view the PMECC header generation for SPL
> > should be
> > done if and only if the SPL is being placed in NAND flash namely
> > defconfigs having *nandflash* in the name.
> > 
> > Thus I disagree with enabling it on spiflash configurations
> > (like you
> > did for the *mmc* configurations looks OK)
> > 
> > 
> > The patch is about 'one' thing. Kconfig conversion. Things that you
> > are mentioning do not invalidate my patch. I tried not to add things
> > that were not there originally. That is generally discouraged scope
> > creep. The patch does its job in a provable manner with
> > 
> > 
> > 'without'
> > 
> > changing existing usage.
> 
> 
> Ok, I understand your point.
> Can you make the CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER depend on 
> NAND_BOOT though ? This way the errors cannot happen again.
> 


I agree.


> Also the other defconfigs need to depend on NAND if they are strict NAND 
> related.
> 


But are the existing configs that enable both SPL_GENERATE_ATMEL_PMECC_HEADER
and SPI_BOOT really valid?

It would appear that those entries may just be placeholders in the event
that an end-user enabled PMECC and NAND_BOOT for that particular board.

I could rework the patch to remove PMECC items from non-NAND_BOOT
configs. Comments could be used to preserve previous values. Does this sound
reasonable?

Additionally, I would make ATMEL_NAND_HW_PMECC dependent on ATMEL_NAND_HWECC
as it should be.

I can only test on the SAMA5D3-XPLD board.

Derald


> Maybe we can get more opinions from someone more familiar with the NAND 
> subsystem ? Adding Miquel and Boris.
> 
> Thanks,
> 
> Eugen
> 
> > 
> > Derald
> > 
> > 
> > If you have any reasons or arguments , or anyone else does, please
> > correct me.
> > 
> > If you do not have time to change the patch, that is OK, I can
> > take over
> > at some point when I have the time or someone else can pick and
> > rework a
> > little bit on that specific point and make a v2.
> > 
> > Thanks again,
> >

[U-Boot] [PATCH] ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig

2018-12-14 Thread Derald D. Woods
This commit converts the following items to Kconfig:

CONFIG_ATMEL_NAND_HWECC
CONFIG_ATMEL_NAND_HW_PMECC
CONFIG_PMECC_CAP
CONFIG_PMECC_SECTOR_SIZE
CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER

[PMECC References]
https://www.at91.com/linux4sam/bin/view/Linux4SAM/PmeccConfigure
https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap

[Mailing List Thread]
https://lists.denx.de/pipermail/u-boot/2018-December/350666.html

Fixes: 5541543f ("configs: at91: Remove CONFIG_SYS_EXTRA_OPTIONS assignment")
Reported-by: Daniel Evans 
Cc: Eugen Hristev 
Signed-off-by: Derald D. Woods 
---
 configs/at91sam9n12ek_mmc_defconfig  |  1 +
 configs/at91sam9n12ek_nandflash_defconfig|  3 ++
 configs/at91sam9n12ek_spiflash_defconfig |  3 ++
 configs/at91sam9x5ek_dataflash_defconfig |  3 ++
 configs/at91sam9x5ek_mmc_defconfig   |  1 +
 configs/at91sam9x5ek_nandflash_defconfig |  3 ++
 configs/at91sam9x5ek_spiflash_defconfig  |  3 ++
 configs/sama5d3_xplained_mmc_defconfig   |  1 +
 configs/sama5d3_xplained_nandflash_defconfig |  3 ++
 configs/sama5d3xek_mmc_defconfig |  1 +
 configs/sama5d3xek_nandflash_defconfig   |  3 ++
 configs/sama5d3xek_spiflash_defconfig|  3 ++
 configs/sama5d4_xplained_mmc_defconfig   |  1 +
 configs/sama5d4_xplained_nandflash_defconfig |  3 ++
 configs/sama5d4_xplained_spiflash_defconfig  |  3 ++
 configs/sama5d4ek_mmc_defconfig  |  1 +
 configs/sama5d4ek_nandflash_defconfig|  3 ++
 configs/sama5d4ek_spiflash_defconfig |  3 ++
 configs/wb45n_defconfig  |  3 ++
 configs/wb50n_defconfig  |  3 ++
 doc/README.atmel_pmecc   | 13 ---
 drivers/mtd/nand/raw/Kconfig | 38 
 include/configs/at91sam9n12ek.h  |  7 
 include/configs/at91sam9x5ek.h   |  7 
 include/configs/sama5d3_xplained.h   |  7 
 include/configs/sama5d3xek.h |  7 
 include/configs/sama5d4_xplained.h   |  6 
 include/configs/sama5d4ek.h  |  6 
 include/configs/wb45n.h  |  7 
 include/configs/wb50n.h  |  6 
 scripts/config_whitelist.txt |  5 ---
 31 files changed, 92 insertions(+), 65 deletions(-)

diff --git a/configs/at91sam9n12ek_mmc_defconfig 
b/configs/at91sam9n12ek_mmc_defconfig
index 6b2cfe9c42..7b46eb498d 100644
--- a/configs/at91sam9n12ek_mmc_defconfig
+++ b/configs/at91sam9n12ek_mmc_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9N12EK=y
+# CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER is not set
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9n12ek_nandflash_defconfig 
b/configs/at91sam9n12ek_nandflash_defconfig
index 354c24ff16..4e34a517fd 100644
--- a/configs/at91sam9n12ek_nandflash_defconfig
+++ b/configs/at91sam9n12ek_nandflash_defconfig
@@ -2,6 +2,9 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9N12EK=y
+CONFIG_PMECC_CAP=2
+CONFIG_PMECC_SECTOR_SIZE=512
+CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9n12ek_spiflash_defconfig 
b/configs/at91sam9n12ek_spiflash_defconfig
index 63889355bf..500c3ab088 100644
--- a/configs/at91sam9n12ek_spiflash_defconfig
+++ b/configs/at91sam9n12ek_spiflash_defconfig
@@ -2,6 +2,9 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9N12EK=y
+CONFIG_PMECC_CAP=2
+CONFIG_PMECC_SECTOR_SIZE=512
+CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9x5ek_dataflash_defconfig 
b/configs/at91sam9x5ek_dataflash_defconfig
index dc13509715..60d865cc23 100644
--- a/configs/at91sam9x5ek_dataflash_defconfig
+++ b/configs/at91sam9x5ek_dataflash_defconfig
@@ -2,6 +2,9 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9X5EK=y
+CONFIG_PMECC_CAP=2
+CONFIG_PMECC_SECTOR_SIZE=512
+CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9x5ek_mmc_defconfig 
b/configs/at91sam9x5ek_mmc_defconfig
index ff86f93e61..75f7fbd199 100644
--- a/configs/at91sam9x5ek_mmc_defconfig
+++ b/configs/at91sam9x5ek_mmc_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f0
 CONFIG_TARGET_AT91SAM9X5EK=y
+# CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER is not set
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf200
diff --git a/configs/at91sam9x5ek_nandflash_defconfig 
b/configs/at91sam9x5ek_nandflash_defco

Re: [U-Boot] [PATCH] ARM: at91: Fix 'boot.bin' generation when CONFIG_SD_BOOT is enabled

2018-12-10 Thread Derald D. Woods
On Mon, Dec 10, 2018 at 03:14:05PM +, eugen.hris...@microchip.com wrote:
> 
> 
> On 10.12.2018 16:54, Derald Woods wrote:
> > 
> > 
> > On Mon, Dec 10, 2018 at 8:03 AM  > <mailto:eugen.hris...@microchip.com>> wrote:
> > 
> > 
> > 
> > On 10.12.2018 15:01, Derald D. Woods wrote:
> >  > On Mon, Dec 10, 2018 at 08:32:33AM +,
> > eugen.hris...@microchip.com <mailto:eugen.hris...@microchip.com> wrote:
> >  >>
> >  >>
> >  >> On 08.12.2018 21:49, Derald D. Woods wrote:
> >  >>> On AT91 platforms configured for SD_BOOT, this commit avoids the
> >  >>> generation of the PMECC header used for booting from NAND
> > flash. This
> >  >>> issue was found by attempting to boot the SAMA5D3-XPLD board
> > with the
> >  >>> 'sama5d3_xplained_mmc_defconfig'.
> >  >>>
> >  >>> [PMECC Reference]
> >  >>> http://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap
> >  >>>
> >  >>> [Mailing List Thread]
> >  >>> https://lists.denx.de/pipermail/u-boot/2018-December/350666.html
> >  >>>
> >  >>> Fixes: 5541543f ("configs: at91: Remove
> > CONFIG_SYS_EXTRA_OPTIONS assignment")
> >  >>> Reported-by: Daniel Evans  > <mailto:photonthun...@gmail.com>>
> >  >>> Cc: Robert Nelson  > <mailto:robertcnel...@gmail.com>>
> >  >>> Cc: Eugen Hristev  > <mailto:eugen.hris...@microchip.com>>
> >  >>> Cc: Wenyou Yang  > <mailto:wenyou.y...@microchip.com>>
> >  >>> Signed-off-by: Derald D. Woods  > <mailto:woods.techni...@gmail.com>>
> >  >>> ---
> >  >>>    scripts/Makefile.spl | 2 ++
> >  >>>    1 file changed, 2 insertions(+)
> >  >>>
> >  >>> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> >  >>> index 22bd8f7c27..e727cb610f 100644
> >  >>> --- a/scripts/Makefile.spl
> >  >>> +++ b/scripts/Makefile.spl
> >  >>> @@ -166,10 +166,12 @@ ifeq ($(CONFIG_SYS_SOC),"at91")
> >  >>>    MKIMAGEFLAGS_boot.bin = -T atmelimage
> >  >>>
> >  >>>    ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y)
> >  >>> +ifneq ($(CONFIG_SD_BOOT),y)
> >  >>
> >  >> Hi Derald,
> >  >>
> >  >> Thanks for your patch, however, I don't like that we do not use the
> >  >> CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER anymore... isn't this config
> >  >> supposed to say whether we are going to generate the header or not ?
> >  >>
> >  >
> >  > That is not what is happening with this patch.
> > SPL_GENERATE_ATMEL_PMECC_HEADER
> >  > is not removed. The config still serves its orignal intent. If
> > SD_BOOT
> >  > is configured, then NAND is not being used. In this non-NAND
> > case, the
> >  > header is not needed.
> >  >
> >  >> Checking if "not sd-boot" doesn't look like a good option... we
> > may use
> >  >> SPI boot or QSPI or some other type at some point and the issue will
> >  >> still be there.
> >  >>
> >  >
> >  > This location and method would work for those nod-NAND cases
> > also. See
> >  > below.
> >  >
> >  >> I would rather fix the original patch by Wenyou, namely move the
> > #ifdef
> >  >> below to not have the GENERATE_ATMEL_PMECC enabled for SDBOOT.
> >  >>
> >  >> Does this sound good for you?
> >  >>
> >  >
> >  > If this SPL_GENERATE_ATMEL_PMECC_HEADER only needs to be there
> > for NAND,
> >  > why not guard the 'ifdef ($(CONFIG_NAND_BOOT,y))'? Would this be
> > better?
> >  > Basically we could replace the 'ifneq ($(CONFIG_SD_BOOT),y)' with the
> >  > more appropriate 'ifeq ($(CONFIG_NAND_BOOT),y)'. This would actually
> >  > allow the future use-cases to be added as they become available
> > and can
> >  > be shown to actually boot with the header applied.
> >  >
> >  > I will put together a proper version 2

Re: [U-Boot] [PATCH] ARM: at91: Fix 'boot.bin' generation when CONFIG_SD_BOOT is enabled

2018-12-10 Thread Derald D. Woods
On Mon, Dec 10, 2018 at 08:32:33AM +, eugen.hris...@microchip.com wrote:
> 
> 
> On 08.12.2018 21:49, Derald D. Woods wrote:
> > On AT91 platforms configured for SD_BOOT, this commit avoids the
> > generation of the PMECC header used for booting from NAND flash. This
> > issue was found by attempting to boot the SAMA5D3-XPLD board with the
> > 'sama5d3_xplained_mmc_defconfig'.
> > 
> > [PMECC Reference]
> > http://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap
> > 
> > [Mailing List Thread]
> > https://lists.denx.de/pipermail/u-boot/2018-December/350666.html
> > 
> > Fixes: 5541543f ("configs: at91: Remove CONFIG_SYS_EXTRA_OPTIONS 
> > assignment")
> > Reported-by: Daniel Evans 
> > Cc: Robert Nelson 
> > Cc: Eugen Hristev 
> > Cc: Wenyou Yang 
> > Signed-off-by: Derald D. Woods 
> > ---
> >   scripts/Makefile.spl | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> > index 22bd8f7c27..e727cb610f 100644
> > --- a/scripts/Makefile.spl
> > +++ b/scripts/Makefile.spl
> > @@ -166,10 +166,12 @@ ifeq ($(CONFIG_SYS_SOC),"at91")
> >   MKIMAGEFLAGS_boot.bin = -T atmelimage
> >   
> >   ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y)
> > +ifneq ($(CONFIG_SD_BOOT),y)
> 
> Hi Derald,
> 
> Thanks for your patch, however, I don't like that we do not use the 
> CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER anymore... isn't this config 
> supposed to say whether we are going to generate the header or not ?
> 

That is not what is happening with this patch. SPL_GENERATE_ATMEL_PMECC_HEADER
is not removed. The config still serves its orignal intent. If SD_BOOT
is configured, then NAND is not being used. In this non-NAND case, the
header is not needed.

> Checking if "not sd-boot" doesn't look like a good option... we may use 
> SPI boot or QSPI or some other type at some point and the issue will 
> still be there.
> 

This location and method would work for those nod-NAND cases also. See
below.

> I would rather fix the original patch by Wenyou, namely move the #ifdef 
> below to not have the GENERATE_ATMEL_PMECC enabled for SDBOOT.
> 
> Does this sound good for you?
> 

If this SPL_GENERATE_ATMEL_PMECC_HEADER only needs to be there for NAND,
why not guard the 'ifdef ($(CONFIG_NAND_BOOT,y))'? Would this be better?
Basically we could replace the 'ifneq ($(CONFIG_SD_BOOT),y)' with the
more appropriate 'ifeq ($(CONFIG_NAND_BOOT),y)'. This would actually
allow the future use-cases to be added as they become available and can
be shown to actually boot with the header applied.

I will put together a proper version 2 of my patch later today.

[patch v2]

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 22bd8f7..e727cb6 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -166,10 +166,12 @@ ifeq ($(CONFIG_SYS_SOC),"at91")
 MKIMAGEFLAGS_boot.bin = -T atmelimage
 
 ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y)
+ifeq ($(CONFIG_NAND_BOOT),y)
 MKIMAGEFLAGS_boot.bin += -n $(shell $(obj)/../tools/atmel_pmecc_params)
 
 boot.bin: $(obj)/../tools/atmel_pmecc_params
 endif
+endif
 
 boot.bin: $(obj)/u-boot-spl.bin FORCE
$(call if_changed,mkimage)


This would allow other configurations to 'opt-in' to applying the
header. Which I think is the direction this is truly heading.

Also, the SPL_GENERATE_ATMEL_PMECC_HEADER needs transitioning to
Kconfig. Having the logic in "Makefile.spl" would help with that work
too.

Derald


> Thanks again,
> 
> Eugen
> 
> >   MKIMAGEFLAGS_boot.bin += -n $(shell $(obj)/../tools/atmel_pmecc_params)
> >   
> >   boot.bin: $(obj)/../tools/atmel_pmecc_params
> >   endif
> > +endif
> >   
> >   boot.bin: $(obj)/u-boot-spl.bin FORCE
> > $(call if_changed,mkimage)
> > 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] ARM: at91: Fix 'boot.bin' generation when CONFIG_SD_BOOT is enabled

2018-12-08 Thread Derald D. Woods
On AT91 platforms configured for SD_BOOT, this commit avoids the
generation of the PMECC header used for booting from NAND flash. This
issue was found by attempting to boot the SAMA5D3-XPLD board with the
'sama5d3_xplained_mmc_defconfig'.

[PMECC Reference]
http://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap

[Mailing List Thread]
https://lists.denx.de/pipermail/u-boot/2018-December/350666.html

Fixes: 5541543f ("configs: at91: Remove CONFIG_SYS_EXTRA_OPTIONS assignment")
Reported-by: Daniel Evans 
Cc: Robert Nelson 
Cc: Eugen Hristev 
Cc: Wenyou Yang 
Signed-off-by: Derald D. Woods 
---
 scripts/Makefile.spl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 22bd8f7c27..e727cb610f 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -166,10 +166,12 @@ ifeq ($(CONFIG_SYS_SOC),"at91")
 MKIMAGEFLAGS_boot.bin = -T atmelimage
 
 ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y)
+ifneq ($(CONFIG_SD_BOOT),y)
 MKIMAGEFLAGS_boot.bin += -n $(shell $(obj)/../tools/atmel_pmecc_params)
 
 boot.bin: $(obj)/../tools/atmel_pmecc_params
 endif
+endif
 
 boot.bin: $(obj)/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
-- 
2.19.2

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] boot.bin on SD Card for SAMA5D3 Xplained

2018-12-07 Thread Derald D. Woods
On Thu, Dec 06, 2018 at 08:02:19AM +, eugen.hris...@microchip.com wrote:
> 
> 
> On 05.12.2018 22:38, Robert Nelson wrote:
> > On Wed, Dec 5, 2018 at 8:37 AM  wrote:
> >>
> >>
> >>
> >> On 05.12.2018 02:15, Daniel Evans wrote:
> >>> Trying to get uboot SPL boot.bin to run on an SD card for the sama5d3 
> >>> xplained board.  All I get is RomBOOT and no other messages.  I have 
> >>> tried throwing in a couple test pins to toggle in board_early_init_f but 
> >>> still not getting any debug.  I can get at91bootstrap to produce a 
> >>> boot.bin that works on the sama5d3 xplained so I am assuming I don’t have 
> >>> a bad board.  My boot partition is FAT16.  To compile I just run the 
> >>> following on Debian Buster :
> >>>
> >>> make mrproper
> >>> make sama5d3_xplained_mmc_defconfig
> >>> make
> >>>
> >>> Cross Compiler is gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf
> >>>
> >>> When finished compiling I just copy the boot.bin to my BOOT partition.
> >>>
> >>> Has to be something obvious that I am missing.  Any insight is 
> >>> appreciated…
> >>
> >> Hello,
> >>
> >> Check the datasheet for sama5d3 SoC section 11.4.3. - Valid code
> >> detection (my datasheet is dated 2 Feb 2016 if it helps)
> >>
> >> Basically the vector 6 needs to have hardcoded the binary size. Are you
> >> doing that ? Otherwise the RomBOOT code will consider your binary as 
> >> faulty.
> >>
> >> PS. make sure endianess is right, use a good hexeditor...
> >>
> >> Hope this helps,
> >> Eugen
> > 
> > Okay, just finished my git bisect, this turned out to be a miss-placed
> > #endif when Wenyou did the "configs: at91: Remove
> > CONFIG_SYS_EXTRA_OPTIONS assignment" patch:
> > 
> > https://github.com/u-boot/u-boot/commit/5541543f686b43210fb92181003ff7175d4ab036#diff-651b6ffe22be4df459343a0d6d25154e
> 
> Interesting find, is this wrongly done for all the boards in the commit 
> or just sama5d3_xplained ?
> 
> Feel free to submit a patch if this fixes the issue, and we will review it.
> 
> Thanks !
> 

Would this be an acceptable alternative?

---8<---
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -166,10 +166,12 @@ ifeq ($(CONFIG_SYS_SOC),"at91")
 MKIMAGEFLAGS_boot.bin = -T atmelimage
 
 ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y)
+ifneq ($(CONFIG_SD_BOOT),y)
 MKIMAGEFLAGS_boot.bin += -n $(shell $(obj)/../tools/atmel_pmecc_params)
 
 boot.bin: $(obj)/../tools/atmel_pmecc_params
 endif
+endif
 
 boot.bin: $(obj)/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
---8<---

It guards the modification of 'boot.bin' at the build location. Also, as
Kconfig items are cleaned-up, the guard will still hold.

I can submit a proper patch, if this is reasonable.

Derald

> 
> > 
> > => RomBOOT
> > 
> > U-Boot spl 2019.01-rc1-00021-g2e2a2a5d4f-dirty (Dec 05 2018 - 14:30:22 
> > -0600)
> > Trying to boot from MMC1
> > 
> > 
> > U-Boot 2019.01-rc1-00021-g2e2a2a5d4f-dirty (Dec 05 2018 - 14:30:22 -0600)
> > 
> > 
> > 
> > diff --git a/include/configs/sama5d3_xplained.h
> > b/include/configs/sama5d3_xplained.h
> > index d0d8087ca3..f87713319d 100644
> > --- a/include/configs/sama5d3_xplained.h
> > +++ b/include/configs/sama5d3_xplained.h
> > @@ -80,7 +80,6 @@
> >   #elif CONFIG_NAND_BOOT
> >   #define CONFIG_SPL_NAND_DRIVERS
> >   #define CONFIG_SPL_NAND_BASE
> > -#endif
> >   #define CONFIG_SYS_NAND_U_BOOT_OFFS0x4
> >   #define CONFIG_SYS_NAND_5_ADDR_CYCLE
> >   #define CONFIG_SYS_NAND_PAGE_SIZE  0x800
> > @@ -91,3 +90,5 @@
> >   #define CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER
> > 
> >   #endif
> > +
> > +#endif
> > 
> > Before:
> > #ifdef CONFIG_SYS_USE_MMC
> > #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
> > #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
> > 
> > #elif CONFIG_SYS_USE_NANDFLASH
> > #define CONFIG_SPL_NAND_DRIVERS
> > #define CONFIG_SPL_NAND_BASE
> > #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x4
> > #define CONFIG_SYS_NAND_5_ADDR_CYCLE
> > #define CONFIG_SYS_NAND_PAGE_SIZE 0x800
> > #define CONFIG_SYS_NAND_PAGE_COUNT 64
> > #define CONFIG_SYS_NAND_OOBSIZE 64
> > #define CONFIG_SYS_NAND_BLOCK_SIZE 0x2
> > #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0x0
> > #define CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER
> > 
> > #endif
> > 
> > After:
> > #ifdef CONFIG_SD_BOOT
> > #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
> > #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
> > 
> > #elif CONFIG_NAND_BOOT
> > #define CONFIG_SPL_NAND_DRIVERS
> > #define CONFIG_SPL_NAND_BASE
> > #endif
> > <- WHY HERE
> > #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x4
> > #define CONFIG_SYS_NAND_5_ADDR_CYCLE
> > #define CONFIG_SYS_NAND_PAGE_SIZE 0x800
> > #define CONFIG_SYS_NAND_PAGE_COUNT 64
> > #define CONFIG_SYS_NAND_OOBSIZE 64
> > #define CONFIG_SYS_NAND_BLOCK_SIZE 0x2
> > #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0x0
> > #define 

Re: [U-Boot] [PATCH v3] serial: omap: Introduce DM specific omap serial

2018-08-27 Thread Derald D. Woods
On Mon, Aug 27, 2018 at 03:55:24PM +0530, Lokesh Vutla wrote:
> Add driver model support for OMAP_SERIAL while reusing
> the functions in ns16550.c
> 
> Signed-off-by: Lokesh Vutla 

Works for omap3-evm, omap3-beagle-xm, and am3517-evm. I captured
'dm tree' output below:

OMAP3_EVM #  dm tree
 Class  Probed  Driver  Name

 root   [ + ]   root_drive  root_driver
 gpio   [ + ]   gpio_omap   |-- gpio_omap
 gpio   [   ]   gpio_omap   |-- gpio_omap
 gpio   [   ]   gpio_omap   |-- gpio_omap
 gpio   [   ]   gpio_omap   |-- gpio_omap
 gpio   [   ]   gpio_omap   |-- gpio_omap
 gpio   [   ]   gpio_omap   |-- gpio_omap
 serial [   ]   ns16550_se  |-- ns16550_serial
 simple_bus [ + ]   generic_si  `-- ocp@6800
 simple_bus [   ]   generic_si  |-- l4@4800
 simple_bus [   ]   generic_si  |   `-- scm@2000
 simple_bus [   ]   generic_si  |   `-- scm_conf@270
 gpio   [   ]   gpio_omap   |-- gpio@4831
 gpio   [   ]   gpio_omap   |-- gpio@4905
 gpio   [   ]   gpio_omap   |-- gpio@49052000
 gpio   [   ]   gpio_omap   |-- gpio@49054000
 gpio   [   ]   gpio_omap   |-- gpio@49056000
 gpio   [   ]   gpio_omap   |-- gpio@49058000
 serial [ + ]   omap_seria  |-- serial@4806a000
 serial [   ]   omap_seria  |-- serial@4806c000
 serial [   ]   omap_seria  |-- serial@4902
 spi[   ]   omap3_spi   |-- spi@48098000
 spi[   ]   omap3_spi   |-- spi@4809a000
 spi[   ]   omap3_spi   |-- spi@480b8000
 spi[   ]   omap3_spi   |-- spi@480ba000
 mmc[ + ]   omap_hsmmc  |-- mmc@4809c000
 blk[   ]   mmc_blk |   `-- m...@4809c000.blk
 mmc[ + ]   omap_hsmmc  `-- mmc@480b4000
 blk[   ]   mmc_blk `-- m...@480b4000.blk


BeagleBoard # dm tree
 Class  Probed  Driver  Name

 root   [ + ]   root_drive  root_driver
 serial [   ]   ns16550_se  |-- ns16550_serial
 gpio   [ + ]   gpio_omap   |-- gpio_omap
 gpio   [ + ]   gpio_omap   |-- gpio_omap
 gpio   [ + ]   gpio_omap   |-- gpio_omap
 gpio   [ + ]   gpio_omap   |-- gpio_omap
 gpio   [ + ]   gpio_omap   |-- gpio_omap
 gpio   [ + ]   gpio_omap   |-- gpio_omap
 simple_bus [ + ]   generic_si  `-- ocp@6800
 simple_bus [   ]   generic_si  |-- l4@4800
 simple_bus [   ]   generic_si  |   `-- scm@2000
 simple_bus [   ]   generic_si  |   `-- scm_conf@270
 gpio   [ + ]   gpio_omap   |-- gpio@4831
 gpio   [ + ]   gpio_omap   |-- gpio@4905
 gpio   [ + ]   gpio_omap   |-- gpio@49052000
 gpio   [ + ]   gpio_omap   |-- gpio@49054000
 gpio   [ + ]   gpio_omap   |-- gpio@49056000
 gpio   [ + ]   gpio_omap   |-- gpio@49058000
 serial [   ]   omap_seria  |-- serial@4806a000
 serial [   ]   omap_seria  |-- serial@4806c000
 serial [ + ]   omap_seria  `-- serial@4902


AM3517_EVM # dm tree
 Class  Probed  Driver  Name

 root   [ + ]   root_drive  root_driver
 gpio   [ + ]   gpio_omap   |-- gpio_omap
 gpio   [   ]   gpio_omap   |-- gpio_omap
 gpio   [   ]   gpio_omap   |-- gpio_omap
 gpio   [   ]   gpio_omap   |-- gpio_omap
 gpio   [   ]   gpio_omap   |-- gpio_omap
 gpio   [   ]   gpio_omap   |-- gpio_omap
 simple_bus [ + ]   generic_si  `-- ocp@6800
 simple_bus [   ]   generic_si  |-- l4@4800
 simple_bus [   ]   generic_si  |   `-- scm@2000
 simple_bus [   ]   generic_si  |   `-- scm_conf@270
 gpio   [   ]   gpio_omap   |-- gpio@4831
 gpio   [   ]   gpio_omap   |-- gpio@4905
 gpio   [   ]   gpio_omap   |-- gpio@49052000
 gpio   [ + ]   gpio_omap   |-- gpio@49054000
 gpio   [   ]   gpio_omap   |-- gpio@49056000
 gpio   [   ]   gpio_omap   |-- gpio@49058000
 serial [   ]   omap_seria  |-- serial@4806a000
 serial [   ]   omap_seria  |-- serial@4806c000
 serial [ + ]   omap_seria  |-- serial@4902
 i2c[   ]   i2c_omap|-- i2c@4807
 i2c[   ]   i2c_omap|-- i2c@48072000
 i2c[   ]   i2c_omap|-- i2c@4806
 mmc[ + ]   omap_hsmmc  `-- mmc@4809c000
 blk[   ]   mmc_blk `-- m...@4809c000.blk


In addition to this patch, I also applied these OMAP3 related patches:

https://patchwork.ozlabs.org/project/uboot/list/?submitter=67132

A WIP branch is here:

https://github.com/woodsts/u-boot/commits/omap3-adam-queue

Tested-by: Derald D. Woods 

> ---
> Based on the conclusion on the thread[1], added a separate driver for
> omap uart.
> 
> [1] https://patchwork.ozlabs.org/patch/944756/
> 
> Changes since v2:
> - Dropped enabling OMAP_SERIAL by default for SOC_DA8XX. 
>

Re: [U-Boot] [PATCH 2/2] ARM: am3517_evm: Disable DM_I2C_COMPAT

2018-08-27 Thread Derald D. Woods
On Sun, Aug 19, 2018 at 11:11:03AM -0500, Adam Ford wrote:
> DM_I2C_COMPAT is somehow being enabled outside of Kconfig, so
> this explicitly undefines it in the header file, and brackets
> the I2C initialization around an #ifdef to not manually
> initialize the I2C controller when the DM_I2C is enabled.
> 
> Signed-off-by: Adam Ford 

There are some merge conflicts, but otherwise the changes here and patch
1 of the series allow DM_I2C without compatibility.

[...]
AM3517_EVM # i2c dev 0
Setting bus to 0
AM3517_EVM # i2c probe
Valid chip addresses: 30 31 32 33 34 35 36 37 48 4B
AM3517_EVM # i2c dev 1
Setting bus to 1
AM3517_EVM # i2c probe
Valid chip addresses: 21
[...]

Tested-by: Derald D. Woods 

> 
> diff --git a/board/logicpd/am3517evm/am3517evm.c 
> b/board/logicpd/am3517evm/am3517evm.c
> index da8be22085..6f728398c3 100644
> --- a/board/logicpd/am3517evm/am3517evm.c
> +++ b/board/logicpd/am3517evm/am3517evm.c
> @@ -108,10 +108,11 @@ int misc_init_r(void)
>   volatile unsigned int ctr;
>   u32 reset;
>  
> +#if !defined(CONFIG_DM_I2C)
>  #ifdef CONFIG_SYS_I2C_OMAP24XX
>   i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
>  #endif
> -
> +#endif
>   omap_die_id_display();
>  
>   am3517_evm_musb_init();
> diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
> index c767961562..507f12ef9e 100644
> --- a/include/configs/am3517_evm.h
> +++ b/include/configs/am3517_evm.h
> @@ -25,8 +25,8 @@
>  #define CONFIG_SYS_SPL_MALLOC_SIZE   0x10
>  
>  #include 
> -#undef CONFIG_SDRC   /* Disable SDRC since we have EMIF4 */
>  
> +#undef CONFIG_DM_I2C_COMPAT
>  #define CONFIG_MISC_INIT_R
>  #define CONFIG_REVISION_TAG
>  
> -- 
> 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


Re: [U-Boot] [PATCH] GPIO: omap_gpio: Fix gpio name names with device tree

2018-08-26 Thread Derald D. Woods
On Fri, Aug 17, 2018 at 02:37:58PM -0500, Adam Ford wrote:
> The GPIO bank numbers do not appear in the device tree, so this
> patch makes the gpio name based on the address
> (ie gpio@49054000_31 vs gpio4_31)
> 
> adam
> 
> Signed-off-by: Adam Ford 

Works for omap3-evm and omap3-beagle-xm.

OMAP3_EVM # gpio status   
Bank gpio@4831_:
gpio@4831_7: output: 1 [x]
OMAP3_EVM # gpio status -a
Bank gpio@4831_:
gpio@4831_0: input: 0 [ ]
gpio@4831_1: input: 0 [ ]
gpio@4831_2: input: 0 [ ]
gpio@4831_3: input: 0 [ ]
gpio@4831_4: input: 0 [ ]
gpio@4831_5: input: 1 [ ]
gpio@4831_6: input: 1 [ ]
gpio@4831_7: output: 1 [x] 
gpio@4831_8: input: 0 [ ]
gpio@4831_9: input: 0 [ ]
[...]

BeagleBoard # gpio status
Bank gpio@49056000_:
gpio@49056000_19: output: 1 [x] USB PHY1 reset
gpio@49056000_21: output: 1 [x] led
gpio@49056000_22: output: 1 [x] led

Bank gpio@49058000_:
gpio@49058000_11: input: 0 [x] rev0
gpio@49058000_12: input: 1 [x] rev1
gpio@49058000_13: input: 0 [x] rev2
BeagleBoard # gpio status -a
Bank gpio@4831_:
gpio@4831_0: input: 0 [ ]
gpio@4831_1: input: 0 [ ]
gpio@4831_2: input: 0 [ ]
gpio@4831_3: input: 0 [ ]
gpio@4831_4: input: 0 [ ]
gpio@4831_5: input: 0 [ ]
gpio@4831_6: input: 0 [ ]
gpio@4831_7: input: 0 [ ]
gpio@4831_8: input: 0 [ ]
gpio@4831_9: input: 0 [ ]
[...]

Tested-by: Derald D. Woods 

> 
> diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
> index 651f6994e4..0f1ddeff92 100644
> --- a/drivers/gpio/omap_gpio.c
> +++ b/drivers/gpio/omap_gpio.c
> @@ -288,11 +288,9 @@ static int omap_gpio_probe(struct udevice *dev)
>   struct gpio_bank *bank = dev_get_priv(dev);
>   struct omap_gpio_platdata *plat = dev_get_platdata(dev);
>   struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
> - int banknum;
>   char name[18], *str;
>  
> - banknum = plat->bank_index;
> - sprintf(name, "GPIO%d_", banknum + 1);
> + sprintf(name, "gpio@%4x_", (unsigned int)plat->base);
>   str = strdup(name);
>   if (!str)
>   return -ENOMEM;
> -- 
> 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


[U-Boot] [PATCH] ARM: omap3: evm: Enable CONFIG_BLK and misc. cleanup

2018-08-05 Thread Derald D. Woods
This commit enables CONFIG_BLK and removes USB_STORAGE which is awaiting
proper implementation for current U-Boot interfaces. Additionally the
console selection is now handled by Kconfig and no longer needs to be in
the config header. CONFIG_SYS_MALLOC_F_LEN=0x2000 was added to sync with
other boards. CONFIG_SPL_BLK and CONFIG_SPL_DM_MMC are disabled because
they currently do not allow the OMAP3-EVM (OMAP34XX) to actually boot.

Signed-off-by: Derald D. Woods 
---
 configs/omap3_evm_defconfig | 9 +++--
 include/configs/omap3_evm.h | 3 ---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index cd517b418d..c53f439618 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
+CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_SPL=y
 CONFIG_DEFAULT_DEVICE_TREE="omap3-evm"
@@ -38,6 +39,10 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SPL_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x8200
+CONFIG_BLK=y
+# CONFIG_SPL_BLK is not set
+CONFIG_DM_MMC=y
+# CONFIG_SPL_DM_MMC is not set
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
@@ -48,15 +53,15 @@ CONFIG_NETDEVICES=y
 CONFIG_SMC911X=y
 CONFIG_SMC911X_BASE=0x2C00
 CONFIG_SMC911X_32_BIT=y
+CONFIG_CONS_INDEX=1
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_OMAP3=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
-CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0451
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 34418309cb..6e5c3005ce 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -33,9 +33,6 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
-/* Override OMAP3 serial console configuration */
-#define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
-
 /* NAND */
 #if defined(CONFIG_NAND)
 #define CONFIG_SYS_FLASH_BASE  NAND_BASE
-- 
2.18.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] omap3: beagle: re-enable EFI support after the following commit removed it by mistake:

2018-07-18 Thread Derald D. Woods
On Wed, Jul 18, 2018 at 09:38:44PM +0200, Guillaume GARDET wrote:
>   commit d233ccb1d84b901f7e23e6d9b4f2c6a57198b23b
>   ARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND layout


I have found no compile or runtime issues, on my BeagleBoard Rev. C4
or xM, with the current default configuration. At least, for my non-EFI
boot environment.

The following items are brought in from the EFI config additions:

+CONFIG_SMBIOS_PRODUCT_NAME="beagle"
+CONFIG_CMD_BOOTEFI=y
+CONFIG_CMD_BOOTEFI_HELLO_COMPILE=y
+CONFIG_EFI_PARTITION=y
+CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=128
+CONFIG_EFI_PARTITION_ENTRIES_OFF=0
+CONFIG_SPL_EFI_PARTITION=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_GENERATE_SMBIOS_TABLE=y
+CONFIG_SMBIOS_MANUFACTURER="ti"
+CONFIG_EFI_LOADER=y

I would change the commit message though. It was not a mistake. It was
removed to provide a minimal set of configuration options for the base
BSP type of setup. Using EFI is a choice. In fact, I tested my changes
on 3 different OMAP3 boards. So there has been no period of not working
in the basic board configuration. Provably.

So if EFI is required, even though one may not use it, this is a don't
care for me. My boards boot just fine without EFI.

Derald

> Signed-off-by: Guillaume GARDET 
> Cc: Derald D. Woods 
> Cc: Tom Rini  
> 
> ---
>  configs/omap3_beagle_defconfig | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
> index a37a38f881..1e1a391d7f 100644
> --- a/configs/omap3_beagle_defconfig
> +++ b/configs/omap3_beagle_defconfig
> @@ -32,8 +32,6 @@ CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
>  
> CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1920k(u-boot),128k(u-boot-env),128k(dtb),6m(kernel),-(rootfs)"
>  CONFIG_CMD_UBI=y
>  # CONFIG_ISO_PARTITION is not set
> -# CONFIG_EFI_PARTITION is not set
> -CONFIG_SPL_PARTITION_UUIDS=y
>  CONFIG_OF_CONTROL=y
>  CONFIG_ENV_IS_IN_NAND=y
>  CONFIG_SPL_DM=y
> @@ -79,4 +77,3 @@ CONFIG_USB_ETHER_SMSC95XX=y
>  CONFIG_FAT_WRITE=y
>  CONFIG_BCH=y
>  CONFIG_SPL_OF_LIBFDT=y
> -# CONFIG_EFI_LOADER is not set
> -- 
> 2.18.0
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] Re : Commit d233ccb1d84b90 broke MMC access on BeagleBoard xM

2018-07-18 Thread Derald D. Woods
On Wed, Jul 18, 2018 at 05:04:45PM +0200, Guillaume GARDET wrote:
> 
> - Guillaume GARDET  a écrit :
> > 
> > Hi,
> > 
> > commit d233ccb1d84b901f7e23e6d9b4f2c6a57198b23b (HEAD, refs/bisect/bad)
> > Author: Derald D. Woods 
> > Date:   Mon Feb 26 17:52:58 2018 -0600
> > 
> > ARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND 
> > layout
> > 
> > broke MMC access on Beagleboard xM (rev. B). For my SD card with 2 
> > partitions, I get the following errors:
> > * 'ls mmc 0:1' returns: ** Unrecognized filesystem type **
> > * 'ls mmc 0:2' returns: ** Invalid partition 2 **
> > 
> > 
> > Not sure which part of this patch cause this bug.
> 
> I removed: 
>   # CONFIG_EFI_PARTITION is not set
> 
> and MMC is working again for me! I will send a patch to fix this.
> 
> Note also that EFI boot does not work since this commit, even with 
> CONFIG_EFI_PARTITION enabled.

So if you use 'make menucofig' to set the properties that you want, for
your setup, it does not work? To my knowledge the patch series did not
limit any known configurable functionality.

Derald

> 
> Guillaume
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] dm: Complete CONFIG_BLK migration

2018-06-28 Thread Derald D. Woods
On Thu, Jun 28, 2018 at 10:47:36AM -0500, Adam Ford wrote:
> On Wed, Jun 27, 2018 at 4:41 PM Tom Rini  wrote:
> >
> > On Sat, Jun 23, 2018 at 07:59:30AM -0600, Simon Glass wrote:
> > > The time has come to migrate all boards to use CONFIG_BLK. This series
> > > is just a test to see what boards would have to be removed if we required
> > > CONFIG_BLK, as we plan to after the next release.
> > >
> > > This should help maintainers see what is impacted.
> > >
> > > Hopefully maintainers will be able to convert their boards over in the
> > > next month so we we can avoid having to remove any boards.
> > >
> > > The goal is to have all boards use driver model. But so far, we do allow
> > > CONFIG_DM to not be defined.
> > >
> > >
> > > For 'Force BLK', here is the buildman output showing failed boards and the
> > > relatively small number of command errors:
> > >
> > > 03: Force BLK
> > >   mips:  +   pic32mzdask
> > >arm:  +   mixtile_loftq colibri_imx6_nospl sniper omap3_zoom1 
> > > tbs2910 Mele_A1000G_quad
> > > am335x_igep003x mx6ul_14x14_evk mk802_a10s am43xx_hs_evm devkit3250 
> > > pcm051_rev3
> > > am57xx_hs_evm Empire_electronix_m712 Auxtek-T003 pcm058 zc5202 am335x_shc
> > > am335x_shc_ict Hummingbird_A31 vining_2000 am335x_evm_usbspl ot1200_spl 
> > > igep00x0
> > > Mele_I7 Wobo_i5 r7-tv-dongle liteboard omap3_overo am335x_boneblack 
> > > evb-ast2500
> > > warp7 gwventana_gw5904 cairo A13-OLinuXinoM mccmon6_sd 
> > > apalis_imx6_nospl_it
> > > wandboard birdland_bav335a colibri_imx7 colibri_imx6 inet_q972 xpress_spl
> > > stm32f429-evaluation udoo_neo igep0032 Mele_M9 A13-OLinuXino inet98v_rev2
> > > A10s-OLinuXino-M riotboard snapper9260 am43xx_evm pfla02 mx6qsabrelite
> > > apalis_imx6_nospl_com s5p_goni colibri_pxa270 snapper9g20
> > > Yones_Toptech_BS1078_V2 am335x_shc_sdboot_prompt k2g_hs_evm cl-som-imx7
> > > am335x_shc_sdboot vf610twr_nand stm32f469-discovery am335x_evm_nor 
> > > mx53cx9020
> > > Empire_electronix_d709 vf610twr cm_t43 pengwyn stm32f746-disco 
> > > Sinovoip_BPI_M2
> > > Sinovoip_BPI_M3 Sinlinx_SinA31s pico-imx7d am43xx_evm_rtconly 
> > > LicheePi_Zero
> > > pcm051_rev1 mccmon6_nor mx6sabreauto display5_factory am335x_shc_prompt
> > > gwventana_nand Bananapi_M2_Ultra Auxtek-T004 tbs_a711 cm_t335 h8_homlet_v2
> > > Colombus am43xx_evm_usbhost_boot chiliboard am335x_baltos colibri_vf
> > > mx6ul_9x9_evk kp_imx6q_tpc bk4r1 udoo difrnce_dit4350 am335x_evm_norboot
> > > UTOO_P66 iNet_86VS marsboard MSI_Primo81 apalis_imx6 bananapi_m2_berry
> > > xilinx_zynqmp_r5 birdland_bav335b am43xx_evm_qspiboot CSQ_CS908 Ampe_A76
> > > kp_imx53 am335x_evm_spiboot Cubietruck_plus k2g_evm mx6sabresd omap3_logic
> > > pepper colorfly_e708_q1 pcm052 gwventana_emmc am335x_boneblack_vboot
> > > am335x_shc_netboot xpress ot1200 cgtqmx6eval zc5601 devkit8000 dh_imx6 
> > > mx6cuboxi
> > > am57xx_evm am335x_sl50 q8_a13_tablet sksimx6
> > >
> > > microblaze:  +   microblaze-generic
> > >powerpc:  +   P1010RDB-PA_36BIT_NOR_SECBOOT 
> > > BSC9132QDS_SDCARD_DDRCLK100_SECURE
> > > P1010RDB-PB_SPIFLASH_SECBOOT T1024QDS_DDR4_SECURE_BOOT
> > > controlcenterd_36BIT_SDCARD BSC9132QDS_SDCARD_DDRCLK133_SECURE
> > > P1010RDB-PA_SPIFLASH_SECBOOT BSC9132QDS_NAND_DDRCLK133_SECURE
> > > P1010RDB-PA_36BIT_SPIFLASH_SECBOOT P2041RDB_SECURE_BOOT 
> > > P5020DS_NAND_SECURE_BOOT
> > > P1010RDB-PB_36BIT_NOR_SECBOOT BSC9132QDS_NOR_DDRCLK100_SECURE
> > > P3041DS_SECURE_BOOT T1042D4RDB_SECURE_BOOT T1042RDB_SECURE_BOOT
> > > T4240QDS_SECURE_BOOT P1010RDB-PB_36BIT_SPIFLASH_SECBOOT 
> > > P1010RDB-PB_NAND_SECBOOT
> > > BSC9132QDS_SPIFLASH_DDRCLK100_SECURE P3041DS_NAND_SECURE_BOOT
> > > T4160QDS_SECURE_BOOT T2080RDB_SECURE_BOOT B4860QDS_SECURE_BOOT
> > > P4080DS_SECURE_BOOT T2080QDS_SECURE_BOOT P5040DS_SECURE_BOOT
> > > P1010RDB-PB_36BIT_NAND_SECBOOT controlcenterd_36BIT_SDCARD_DEVELOP
> > > P1010RDB-PA_NAND_SECBOOT BSC9132QDS_SPIFLASH_DDRCLK133_SECURE
> > > P1010RDB-PA_NOR_SECBOOT controlcenterd_TRAILBLAZER_DEVELOP 
> > > P5020DS_SECURE_BOOT
> > > T1024QDS_SECURE_BOOT T1040QDS_SECURE_BOOT BSC9132QDS_NOR_DDRCLK133_SECURE
> > > T1024RDB_SECURE_BOOT P5040DS_NAND_SECURE_BOOT 
> > > P1010RDB-PA_36BIT_NAND_SECBOOT
> > > T1042RDB_PI_NAND_SECURE_BOOT T1040RDB_SECURE_BOOT T1040D4RDB_SECURE_BOOT
> > > BSC9132QDS_NAND_DDRCLK100_SECURE P1010RDB-PB_NOR_SECBOOT 
> > > T1023RDB_SECURE_BOOT
> > > controlcenterd_TRAILBLAZER
> >
> > So, how are the maintainers CC'd on this feeling about the deadline?  It
> > was supposed to be 2018.05, but it's looking like we would enforce it
> > for 2018.09 at this point in time.
> 
> I looked at the omap3_logic board, and if I turned on the CONFIG_BLK
> option, some items in USB break.
> 
> LD  drivers/mtd/built-in.o
> common/usb_storage.c: In function ‘usb_stor_probe_device’:
> common/usb_storage.c:207:32: error: ‘struct usb_device’ has no member
> named ‘dev’; did you mean ‘devnum’?
>   data = dev_get_platdata(udev->dev);
> ^~~
>  

Re: [U-Boot] [PATCH 0/2] dm: Complete CONFIG_BLK migration

2018-06-28 Thread Derald D. Woods
On Wed, Jun 27, 2018 at 05:40:31PM -0400, Tom Rini wrote:
> On Sat, Jun 23, 2018 at 07:59:30AM -0600, Simon Glass wrote:
> > The time has come to migrate all boards to use CONFIG_BLK. This series
> > is just a test to see what boards would have to be removed if we required
> > CONFIG_BLK, as we plan to after the next release.
> > 
> > This should help maintainers see what is impacted.
> > 
> > Hopefully maintainers will be able to convert their boards over in the
> > next month so we we can avoid having to remove any boards.
> > 
> > The goal is to have all boards use driver model. But so far, we do allow
> > CONFIG_DM to not be defined.
> > 
> > 
> > For 'Force BLK', here is the buildman output showing failed boards and the
> > relatively small number of command errors:
> > 
> > 03: Force BLK
> >   mips:  +   pic32mzdask
> >arm:  +   mixtile_loftq colibri_imx6_nospl sniper omap3_zoom1 
> > tbs2910 Mele_A1000G_quad
> > am335x_igep003x mx6ul_14x14_evk mk802_a10s am43xx_hs_evm devkit3250 
> > pcm051_rev3
> > am57xx_hs_evm Empire_electronix_m712 Auxtek-T003 pcm058 zc5202 am335x_shc
> > am335x_shc_ict Hummingbird_A31 vining_2000 am335x_evm_usbspl ot1200_spl 
> > igep00x0
> > Mele_I7 Wobo_i5 r7-tv-dongle liteboard omap3_overo am335x_boneblack 
> > evb-ast2500
> > warp7 gwventana_gw5904 cairo A13-OLinuXinoM mccmon6_sd apalis_imx6_nospl_it
> > wandboard birdland_bav335a colibri_imx7 colibri_imx6 inet_q972 xpress_spl
> > stm32f429-evaluation udoo_neo igep0032 Mele_M9 A13-OLinuXino inet98v_rev2
> > A10s-OLinuXino-M riotboard snapper9260 am43xx_evm pfla02 mx6qsabrelite
> > apalis_imx6_nospl_com s5p_goni colibri_pxa270 snapper9g20
> > Yones_Toptech_BS1078_V2 am335x_shc_sdboot_prompt k2g_hs_evm cl-som-imx7
> > am335x_shc_sdboot vf610twr_nand stm32f469-discovery am335x_evm_nor 
> > mx53cx9020
> > Empire_electronix_d709 vf610twr cm_t43 pengwyn stm32f746-disco 
> > Sinovoip_BPI_M2
> > Sinovoip_BPI_M3 Sinlinx_SinA31s pico-imx7d am43xx_evm_rtconly LicheePi_Zero
> > pcm051_rev1 mccmon6_nor mx6sabreauto display5_factory am335x_shc_prompt
> > gwventana_nand Bananapi_M2_Ultra Auxtek-T004 tbs_a711 cm_t335 h8_homlet_v2
> > Colombus am43xx_evm_usbhost_boot chiliboard am335x_baltos colibri_vf
> > mx6ul_9x9_evk kp_imx6q_tpc bk4r1 udoo difrnce_dit4350 am335x_evm_norboot
> > UTOO_P66 iNet_86VS marsboard MSI_Primo81 apalis_imx6 bananapi_m2_berry
> > xilinx_zynqmp_r5 birdland_bav335b am43xx_evm_qspiboot CSQ_CS908 Ampe_A76
> > kp_imx53 am335x_evm_spiboot Cubietruck_plus k2g_evm mx6sabresd omap3_logic
> > pepper colorfly_e708_q1 pcm052 gwventana_emmc am335x_boneblack_vboot
> > am335x_shc_netboot xpress ot1200 cgtqmx6eval zc5601 devkit8000 dh_imx6 
> > mx6cuboxi
> > am57xx_evm am335x_sl50 q8_a13_tablet sksimx6
> > 
> > microblaze:  +   microblaze-generic
> >powerpc:  +   P1010RDB-PA_36BIT_NOR_SECBOOT 
> > BSC9132QDS_SDCARD_DDRCLK100_SECURE
> > P1010RDB-PB_SPIFLASH_SECBOOT T1024QDS_DDR4_SECURE_BOOT
> > controlcenterd_36BIT_SDCARD BSC9132QDS_SDCARD_DDRCLK133_SECURE
> > P1010RDB-PA_SPIFLASH_SECBOOT BSC9132QDS_NAND_DDRCLK133_SECURE
> > P1010RDB-PA_36BIT_SPIFLASH_SECBOOT P2041RDB_SECURE_BOOT 
> > P5020DS_NAND_SECURE_BOOT
> > P1010RDB-PB_36BIT_NOR_SECBOOT BSC9132QDS_NOR_DDRCLK100_SECURE
> > P3041DS_SECURE_BOOT T1042D4RDB_SECURE_BOOT T1042RDB_SECURE_BOOT
> > T4240QDS_SECURE_BOOT P1010RDB-PB_36BIT_SPIFLASH_SECBOOT 
> > P1010RDB-PB_NAND_SECBOOT
> > BSC9132QDS_SPIFLASH_DDRCLK100_SECURE P3041DS_NAND_SECURE_BOOT
> > T4160QDS_SECURE_BOOT T2080RDB_SECURE_BOOT B4860QDS_SECURE_BOOT
> > P4080DS_SECURE_BOOT T2080QDS_SECURE_BOOT P5040DS_SECURE_BOOT
> > P1010RDB-PB_36BIT_NAND_SECBOOT controlcenterd_36BIT_SDCARD_DEVELOP
> > P1010RDB-PA_NAND_SECBOOT BSC9132QDS_SPIFLASH_DDRCLK133_SECURE
> > P1010RDB-PA_NOR_SECBOOT controlcenterd_TRAILBLAZER_DEVELOP 
> > P5020DS_SECURE_BOOT
> > T1024QDS_SECURE_BOOT T1040QDS_SECURE_BOOT BSC9132QDS_NOR_DDRCLK133_SECURE
> > T1024RDB_SECURE_BOOT P5040DS_NAND_SECURE_BOOT P1010RDB-PA_36BIT_NAND_SECBOOT
> > T1042RDB_PI_NAND_SECURE_BOOT T1040RDB_SECURE_BOOT T1040D4RDB_SECURE_BOOT
> > BSC9132QDS_NAND_DDRCLK100_SECURE P1010RDB-PB_NOR_SECBOOT 
> > T1023RDB_SECURE_BOOT
> > controlcenterd_TRAILBLAZER
> 
> So, how are the maintainers CC'd on this feeling about the deadline?  It
> was supposed to be 2018.05, but it's looking like we would enforce it
> for 2018.09 at this point in time.
> 

So. What is the right model for this to work? Some boards may build
cleanly, but may not actually boot. One can make something build
by trimming things out of the config and get the board off the 'reap'
list. But that is not quite the point of all this. Right. A failed build
may mean you have been adding things as you can. Now your stuck trying
to keep up with a moving target.

Is there a bootable reference board for each architecture variant?

I will help with the conversion work. Some good references will speed up
the process. For me, at least. Just being honest.

Derald


> ___
> U-Boot mailing 

[U-Boot] [PATCH v3 1/3] ARM: omap3: beagle: Set 'mtdids' and 'mtdparts' in board file

2018-02-26 Thread Derald D. Woods
BeagleBoard 'xM' does not really have NAND. CONFIG_MTDIDS_DEFAULT and
CONFIG_MTDPARTS_DEFAULT can/should be empty for 'xM'. This commit sets
the defined values if they exist.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 board/ti/beagle/beagle.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index d8402f2675..1d55264733 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -521,6 +521,14 @@ int misc_init_r(void)
if (generate_fake_mac)
omap_die_id_usbethaddr();
 
+#if defined(CONFIG_MTDIDS_DEFAULT) && defined(CONFIG_MTDPARTS_DEFAULT)
+   if (strlen(CONFIG_MTDIDS_DEFAULT))
+   env_set("mtdids", CONFIG_MTDIDS_DEFAULT);
+
+   if (strlen(CONFIG_MTDPARTS_DEFAULT))
+   env_set("mtdparts", CONFIG_MTDPARTS_DEFAULT);
+#endif
+
return 0;
 }
 
-- 
2.16.2

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 2/3] ARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND layout

2018-02-26 Thread Derald D. Woods
This commit does the following for BeagleBoard{-xM}:

- Enable DM_SERIAL which also enables SPL_DM_SERIAL
- Misc. config updates in support of DM_SERIAL
- Use updated NAND layout (BeagleBoard):

device nand0 , # parts = 6

#: name sizeoffset
-
0: spl  0x0008(512k)0x
1: u-boot   0x001e(1920k)   0x0008
2: u-boot-env   0x0002(128k)0x0026
3: dtb  0x0002(128k)0x0028
4: kernel   0x0060(6m)  0x002a
5: rootfs   0x0f76(-)   0x008a
-

- Use MMC and UBIFS support from config_distro_bootcmd.h
- Use LEGACY_MMC and NAND support defined in omap3_beagle.h

[MMC(0:1)/extlinux/extlinux.conf]
---8<---
default omap3-beagle-mmc-fat
label omap3-beagle-mmc-fat
kernel /zImage
fdt /omap3-beagle.dtb
append console=ttyO2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 
rootwait
---8<---

[LEGACY_MMC(0:2)/boot/extlinux/extlinux.conf]
---8<---
default omap3-beagle-mmc-ext4
label omap3-beagle-mmc-ext4
kernel /boot/zImage
fdt /boot/omap3-beagle.dtb
append console=ttyO2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 
rootwait
---8<---

[UBIFS(ubi0:rootfs)/boot/extlinux/extlinux.conf]
---8<---
default omap3-beagle-nand-ubifs
label omap3-beagle-nand-ubifs
kernel /boot/zImage
fdt /boot/omap3-beagle.dtb
append console=ttyO2,115200n8 root=ubi0:rootfs rw ubi.mtd=rootfs 
rootfstype=ubifs rootwait
---8<---

The board's 'bootcmd' can also be overridden with:

CONFIG_BOOTCOMMAND="run findfdt; run mmcboot"
CONFIG_BOOTCOMMAND="run findfdt; run nandboot"
CONFIG_BOOTCOMMAND="run findfdt; run ramboot"

or

CONFIG_BOOTCOMMAND="run findfdt; run somethingelse"

The use of 'run findfdt' is required.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 configs/omap3_beagle_defconfig |  25 -
 include/configs/omap3_beagle.h | 239 +++--
 2 files changed, 152 insertions(+), 112 deletions(-)

diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
index f0169a4544..35e0b3cd84 100644
--- a/configs/omap3_beagle_defconfig
+++ b/configs/omap3_beagle_defconfig
@@ -4,32 +4,41 @@ CONFIG_SYS_TEXT_BASE=0x8010
 CONFIG_TARGET_OMAP3_BEAGLE=y
 CONFIG_DEFAULT_DEVICE_TREE="omap3-beagle"
 CONFIG_DISTRO_DEFAULTS=y
-# CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-beagle.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
+# CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
+CONFIG_SYS_PROMPT="BeagleBoard # "
 CONFIG_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x8200
 CONFIG_CMD_SPL=y
-CONFIG_CMD_SPL_NAND_OFS=0x24
+CONFIG_CMD_SPL_NAND_OFS=0x28
+CONFIG_CMD_SPL_WRITE_SIZE=0x2
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_MTDPARTS=y
-CONFIG_MTDIDS_DEFAULT="nand0=nand"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=nand:512k(x-loader),1920k(u-boot),128k(u-boot-env),4m(kernel),-(fs)"
+CONFIG_CMD_FS_UUID=y
+CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1920k(u-boot),128k(u-boot-env),128k(dtb),6m(kernel),-(rootfs)"
+CONFIG_CMD_UBI=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_SPL_DM=y
 CONFIG_LED_STATUS=y
 CONFIG_LED_STATUS0=y
 CONFIG_LED_STATUS_BIT=1
@@ -45,11 +54,15 @@ CONFIG_LED_STATUS_CMD=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x8
 CONFIG_SPL_NAND_SIMPLE=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OMAP3=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
 CONFIG_TWL4030_USB=y
@@ -65,3 +78,5 @@ CONFIG_USB_ETHER_MCS7830=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_FAT_WRITE=y
 CONFIG_BCH=y
+CONF

[U-Boot] [PATCH v3 3/3] ARM: omap3: evm: Sync with omap3_beagle configuration

2018-02-26 Thread Derald D. Woods
This commit does the following for OMAP3 EVM:

- Track omap3_beagle changes where possible
- Remove CONFIG_SYS_MPUCLK and CONFIG_MTD which are not needed for the
  default board configuration to work.
- Remove CONFIG_SPL_SYS_MALLOC_SIMPLE and CONFIG_SYS_MALLOC_F_LEN from
  default config. CONFIG_SYS_MALLOC_F_LEN=0x400 is set by configuration
  automatically. [allows board to boot with SERIAL_SEARCH_ALL=y]
- Use updated NAND layout:

device nand0 , # parts = 6

#: name sizeoffset
-
0: spl  0x0008(512k)0x
1: u-boot   0x001e(1920k)   0x0008
2: u-boot-env   0x0002(128k)0x0026
3: dtb  0x0002(128k)0x0028
4: kernel   0x0060(6m)  0x002a
5: rootfs   0x0f76(-)   0x008a
-

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 configs/omap3_evm_defconfig | 21 +++---
 include/configs/omap3_evm.h | 71 ++---
 2 files changed, 52 insertions(+), 40 deletions(-)

diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 34998777a0..55fc944d21 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -1,22 +1,22 @@
 CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
-CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_DEFAULT_DEVICE_TREE="omap3-evm"
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_ENV_SUPPORT=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_PROMPT="OMAP3_EVM # "
-# CONFIG_CMD_IMI is not set
+CONFIG_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x8200
+CONFIG_CMD_SPL=y
+CONFIG_CMD_SPL_NAND_OFS=0x28
+CONFIG_CMD_SPL_WRITE_SIZE=0x2
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -30,7 +30,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FS_UUID=y
 CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1792k(u-boot),128k(dtb),128k(u-boot-env),6m(kernel),-(rootfs)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1920k(u-boot),128k(u-boot-env),128k(dtb),6m(kernel),-(rootfs)"
 CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
@@ -39,14 +39,16 @@ CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SPL_DM=y
 CONFIG_MMC_OMAP_HS=y
-CONFIG_MTD=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x8
 CONFIG_SPL_NAND_SIMPLE=y
 CONFIG_NETDEVICES=y
 CONFIG_SMC911X=y
 CONFIG_SMC911X_BASE=0x2C00
 CONFIG_SMC911X_32_BIT=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
@@ -54,14 +56,13 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OMAP3=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
+CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5678
-CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_BCH=y
-CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SPL_OF_LIBFDT=y
 # CONFIG_EFI_LOADER is not set
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 1392593b9d..36bf51a1c0 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -54,51 +54,58 @@
 #define CONFIG_SYS_NAND_ECCSIZE 512
 #define CONFIG_SYS_NAND_ECCBYTES3
 #define CONFIG_NAND_OMAP_ECCSCHEME  OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
-#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x8
-#define CONFIG_ENV_IS_IN_NAND   1
-#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
-#define CONFIG_SYS_ENV_SECT_SIZE(128 << 10) /* 128 KiB */
+#define CONFIG_SYS_ENV_SECT_SIZESZ_128K
 #define CONFIG_ENV_OFFSET   0x26
 #define CONFIG_ENV_ADDR 0x26
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_MTD_PARTITIONS   /* required for UBI partition support 
*/
 /* NAND: SPL falcon mode configs */
 #if defined(CONFIG_SPL_OS_BOOT)
-#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x28
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a
 #endif /* CONFIG_SPL_OS_BOOT */
 #endif /* CONFIG_NAND */
 
-/* MUSB */
-
-/* USB EHCI */
-#define CONFIG_SYS_USB_FAT_BOOT_PARTITION  1
-
 /* Environment */
+#define CONFIG_ENV_SIZE SZ_128K
+
 #define CONFIG_PREBOOT  "usb start"
 
 #define MEM_LAYOUT_ENV_SETTINGS \
DEFAULT_LINUX

[U-Boot] [PATCH v3 0/3] ARM: omap3: beagle, evm: synchronize common setup

2018-02-26 Thread Derald D. Woods
This short series is an attempt to make this set of boards use the same
default configuration items where possible. This was prompted by an
investigation into enabling SERIAL_SEARCH_ALL on omap3_evm. This feature
now works for omap3_evm after this series.

The series changes the default NAND layout of MTDPARTS_DEFAULT. More
detail is provided with the patches. As most things are configurable
now, this should not be an issue. I am trying to get simple defaults
that just boot and expose the common core features. This will make
future testing and maintenance a bit more predictable, as there will
be a very similar and comparable set of boards.

Derald D. Woods (3):
  ARM: omap3: beagle: Set 'mtdids' and 'mtdparts' in board file
  ARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND
layout
  ARM: omap3: evm: Sync with omap3_beagle configuration

 board/ti/beagle/beagle.c   |   8 ++
 configs/omap3_beagle_defconfig |  25 -
 configs/omap3_evm_defconfig|  21 ++--
 include/configs/omap3_beagle.h | 239 +++--
 include/configs/omap3_evm.h|  71 ++--
 5 files changed, 212 insertions(+), 152 deletions(-)

--

v3:
- Leave environment in NAND

v2:
- update cover letter and remove 'RFC' from series
- rebase and test on recent master

-- 
2.16.2

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/3] ARM: omap3: beagle, evm: synchronize common setup

2018-02-25 Thread Derald D. Woods
On Sat, Feb 24, 2018 at 01:39:45PM -0600, Derald Woods wrote:
> On Sat, Feb 24, 2018 at 02:12:32PM -0500, Tom Rini wrote:
> > On Sat, Feb 24, 2018 at 09:29:02AM -0600, Derald D. Woods wrote:
> > > On Sat, Feb 24, 2018 at 09:35:43AM -0500, Tom Rini wrote:
> > > > On Sat, Feb 24, 2018 at 08:09:39AM -0600, Derald D. Woods wrote:
> > > >
> > > > > This short series is an attempt to make this set of boards use the 
> > > > > same
> > > > > default configuration items where possible. This was prompted by an
> > > > > investigation into enabling SERIAL_SEARCH_ALL on omap3_evm. This 
> > > > > feature
> > > > > now works for omap3_evm after this series.
> > > > >
> > > > > The series changes the default NAND layout of MTDPARTS_DEFAULT and
> > > > > uses ENV_IS_IN_FAT. More detail is provided with the patches. As most
> > > > > things are configurable now, this should not be an issue. I am trying
> > > > > to get simple defaults that just boot and expose the common core
> > > > > features. This will make future testing and maintenance a bit more
> > > > > predictable, as there will be a very similar comparable set of boards.
> > > >
> > > > I was thinking, wouldn't we want to update the beagle code now to do env
> > > > in NAND on beagleboard and env on FAT on xM?  We could provide a new
> > > > env_get_location() to return the right location based on board.  Thanks!
> > > >
> > >
> > > I thought of that too. xM can never use NAND. So FAT is always right for
> > > it. Regular BeagleBoard(3530) can have the environment in either location.
> > > Configuration can simply handle the user preference. I did not see a
> > > reason to add any more logic into an already heavy board file. The Overo
> > > boards are equally heavy with board type logic. For now, my thinking
> > > was to allow configuration do the work.
> >
> > OK, but on the other hand, xM must have an SD card inserted and vanilla
> > does not require an SD card.  So now those users need to put in an SD
> > card.  Now, I honestly don't know how big a deal that is really, so I
> > won't nak the patches.  But I do think it would be the best user
> > experience to have classic continue to work as-is and xM to finally get
> > functional env.
> >
> 
> I will try to add the 'env_get_location'. So let's hold until I can push a
> 'v3' of the series.
> 
> The possible env locations:
> 
> ENVL_FAT
> ENVL_MMC
> ENVL_NAND
> ENVL_UBI
> 
> If those make sense, 'env_get_location' priority will select one of them.
> 

Using 'env_get_location' is not working with this diff:

---8<--
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 1d55264733..22e6af7bb8 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "beagle.h"
 #include 
 
@@ -332,6 +333,34 @@ static struct musb_hdrc_platform_data musb_plat = {
 };
 #endif
 
+#if defined(CONFIG_SPL_BUILD) && \
+   defined(CONFIG_ENV_IS_IN_NAND) && \
+   defined(CONFIG_ENV_IS_IN_FAT)
+enum env_location env_get_location(enum env_operation op, int prio)
+{
+   switch (prio) {
+   case 0:
+   return ENVL_FAT;
+   case 1:
+   switch (get_board_revision()) {
+   case REVISION_AXBX:
+   case REVISION_CX:
+   case REVISION_C4:
+   return ENVL_NAND;
+   case REVISION_XM_AB:
+   case REVISION_XM_C:
+   default:
+   return ENVL_FAT;
+   }
+   break;
+   default:
+   break;
+   }
+
+   return ENVL_UNKNOWN;
+}
+#endif /* CONFIG_SPL_BUILD && CONFIG_ENV_IS_IN_{NAND,FAT} */
+
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
---8<---

Additionally, it will not boot without using '#if defined(CONFIG_SPL_BUILD)'.
When booting on BeagleBoard-xM, I get the following:

---8<---
U-Boot SPL 2018.03-rc3-00033-g881e2514dd-dirty (Feb 25 2018 - 12:26:00 -0600)
Trying to boot from MMC1
spl_load_image_fat_os: error reading image args, err - -2


U-Boot 2018.03-rc3-00033-g881e2514dd-dirty (Feb 25 2018 - 12:26:00 -0600)

OMAP3630/3730-GP ES1.2, CPU-OPP2, L3-200MHz, Max CPU Clock 1 GHz
Model: TI OMAP3 BeagleBoard xM
OMAP3 Beagle board + LPDDR/NAND
I2C:   ready
D

Re: [U-Boot] [PATCH v2 0/3] ARM: omap3: beagle, evm: synchronize common setup

2018-02-24 Thread Derald D. Woods
On Sat, Feb 24, 2018 at 09:35:43AM -0500, Tom Rini wrote:
> On Sat, Feb 24, 2018 at 08:09:39AM -0600, Derald D. Woods wrote:
> 
> > This short series is an attempt to make this set of boards use the same
> > default configuration items where possible. This was prompted by an
> > investigation into enabling SERIAL_SEARCH_ALL on omap3_evm. This feature
> > now works for omap3_evm after this series.
> > 
> > The series changes the default NAND layout of MTDPARTS_DEFAULT and
> > uses ENV_IS_IN_FAT. More detail is provided with the patches. As most
> > things are configurable now, this should not be an issue. I am trying
> > to get simple defaults that just boot and expose the common core
> > features. This will make future testing and maintenance a bit more
> > predictable, as there will be a very similar comparable set of boards.
> 
> I was thinking, wouldn't we want to update the beagle code now to do env
> in NAND on beagleboard and env on FAT on xM?  We could provide a new
> env_get_location() to return the right location based on board.  Thanks!
> 

I thought of that too. xM can never use NAND. So FAT is always right for
it. Regular BeagleBoard(3530) can have the environment in either location.
Configuration can simply handle the user preference. I did not see a
reason to add any more logic into an already heavy board file. The Overo
boards are equally heavy with board type logic. For now, my thinking
was to allow configuration do the work.

Derald

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 2/3] ARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND layout

2018-02-24 Thread Derald D. Woods
This commit does the following for BeagleBoard{-xM}:

- Enable DM_SERIAL which also enables SPL_DM_SERIAL
- Misc. config updates in support of DM_SERIAL
- Use CONFIG_ENV_IS_IN_FAT because BeagleBoard-xM has no NAND
- Use updated NAND layout (BeagleBoard):

device nand0 , # parts = 6

#: name sizeoffset
-
0: spl  0x0008(512k)0x
1: u-boot   0x001e(1920k)   0x0008
2: u-boot-env   0x0002(128k)0x0026
3: dtb  0x0002(128k)0x0028
4: kernel   0x0060(6m)  0x002a
5: rootfs   0x0f76(-)   0x008a
-

- Use MMC and UBIFS support from config_distro_bootcmd.h
- Use LEGACY_MMC and NAND support defined in omap3_beagle.h

[MMC(0:1)/extlinux/extlinux.conf]
---8<---
default omap3-beagle-mmc-fat
label omap3-beagle-mmc-fat
kernel /zImage
fdt /omap3-beagle.dtb
append console=ttyO2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 
rootwait
---8<---

[LEGACY_MMC(0:2)/boot/extlinux/extlinux.conf]
---8<---
default omap3-beagle-mmc-ext4
label omap3-beagle-mmc-ext4
kernel /boot/zImage
fdt /boot/omap3-beagle.dtb
append console=ttyO2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 
rootwait
---8<---

[UBIFS(ubi0:rootfs)/boot/extlinux/extlinux.conf]
---8<---
default omap3-beagle-nand-ubifs
label omap3-beagle-nand-ubifs
kernel /boot/zImage
fdt /boot/omap3-beagle.dtb
append console=ttyO2,115200n8 root=ubi0:rootfs rw ubi.mtd=rootfs 
rootfstype=ubifs rootwait
---8<---

The board's 'bootcmd' can also be overridden with:

CONFIG_BOOTCOMMAND="run findfdt; run mmcboot"
CONFIG_BOOTCOMMAND="run findfdt; run nandboot"
CONFIG_BOOTCOMMAND="run findfdt; run ramboot"

or

CONFIG_BOOTCOMMAND="run findfdt; run somethingelse"

The use of 'run findfdt' is required.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 configs/omap3_beagle_defconfig |  29 +++--
 include/configs/omap3_beagle.h | 239 +++--
 2 files changed, 155 insertions(+), 113 deletions(-)

diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
index f0169a4544..51e1976899 100644
--- a/configs/omap3_beagle_defconfig
+++ b/configs/omap3_beagle_defconfig
@@ -4,32 +4,43 @@ CONFIG_SYS_TEXT_BASE=0x8010
 CONFIG_TARGET_OMAP3_BEAGLE=y
 CONFIG_DEFAULT_DEVICE_TREE="omap3-beagle"
 CONFIG_DISTRO_DEFAULTS=y
-# CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-beagle.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
+# CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
+CONFIG_SYS_PROMPT="BeagleBoard # "
 CONFIG_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x8200
 CONFIG_CMD_SPL=y
-CONFIG_CMD_SPL_NAND_OFS=0x24
+CONFIG_CMD_SPL_NAND_OFS=0x28
+CONFIG_CMD_SPL_WRITE_SIZE=0x2
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_MTDPARTS=y
-CONFIG_MTDIDS_DEFAULT="nand0=nand"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=nand:512k(x-loader),1920k(u-boot),128k(u-boot-env),4m(kernel),-(fs)"
+CONFIG_CMD_FS_UUID=y
+CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1920k(u-boot),128k(u-boot-env),128k(dtb),6m(kernel),-(rootfs)"
+CONFIG_CMD_UBI=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_OF_CONTROL=y
-CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_IS_IN_FAT=y
+CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
+CONFIG_SPL_DM=y
 CONFIG_LED_STATUS=y
 CONFIG_LED_STATUS0=y
 CONFIG_LED_STATUS_BIT=1
@@ -45,11 +56,15 @@ CONFIG_LED_STATUS_CMD=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x8
 CONFIG_SPL_NAND_SIMPLE=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OMAP3=y
 CONFI

[U-Boot] [PATCH v2 1/3] ARM: omap3: beagle: Set 'mtdids' and 'mtdparts' in board file

2018-02-24 Thread Derald D. Woods
BeagleBoard 'xM' does not really have NAND. CONFIG_MTDIDS_DEFAULT and
CONFIG_MTDPARTS_DEFAULT can/should be empty for 'xM'. This commit sets
the defined values if they exist.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 board/ti/beagle/beagle.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index d8402f2675..1d55264733 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -521,6 +521,14 @@ int misc_init_r(void)
if (generate_fake_mac)
omap_die_id_usbethaddr();
 
+#if defined(CONFIG_MTDIDS_DEFAULT) && defined(CONFIG_MTDPARTS_DEFAULT)
+   if (strlen(CONFIG_MTDIDS_DEFAULT))
+   env_set("mtdids", CONFIG_MTDIDS_DEFAULT);
+
+   if (strlen(CONFIG_MTDPARTS_DEFAULT))
+   env_set("mtdparts", CONFIG_MTDPARTS_DEFAULT);
+#endif
+
return 0;
 }
 
-- 
2.16.2

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 3/3] ARM: omap3: evm: Sync with omap3_beagle configuration

2018-02-24 Thread Derald D. Woods
This commit does the following for OMAP3 EVM:

- Track omap3_beagle changes where possible
- Remove CONFIG_SYS_MPUCLK and CONFIG_MTD which are not needed for the
  default board configuration to work.
- Remove CONFIG_SPL_SYS_MALLOC_SIMPLE and CONFIG_SYS_MALLOC_F_LEN from
  default config. CONFIG_SYS_MALLOC_F_LEN=0x400 is set by configuration
  automatically. [allows board to boot with SERIAL_SEARCH_ALL=y]
- Use CONFIG_ENV_IS_IN_FAT because of development flexibility
- Use updated NAND layout:

device nand0 , # parts = 6

#: name sizeoffset
-
0: spl  0x0008(512k)0x
1: u-boot   0x001e(1920k)   0x0008
2: u-boot-env   0x0002(128k)0x0026
3: dtb  0x0002(128k)0x0028
4: kernel   0x0060(6m)  0x002a
5: rootfs   0x0f76(-)   0x008a
-

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 configs/omap3_evm_defconfig | 25 +---
 include/configs/omap3_evm.h | 71 ++---
 2 files changed, 55 insertions(+), 41 deletions(-)

diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 34998777a0..6ed470fe1e 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -1,22 +1,22 @@
 CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
-CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_DEFAULT_DEVICE_TREE="omap3-evm"
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_ENV_SUPPORT=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_PROMPT="OMAP3_EVM # "
-# CONFIG_CMD_IMI is not set
+CONFIG_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x8200
+CONFIG_CMD_SPL=y
+CONFIG_CMD_SPL_NAND_OFS=0x28
+CONFIG_CMD_SPL_WRITE_SIZE=0x2
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -30,23 +30,27 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FS_UUID=y
 CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1792k(u-boot),128k(dtb),128k(u-boot-env),6m(kernel),-(rootfs)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1920k(u-boot),128k(u-boot-env),128k(dtb),6m(kernel),-(rootfs)"
 CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_OF_CONTROL=y
-CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_IS_IN_FAT=y
+CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SPL_DM=y
 CONFIG_MMC_OMAP_HS=y
-CONFIG_MTD=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x8
 CONFIG_SPL_NAND_SIMPLE=y
 CONFIG_NETDEVICES=y
 CONFIG_SMC911X=y
 CONFIG_SMC911X_BASE=0x2C00
 CONFIG_SMC911X_32_BIT=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
@@ -54,14 +58,13 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OMAP3=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
+CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5678
-CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_BCH=y
-CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SPL_OF_LIBFDT=y
 # CONFIG_EFI_LOADER is not set
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 1392593b9d..36bf51a1c0 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -54,51 +54,58 @@
 #define CONFIG_SYS_NAND_ECCSIZE 512
 #define CONFIG_SYS_NAND_ECCBYTES3
 #define CONFIG_NAND_OMAP_ECCSCHEME  OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
-#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x8
-#define CONFIG_ENV_IS_IN_NAND   1
-#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
-#define CONFIG_SYS_ENV_SECT_SIZE(128 << 10) /* 128 KiB */
+#define CONFIG_SYS_ENV_SECT_SIZESZ_128K
 #define CONFIG_ENV_OFFSET   0x26
 #define CONFIG_ENV_ADDR 0x26
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_MTD_PARTITIONS   /* required for UBI partition support 
*/
 /* NAND: SPL falcon mode configs */
 #if defined(CONFIG_SPL_OS_BOOT)
-#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x28
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a
 #endif /* CONFIG_SPL_OS_BOOT */
 #endif /* CONFIG_NAND */
 
-/* MUSB */
-
-/* USB EHCI */
-#define CONFIG_SYS_USB_FAT_BOOT_

[U-Boot] [PATCH v2 0/3] ARM: omap3: beagle, evm: synchronize common setup

2018-02-24 Thread Derald D. Woods
This short series is an attempt to make this set of boards use the same
default configuration items where possible. This was prompted by an
investigation into enabling SERIAL_SEARCH_ALL on omap3_evm. This feature
now works for omap3_evm after this series.

The series changes the default NAND layout of MTDPARTS_DEFAULT and
uses ENV_IS_IN_FAT. More detail is provided with the patches. As most
things are configurable now, this should not be an issue. I am trying
to get simple defaults that just boot and expose the common core
features. This will make future testing and maintenance a bit more
predictable, as there will be a very similar comparable set of boards.

Derald D. Woods (3):
  ARM: omap3: beagle: Set 'mtdids' and 'mtdparts' in board file
  ARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND
layout
  ARM: omap3: evm: Sync with omap3_beagle configuration

 board/ti/beagle/beagle.c   |   8 ++
 configs/omap3_beagle_defconfig |  29 -
 configs/omap3_evm_defconfig|  25 +++--
 include/configs/omap3_beagle.h | 241 +++--
 include/configs/omap3_evm.h|  71 +++-
 5 files changed, 220 insertions(+), 154 deletions(-)

--

v2:
- update cover letter and remove 'RFC' from series
- rebase and test on recent master

-- 
2.16.2

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [RFC PATCH 1/3] ARM: omap3: beagle: Set 'mtdids' and 'mtdparts' in board file

2018-02-11 Thread Derald D. Woods
BeagleBoard 'xM' does not really have NAND. CONFIG_MTDIDS_DEFAULT and
CONFIG_MTDPARTS_DEFAULT can/should be empty for 'xM'. This commit sets
the defined values if they exist.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 board/ti/beagle/beagle.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index d8402f2675..1d55264733 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -521,6 +521,14 @@ int misc_init_r(void)
if (generate_fake_mac)
omap_die_id_usbethaddr();
 
+#if defined(CONFIG_MTDIDS_DEFAULT) && defined(CONFIG_MTDPARTS_DEFAULT)
+   if (strlen(CONFIG_MTDIDS_DEFAULT))
+   env_set("mtdids", CONFIG_MTDIDS_DEFAULT);
+
+   if (strlen(CONFIG_MTDPARTS_DEFAULT))
+   env_set("mtdparts", CONFIG_MTDPARTS_DEFAULT);
+#endif
+
return 0;
 }
 
-- 
2.16.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [RFC PATCH 3/3] ARM: omap3: evm: Sync with omap3_beagle configuration

2018-02-11 Thread Derald D. Woods
This commit does the following for OMAP3 EVM:

- Track omap3_beagle changes where possible
- Remove CONFIG_SYS_MPUCLK and CONFIG_MTD which are not needed for the
  default board configuration to work.
- Remove CONFIG_SPL_SYS_MALLOC_SIMPLE and CONFIG_SYS_MALLOC_F_LEN from
  default config. CONFIG_SYS_MALLOC_F_LEN=0x400 is set by configuration
  automatically. [allows board to boot with SERIAL_SEARCH_ALL=y]
- Use CONFIG_ENV_IS_IN_FAT because of development flexibility
- Use updated NAND layout:

device nand0 , # parts = 6

#: name sizeoffset
-
0: spl  0x0008(512k)0x
1: u-boot   0x001e(1920k)   0x0008
2: u-boot-env   0x0002(128k)0x0026
3: dtb  0x0002(128k)0x0028
4: kernel   0x0060(6m)  0x002a
5: rootfs   0x0f76(-)   0x008a
-

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 configs/omap3_evm_defconfig | 25 +---
 include/configs/omap3_evm.h | 71 ++---
 2 files changed, 55 insertions(+), 41 deletions(-)

diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 34998777a0..6ed470fe1e 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -1,22 +1,22 @@
 CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
-CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_DEFAULT_DEVICE_TREE="omap3-evm"
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_ENV_SUPPORT=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_PROMPT="OMAP3_EVM # "
-# CONFIG_CMD_IMI is not set
+CONFIG_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x8200
+CONFIG_CMD_SPL=y
+CONFIG_CMD_SPL_NAND_OFS=0x28
+CONFIG_CMD_SPL_WRITE_SIZE=0x2
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -30,23 +30,27 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FS_UUID=y
 CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1792k(u-boot),128k(dtb),128k(u-boot-env),6m(kernel),-(rootfs)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1920k(u-boot),128k(u-boot-env),128k(dtb),6m(kernel),-(rootfs)"
 CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_OF_CONTROL=y
-CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_IS_IN_FAT=y
+CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_SPL_DM=y
 CONFIG_MMC_OMAP_HS=y
-CONFIG_MTD=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x8
 CONFIG_SPL_NAND_SIMPLE=y
 CONFIG_NETDEVICES=y
 CONFIG_SMC911X=y
 CONFIG_SMC911X_BASE=0x2C00
 CONFIG_SMC911X_32_BIT=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
@@ -54,14 +58,13 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OMAP3=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
+CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5678
-CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_BCH=y
-CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SPL_OF_LIBFDT=y
 # CONFIG_EFI_LOADER is not set
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index c143c5af5c..d74be94c79 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -56,26 +56,20 @@
 #define CONFIG_SYS_NAND_ECCSIZE 512
 #define CONFIG_SYS_NAND_ECCBYTES3
 #define CONFIG_NAND_OMAP_ECCSCHEME  OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
-#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x8
-#define CONFIG_ENV_IS_IN_NAND   1
-#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
-#define CONFIG_SYS_ENV_SECT_SIZE(128 << 10) /* 128 KiB */
+#define CONFIG_SYS_ENV_SECT_SIZESZ_128K
 #define CONFIG_ENV_OFFSET   0x26
 #define CONFIG_ENV_ADDR 0x26
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_MTD_PARTITIONS   /* required for UBI partition support 
*/
 /* NAND: SPL falcon mode configs */
 #if defined(CONFIG_SPL_OS_BOOT)
-#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x28
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a
 #endif /* CONFIG_SPL_OS_BOOT */
 #endif /* CONFIG_NAND */
 
-/* MUSB */
-
-/* USB EHCI */
-#define CONFIG_SYS_USB_FAT_BOOT_

[U-Boot] [RFC PATCH 0/3] ARM: omap3: beagle, evm: synchronize common setup

2018-02-11 Thread Derald D. Woods
This short series is an attempt to make this set of boards use the same
default configuration items where possible. This was prompted by an
investigation into enabling SERIAL_SEARCH_ALL on omap3_evm. This feature
now works for omap3_evm after this series.

The 'RFC' is because of changes in the default NAND layout of
MTDPARTS_DEFAULT and using ENV_IS_IN_FAT. More detail is provided with
the patches. As most things are configurable now, this should not be an
issue. I am trying to get simple defaults that just boot and expose the
common core features.


Derald D. Woods (3):
  ARM: omap3: beagle: Set 'mtdids' and 'mtdparts' in board file
  ARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND
layout
  ARM: omap3: evm: Sync with omap3_beagle configuration

 board/ti/beagle/beagle.c   |   8 ++
 configs/omap3_beagle_defconfig |  29 -
 configs/omap3_evm_defconfig|  25 +++--
 include/configs/omap3_beagle.h | 241 +++--
 include/configs/omap3_evm.h|  71 +++-
 5 files changed, 220 insertions(+), 154 deletions(-)

-- 
2.16.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [RFC PATCH 2/3] ARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND layout

2018-02-11 Thread Derald D. Woods
This commit does the following for BeagleBoard{-xM}:

- Enable DM_SERIAL which also enables SPL_DM_SERIAL
- Misc. config updates in support of DM_SERIAL
- Use CONFIG_ENV_IS_IN_FAT because BeagleBoard-xM has no NAND
- Use updated NAND layout (BeagleBoard):

device nand0 , # parts = 6

#: name sizeoffset
-
0: spl  0x0008(512k)0x
1: u-boot   0x001e(1920k)   0x0008
2: u-boot-env   0x0002(128k)0x0026
3: dtb  0x0002(128k)0x0028
4: kernel   0x0060(6m)  0x002a
5: rootfs   0x0f76(-)   0x008a
-

- Use MMC and UBIFS support from config_distro_bootcmd.h
- Use LEGACY_MMC and NAND support defined in omap3_beagle.h

[MMC(0:1)/extlinux/extlinux.conf]
---8<---
default omap3-beagle-mmc-fat
label omap3-beagle-mmc-fat
kernel /zImage
fdt /omap3-beagle.dtb
append console=ttyO2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 
rootwait
---8<---

[LEGACY_MMC(0:2)/boot/extlinux/extlinux.conf]
---8<---
default omap3-beagle-mmc-ext4
label omap3-beagle-mmc-ext4
kernel /boot/zImage
fdt /boot/omap3-beagle.dtb
append console=ttyO2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 
rootwait
---8<---

[UBIFS(ubi0:rootfs)/boot/extlinux/extlinux.conf]
---8<---
default omap3-beagle-nand-ubifs
label omap3-beagle-nand-ubifs
kernel /boot/zImage
fdt /boot/omap3-beagle.dtb
append console=ttyO2,115200n8 root=ubi0:rootfs rw ubi.mtd=rootfs 
rootfstype=ubifs rootwait
---8<---

The board's 'bootcmd' can also be overridden with:

CONFIG_BOOTCOMMAND="run findfdt; run mmcboot"
CONFIG_BOOTCOMMAND="run findfdt; run nandboot"
CONFIG_BOOTCOMMAND="run findfdt; run ramboot"

or

CONFIG_BOOTCOMMAND="run findfdt; run somethingelse"

The use of 'run findfdt' is required.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 configs/omap3_beagle_defconfig |  29 -
 include/configs/omap3_beagle.h | 241 +++--
 2 files changed, 157 insertions(+), 113 deletions(-)

diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
index f0169a4544..51e1976899 100644
--- a/configs/omap3_beagle_defconfig
+++ b/configs/omap3_beagle_defconfig
@@ -4,32 +4,43 @@ CONFIG_SYS_TEXT_BASE=0x8010
 CONFIG_TARGET_OMAP3_BEAGLE=y
 CONFIG_DEFAULT_DEVICE_TREE="omap3-beagle"
 CONFIG_DISTRO_DEFAULTS=y
-# CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-beagle.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
+# CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
+CONFIG_SYS_PROMPT="BeagleBoard # "
 CONFIG_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x8200
 CONFIG_CMD_SPL=y
-CONFIG_CMD_SPL_NAND_OFS=0x24
+CONFIG_CMD_SPL_NAND_OFS=0x28
+CONFIG_CMD_SPL_WRITE_SIZE=0x2
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
+CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_MTDPARTS=y
-CONFIG_MTDIDS_DEFAULT="nand0=nand"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=nand:512k(x-loader),1920k(u-boot),128k(u-boot-env),4m(kernel),-(fs)"
+CONFIG_CMD_FS_UUID=y
+CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1920k(u-boot),128k(u-boot-env),128k(dtb),6m(kernel),-(rootfs)"
+CONFIG_CMD_UBI=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_OF_CONTROL=y
-CONFIG_ENV_IS_IN_NAND=y
+CONFIG_ENV_IS_IN_FAT=y
+CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
+CONFIG_SPL_DM=y
 CONFIG_LED_STATUS=y
 CONFIG_LED_STATUS0=y
 CONFIG_LED_STATUS_BIT=1
@@ -45,11 +56,15 @@ CONFIG_LED_STATUS_CMD=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x8
 CONFIG_SPL_NAND_SIMPLE=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OMAP3=y
 CONFI

[U-Boot] [PATCH 2/2] ARM: omap3: evm: Remove CONFIG_SYS_NS16550_REG_SIZE undefine

2018-02-04 Thread Derald D. Woods
This commit removes an attempt to workaround a previous compilation
warning that is is now fixed in "include/configs/ti_omap3_common.h".

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 include/configs/omap3_evm.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 71d49e3cd3..c143c5af5c 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -40,9 +40,6 @@
 #undef CONFIG_CONS_INDEX
 #define CONFIG_CONS_INDEX   1
 #define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
-#if defined(CONFIG_SPL_BUILD)
-#undef CONFIG_SYS_NS16550_REG_SIZE
-#endif /* CONFIG_SPL_BUILD */
 
 /* NAND */
 #if defined(CONFIG_NAND)
-- 
2.16.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/2] ARM: omap3: ti_omap3_common: Fix CONFIG_SYS_NS16550_REG_SIZE compiler warning

2018-02-04 Thread Derald D. Woods
This commit fixes the following compiler warnings when DM_SERIAL is
enabled.

---8<---
...

  CC  spl/board/ti/evm/evm.o
In file included from /solution/scm/u-boot-master/board/ti/evm/evm.c:16:0:
/solution/scm/u-boot-master/include/ns16550.h:31:0: warning: 
"CONFIG_SYS_NS16550_REG_SIZE" redefined
 #define CONFIG_SYS_NS16550_REG_SIZE (-1)

In file included from 
/solution/scm/u-boot-master/include/configs/omap3_evm.h:22:0,
 from include/config.h:5,
 from /solution/scm/u-boot-master/include/common.h:21,
 from /solution/scm/u-boot-master/board/ti/evm/evm.c:14:
/solution/scm/u-boot-master/include/configs/ti_omap3_common.h:33:0: note: this 
is the location of the previous definition
 # define CONFIG_SYS_NS16550_REG_SIZE (-4)

  LD  spl/board/ti/evm/built-in.o

...

  CC  spl/drivers/serial/ns16550.o
In file included from /solution/scm/u-boot-master/drivers/serial/ns16550.c:11:0:
/solution/scm/u-boot-master/include/ns16550.h:31:0: warning: 
"CONFIG_SYS_NS16550_REG_SIZE" redefined
 #define CONFIG_SYS_NS16550_REG_SIZE (-1)

In file included from 
/solution/scm/u-boot-master/include/configs/omap3_evm.h:22:0,
 from include/config.h:5,
 from /solution/scm/u-boot-master/include/common.h:21,
 from /solution/scm/u-boot-master/drivers/serial/ns16550.c:7:
/solution/scm/u-boot-master/include/configs/ti_omap3_common.h:33:0: note: this 
is the location of the previous definition
 # define CONFIG_SYS_NS16550_REG_SIZE (-4)

  LD  spl/drivers/serial/built-in.o

...
---8<-------

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 include/configs/ti_omap3_common.h | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/configs/ti_omap3_common.h 
b/include/configs/ti_omap3_common.h
index 72c4b184d9..cd6a9c2197 100644
--- a/include/configs/ti_omap3_common.h
+++ b/include/configs/ti_omap3_common.h
@@ -28,10 +28,12 @@
 /* NS16550 Configuration */
 #define V_NS16550_CLK  4800/* 48MHz (APLL96/2) */
 #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
-#ifdef CONFIG_SPL_BUILD
-# define CONFIG_SYS_NS16550_SERIAL
-# define CONFIG_SYS_NS16550_REG_SIZE   (-4)
-#endif
+#if defined(CONFIG_SPL_BUILD)
+#define CONFIG_SYS_NS16550_SERIAL
+#if !defined(CONFIG_DM_SERIAL)
+#define CONFIG_SYS_NS16550_REG_SIZE(-4)
+#endif /* !CONFIG_DM_SERIAL */
+#endif /* CONFIG_SPL_BUILD */
 #define CONFIG_SYS_BAUDRATE_TABLE  {4800, 9600, 19200, 38400, 57600, \
115200}
 
-- 
2.16.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 0/2] ARM: omap3: evm: Fix serial driver compiler warnings

2018-02-04 Thread Derald D. Woods
This small series resolves compiler warnings that are generated when DM_SERIAL
is enabled for OMAP3 boards using "include/configs/ti_omap3_common.h".

Derald D. Woods (2):
  ARM: omap3: ti_omap3_common: Fix CONFIG_SYS_NS16550_REG_SIZE compiler warning
  ARM: omap3: evm: Remove CONFIG_SYS_NS16550_REG_SIZE undefine

 include/configs/omap3_evm.h   |  3 ---
 include/configs/ti_omap3_common.h | 10 ++
 2 files changed, 6 insertions(+), 7 deletions(-)

-- 
2.16.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] serial: Make full device search optional

2018-01-29 Thread Derald D. Woods
On Mon, Jan 29, 2018 at 07:46:09AM -0600, Derald Woods wrote:
> On Jan 29, 2018 6:57 AM, "Alexander Graf" <ag...@suse.de> wrote:
> 
> Commit 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
> added code to search for more serial devices if the default one was not
> probed correctly.
> 
> Unfortunately, that breaks omap3_evm. So while investigating why that is
> the case, let's disable the full search for everyone but bcm283x where it
> is needed.
> 
> Fixes: 608b0c4ad4e5ec0c ("serial: Use next serial device if probing fails")
> Reported-by: Derald D. Woods <woods.techni...@gmail.com>
> Signed-off-by: Alexander Graf <ag...@suse.de>
> 
> ---
> 
> Derald, could you please test this patch and verify it does indeed unbreak
> omap3_evm?
> 

The omap3_evm boots now with this patch applied on master. If I enable
SERIAL_SEARCH_ALL, it does not boot. I always build cleanly using the
default config only. On failure, there is no console input/output and
the board unresponsive.

Derald

> 
> 
> I will check later today. The board is not with me at the moment.
> 
> Derald
> 
> 
> 
> Thanks!
> ---
>  arch/arm/Kconfig   |  1 +
>  drivers/serial/Kconfig | 12 
>  drivers/serial/serial-uclass.c | 13 +
>  3 files changed, 26 insertions(+)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 30a6f6dc53..a423aa9629 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -550,6 +550,7 @@ config ARCH_BCM283X
> select DM_GPIO
> select OF_CONTROL
> select PL01X_SERIAL
> +   select SERIAL_SEARCH_ALL
> imply FAT_WRITE
> 
>  config TARGET_VEXPRESS_CA15_TC2
> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> index 3ffedba525..93e602e0ee 100644
> --- a/drivers/serial/Kconfig
> +++ b/drivers/serial/Kconfig
> @@ -79,6 +79,18 @@ config SERIAL_RX_BUFFER_SIZE
> help
>   The size of the RX buffer (needs to be power of 2)
> 
> +config SERIAL_SEARCH_ALL
> +   bool "Search for serial devices after default one failed"
> +   depends on DM_SERIAL
> +   help
> + The serial subsystem only searches for a single serial device
> + that was instantiated, but does not check whether it was probed
> + correctly. With this option set, we make successful probing
> + mandatory and search for fallback serial devices if the default
> + device does not work.
> +
> + If unsure, say N.
> +
>  config SPL_DM_SERIAL
> bool "Enable Driver Model for serial drivers in SPL"
> depends on DM_SERIAL
> diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
> index 68ca2d09d1..9891c20656 100644
> --- a/drivers/serial/serial-uclass.c
> +++ b/drivers/serial/serial-uclass.c
> @@ -74,7 +74,9 @@ static void serial_find_console_or_panic(void)
>  {
> const void *blob = gd->fdt_blob;
> struct udevice *dev;
> +#ifdef CONFIG_SERIAL_SEARCH_ALL
> int ret;
> +#endif
> 
> if (CONFIG_IS_ENABLED(OF_PLATDATA)) {
> uclass_first_device(UCLASS_SERIAL, );
> @@ -113,6 +115,8 @@ static void serial_find_console_or_panic(void)
>  #else
>  #define INDEX 0
>  #endif
> +
> +#ifdef CONFIG_SERIAL_SEARCH_ALL
> if (!uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, ) ||
> !uclass_get_device(UCLASS_SERIAL, INDEX, )) {
> if (dev->flags & DM_FLAG_ACTIVATED) {
> @@ -131,6 +135,15 @@ static void serial_find_console_or_panic(void)
> return;
> }
> }
> +#else
> +   if (!uclass_get_device_by_seq(UCLASS_SERIAL, INDEX, ) ||
> +   !uclass_get_device(UCLASS_SERIAL, INDEX, ) ||
> +   (!uclass_first_device(UCLASS_SERIAL, ) && dev)) {
> +   gd->cur_serial_dev = dev;
> +   return;
> +   }
> +#endif
> +
>  #undef INDEX
> }
> 
> --
> 2.12.3
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v3, 01/15] serial: Use next serial device if probing fails

2018-01-28 Thread Derald D. Woods
On Sun, Jan 28, 2018 at 01:54:50PM -0500, Tom Rini wrote:
> On Thu, Jan 25, 2018 at 12:05:42PM +0100, Alexander Graf wrote:
> 
> > Currently our serial device search chokes on the fact that the serial
> > probe function could fail. If it does, instead of searching for the next
> > usable serial device, it just quits.
> > 
> > This patch changes the fallback logic so that even when a serial device
> > was not probed correctly, we just try the next ones until we find one that
> > works.
> > 
> > Signed-off-by: Alexander Graf 
> > Reviewed-by: Simon Glass 
> 
> Applied to u-boot/master, thanks!
> 
> -- 
> Tom

Is there something, at the board level, that needs to be coded to
support this patch? The omap3_evm fails to boot with this patch applied.
Reverting it allows omap3_evm to boot again. I am testing with the base
default config for omap3_evm.

Derald

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2] Convert CONFIG_SYS_BOOT_GET_{CMDLINE, KBD} to Kconfig

2018-01-22 Thread Derald D. Woods
This converts the following to Kconfig:
CONFIG_SYS_BOOT_GET_CMDLINE
CONFIG_SYS_BOOT_GET_KBD

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
v2:
- Drop selection for ARM

---
 Kconfig   | 12 
 arch/Kconfig  |  4 
 arch/m68k/include/asm/config.h|  2 --
 arch/powerpc/include/asm/config.h |  2 --
 scripts/config_whitelist.txt  |  2 --
 5 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/Kconfig b/Kconfig
index 9b8a807799..f713c6a9b1 100644
--- a/Kconfig
+++ b/Kconfig
@@ -83,6 +83,18 @@ config DISTRO_DEFAULTS
  Select this to enable various options and commands which are suitable
  for building u-boot for booting general purpose Linux distributions.
 
+config SYS_BOOT_GET_CMDLINE
+   bool "Enable kernel command line setup"
+   help
+ Enables allocating and saving kernel cmdline in space between
+ "bootm_low" and "bootm_low" + BOOTMAPSZ.
+
+config SYS_BOOT_GET_KBD
+   bool "Enable kernel board information setup"
+   help
+ Enables allocating and saving a kernel copy of the bd_info in
+ space between "bootm_low" and "bootm_low" + BOOTMAPSZ.
+
 config SYS_MALLOC_F
bool "Enable malloc() pool before relocation"
default y if DM
diff --git a/arch/Kconfig b/arch/Kconfig
index 762230cd56..5d57d6da2c 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -26,6 +26,8 @@ config ARM
 config M68K
bool "M68000 architecture"
select HAVE_PRIVATE_LIBGCC
+   select SYS_BOOT_GET_CMDLINE
+   select SYS_BOOT_GET_KBD
 
 config MICROBLAZE
bool "MicroBlaze architecture"
@@ -53,6 +55,8 @@ config PPC
bool "PowerPC architecture"
select HAVE_PRIVATE_LIBGCC
select SUPPORT_OF_CONTROL
+   select SYS_BOOT_GET_CMDLINE
+   select SYS_BOOT_GET_KBD
 
 config RISCV
bool "riscv architecture"
diff --git a/arch/m68k/include/asm/config.h b/arch/m68k/include/asm/config.h
index 9c4d3fb8fd..fd0b5513ee 100644
--- a/arch/m68k/include/asm/config.h
+++ b/arch/m68k/include/asm/config.h
@@ -11,7 +11,5 @@
 
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
-#define CONFIG_SYS_BOOT_GET_CMDLINE
-#define CONFIG_SYS_BOOT_GET_KBD
 
 #endif
diff --git a/arch/powerpc/include/asm/config.h 
b/arch/powerpc/include/asm/config.h
index 6aec815c71..67e4b48a96 100644
--- a/arch/powerpc/include/asm/config.h
+++ b/arch/powerpc/include/asm/config.h
@@ -31,8 +31,6 @@
 
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
-#define CONFIG_SYS_BOOT_GET_CMDLINE
-#define CONFIG_SYS_BOOT_GET_KBD
 
 #ifndef CONFIG_MAX_MEM_MAPPED
 #ifdefined(CONFIG_E500)|| \
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index c98f262079..6e9750eb16 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2273,8 +2273,6 @@ CONFIG_SYS_BOOTM_LEN
 CONFIG_SYS_BOOTPARAMS_LEN
 CONFIG_SYS_BOOTSZ
 CONFIG_SYS_BOOT_BLOCK
-CONFIG_SYS_BOOT_GET_CMDLINE
-CONFIG_SYS_BOOT_GET_KBD
 CONFIG_SYS_BOOT_RAMDISK_HIGH
 CONFIG_SYS_BR0_64M
 CONFIG_SYS_BR0_8M
-- 
2.16.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] ARM: omap3: evm: Fix distro bootcmd UBIFS and MMC support

2018-01-20 Thread Derald D. Woods
The omap3_evm board does not boot when commit:
a47ca2cf67 ("ARM: omap3: evm: Add kernel image loading from UBIFS and EXT4")
is applied after commit:
3dde8f2037 ("Merge git://git.denx.de/u-boot-mmc")

This commit reduces the CONFIG_EXTRA_ENV_SETTINGS size and better
leverages the existing distro bootcmd infrastructure.

- Use updated UBIFS support from config_distro_bootcmd.h
- Use LEGACY_MMC naming found in am335x_evm.h and ti_omap4_common.h
- Remove extra environment content that is no longer needed

[MMC(0:1)/extlinux/extlinux.conf]
---8<---
default omap3-evm-mmc-fat
label omap3-evm-mmc-fat
kernel /zImage
fdt /omap3-evm.dtb
append console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 
rootwait
---8<---

[MMC(0:2)/boot/extlinux/extlinux.conf]
---8<---
default omap3-evm-mmc-ext4
label omap3-evm-mmc-ext4
kernel /boot/zImage
fdt /boot/omap3-evm.dtb
append console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 
rootwait
---8<---

[NAND(ubi0:rootfs)/boot/extlinux/extlinux.conf]
---8<---
default omap3-evm-nand-ubifs
label omap3-evm-nand-ubifs
kernel /boot/zImage
fdt /boot/omap3-evm.dtb
append console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=rootfs 
noinitrd rootfstype=ubifs rootwait
---8<---

Fixes: a47ca2cf67 ("ARM: omap3: evm: Add kernel image loading from UBIFS and 
EXT4")
Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 include/configs/omap3_evm.h | 80 ++---
 1 file changed, 25 insertions(+), 55 deletions(-)

diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 3ecfdbb3ce..c329d97528 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -89,43 +89,24 @@
 #define MEM_LAYOUT_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV
 
-#if defined(CONFIG_NAND) && defined(CONFIG_CMD_UBI)
-/* NAND boot with uImage from NAND 'kernel' partition */
 #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
"bootcmd_" #devtypel #instance "=" \
"run nandboot\0"
 #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
#devtypel #instance " "
 
-/* NAND boot with zImage from UBIFS '/boot/zImage' */
-#define BOOTENV_DEV_UBIFS_NAND(devtypeu, devtypel, instance) \
+#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
"bootcmd_" #devtypel #instance "=" \
-   "run nandbootubifs\0"
-#define BOOTENV_DEV_NAME_UBIFS_NAND(devtypeu, devtypel, instance) \
-   #devtypel #instance " "
-#endif /* CONFIG_NAND && CONFIG_CMD_UBI */
-
-/* MMC boot with uImage from MMC 0:2 '/boot/uImage' */
-#define BOOTENV_DEV_UIMAGE_MMC(devtypeu, devtypel, instance) \
-   "bootcmd_" #devtypel #instance "=" \
-   "setenv mmcdev " #instance"; " \
-   "run mmcboot\0"
-#define BOOTENV_DEV_NAME_UIMAGE_MMC(devtypeu, devtypel, instance) \
-   #devtypel #instance " "
-
-/* MMC boot with zImage from MMC 0:2 '/boot/zImage' */
-#define BOOTENV_DEV_ZIMAGE_MMC(devtypeu, devtypel, instance) \
-   "bootcmd_" #devtypel #instance "=" \
-   "setenv mmcdev " #instance"; " \
-   "run mmcbootz\0"
-#define BOOTENV_DEV_NAME_ZIMAGE_MMC(devtypeu, devtypel, instance) \
+   "setenv mmcdev " #instance "; " \
+   "setenv bootpart " #instance ":${mmcpart} ; " \
+   "run mmcboot\0"
+#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
#devtypel #instance " "
 
 #define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
-   func(ZIMAGE_MMC, zimage_mmc, 0) \
-   func(UIMAGE_MMC, uimage_mmc, 0) \
-   func(UBIFS_NAND, ubifs_nand, 0) \
+   func(LEGACY_MMC, legacy_mmc, 0) \
+   func(UBIFS, ubifs, 0) \
func(NAND, nand, 0)
 
 #include 
@@ -138,9 +119,13 @@
"fdt_high=0x\0" \
"bootdir=/boot\0" \
"bootenv=uEnv.txt\0" \
+   "bootfile=zImage\0" \
+   "bootubivol=rootfs\0" \
+   "bootubipart=rootfs\0" \
"optargs=\0" \
"mmcdev=0\0" \
"mmcpart=2\0" \
+   "bootpart=${mmcdev}:${mmcpart}\0" \
"console=ttyO0,115200n8\0" \
"mmcargs=setenv bootargs co

[U-Boot] [PATCH 1/2] distro bootcmd: Allow board defined UBI partition and volume names

2018-01-20 Thread Derald D. Woods
This commit allows overriding the default assumption that the boot UBI
MTD partition is named 'UBI' and the UBI volume is 'boot'. A board
desiring to use a legacy or alternative NAND layout can now define the
following two extra environment variables:

bootubipart=
bootubivol=

EXAMPLE:

[include/configs/some_board.h]
---8<---
[...]
#include 

#define MEM_LAYOUT_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV

#define BOOT_TARGET_DEVICES(func) \
func(UBIFS, ubifs, 0)

#include 
[...]
#define CONFIG_EXTRA_ENV_SETTINGS \
MEM_LAYOUT_ENV_SETTINGS \
"bootubivol=rootfs\0" \
"bootubipart=rootfs\0" \
BOOTENV
[...]
---8<-------

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 include/config_distro_bootcmd.h | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 5c469a23fa..f567cebd38 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -71,10 +71,15 @@
 #ifdef CONFIG_CMD_UBIFS
 #define BOOTENV_SHARED_UBIFS \
"ubifs_boot=" \
-   "if ubi part UBI && ubifsmount ubi${devnum}:boot; then "  \
-   "setenv devtype ubi; "\
-   "setenv bootpart 0; " \
-   "run scan_dev_for_boot; " \
+   "env exists bootubipart || " \
+   "env set bootubipart UBI; " \
+   "env exists bootubivol || " \
+   "env set bootubivol boot; " \
+   "if ubi part ${bootubipart} && " \
+   "ubifsmount ubi${devnum}:${bootubivol}; " \
+   "then " \
+   "setenv devtype ubi; " \
+   "run scan_dev_for_boot; " \
"fi\0"
 #define BOOTENV_DEV_UBIFS  BOOTENV_DEV_BLKDEV
 #define BOOTENV_DEV_NAME_UBIFS BOOTENV_DEV_NAME_BLKDEV
@@ -125,7 +130,7 @@
"${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; "  \
"if fdt addr ${fdt_addr_r}; then "\
"bootefi ${kernel_addr_r} ${fdt_addr_r};" \
-   "else "\
+   "else "   \
"bootefi ${kernel_addr_r} ${fdtcontroladdr};" \
"fi\0"\
\
-- 
2.16.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 0/2] ARM: omap3: evm: Fix distro bootcmd

2018-01-20 Thread Derald D. Woods
This series fixes an omap3_evm boot hang on master. It contains a patch
to "config_distro_bootcmd.h" which allows board defined UBI partition and
volume names. This is used by omap3_evm to eliminate some lines of code.

Derald D. Woods (2):
  distro bootcmd: Allow board defined UBI partition and volume names
  ARM: omap3: evm: Fix distro bootcmd UBIFS and MMC support

 include/config_distro_bootcmd.h | 15 +---
 include/configs/omap3_evm.h | 80 +
 2 files changed, 35 insertions(+), 60 deletions(-)

-- 
2.16.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] ARM: omap3: evm: Add kernel image loading from UBIFS and EXT4

2018-01-06 Thread Derald D. Woods
This commit adds UBIFS_NAND to BOOT_TARGET_DEVICES. This will
allow the kernel zImage to be loaded from '/boot/zImage' in UBIFS
(ubi0:rootfs).

Additionally update the *_MMC devices to also load kernel image from
the MMC 0:2 EXT4 file system.

DISTRO_DEFAULTS Setup
=

[primary] Check MMC 0:1 for /extlinux/extlinux.conf and boot
[fallback 1] Check MMC 0:2 /boot/zImage and run mmcbootz
[fallback 2] Check MMC 0:2 /boot/uImage and run mmcboot
[fallback 3] Check NAND UBIFS /boot/zImage and run nandbootubifs
[fallback 4] Check NAND partitions and run nandboot

The following "extlinux.conf" can be used to load images in the
top-level of the MMC 0:1 FAT partition.

[MMC(0:1)/extlinux/extlinux.conf]
---8<---
default omap3-evm
label omap3-evm
kernel /zImage
fdt /omap3-evm.dtb
append console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 
rootwait
---8<---

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 include/configs/omap3_evm.h | 57 +++--
 1 file changed, 40 insertions(+), 17 deletions(-)

diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index d95ccdf035..3ecfdbb3ce 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -89,28 +89,35 @@
 #define MEM_LAYOUT_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV
 
-#if defined(CONFIG_NAND)
+#if defined(CONFIG_NAND) && defined(CONFIG_CMD_UBI)
+/* NAND boot with uImage from NAND 'kernel' partition */
 #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
"bootcmd_" #devtypel #instance "=" \
"run nandboot\0"
-
 #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
#devtypel #instance " "
-#endif /* CONFIG_NAND */
 
+/* NAND boot with zImage from UBIFS '/boot/zImage' */
+#define BOOTENV_DEV_UBIFS_NAND(devtypeu, devtypel, instance) \
+   "bootcmd_" #devtypel #instance "=" \
+   "run nandbootubifs\0"
+#define BOOTENV_DEV_NAME_UBIFS_NAND(devtypeu, devtypel, instance) \
+   #devtypel #instance " "
+#endif /* CONFIG_NAND && CONFIG_CMD_UBI */
+
+/* MMC boot with uImage from MMC 0:2 '/boot/uImage' */
 #define BOOTENV_DEV_UIMAGE_MMC(devtypeu, devtypel, instance) \
"bootcmd_" #devtypel #instance "=" \
"setenv mmcdev " #instance"; " \
"run mmcboot\0"
-
 #define BOOTENV_DEV_NAME_UIMAGE_MMC(devtypeu, devtypel, instance) \
#devtypel #instance " "
 
+/* MMC boot with zImage from MMC 0:2 '/boot/zImage' */
 #define BOOTENV_DEV_ZIMAGE_MMC(devtypeu, devtypel, instance) \
"bootcmd_" #devtypel #instance "=" \
"setenv mmcdev " #instance"; " \
"run mmcbootz\0"
-
 #define BOOTENV_DEV_NAME_ZIMAGE_MMC(devtypeu, devtypel, instance) \
#devtypel #instance " "
 
@@ -118,6 +125,7 @@
func(MMC, mmc, 0) \
func(ZIMAGE_MMC, zimage_mmc, 0) \
func(UIMAGE_MMC, uimage_mmc, 0) \
+   func(UBIFS_NAND, ubifs_nand, 0) \
func(NAND, nand, 0)
 
 #include 
@@ -128,9 +136,11 @@
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
"fdt_high=0x\0" \
+   "bootdir=/boot\0" \
"bootenv=uEnv.txt\0" \
"optargs=\0" \
"mmcdev=0\0" \
+   "mmcpart=2\0" \
"console=ttyO0,115200n8\0" \
"mmcargs=setenv bootargs console=${console} " \
"${mtdparts} " \
@@ -143,39 +153,52 @@
"root=ubi0:rootfs rw ubi.mtd=rootfs noinitrd " \
"rootfstype=ubifs rootwait\0" \
"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+   "ext4bootenv=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} 
${bootdir}/${bootenv}\0" \
"importbootenv=echo Importing environment from mmc ...; " \
"env import -t ${loadaddr} ${filesize}\0" \
-   "mmcbootenv=" \
-   "mmc dev ${mmcdev}; " \
-   "if mmc rescan && run loadbootenv; then " \
-   "run importbootenv; " \
+   "mmcbootenv=mmc dev ${mmcdev}; " \
+   "if mmc rescan; then " \
+   "run loadbootenv && run importbootenv; " \
+   "run ext4bootenv && run importbootenv; " \
"if test -n $uenvcmd; then " \
 

[U-Boot] [PATCH 2/2] ARM: dts: omap3-beagle{-xm}: Enable DM and devicetree for BeagleBoard

2017-12-29 Thread Derald D. Woods
This commit updates the configuration files needed to support OF_CONTROL
on the OMAP3 BeagleBoard(s).
---
 board/ti/beagle/beagle.c   |  11 
 configs/omap3_beagle_defconfig |   5 ++
 include/configs/omap3_beagle.h | 145 +++--
 3 files changed, 69 insertions(+), 92 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index bdf84b0be8..d8402f2675 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -103,6 +103,17 @@ int board_init(void)
return 0;
 }
 
+#if defined(CONFIG_SPL_OS_BOOT)
+int spl_start_uboot(void)
+{
+   /* break into full u-boot on 'c' */
+   if (serial_tstc() && serial_getc() == 'c')
+   return 1;
+
+   return 0;
+}
+#endif /* CONFIG_SPL_OS_BOOT */
+
 /*
  * Routine: get_board_revision
  * Description: Detect if we are running on a Beagle revision Ax/Bx,
diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
index ad7207909b..95c8784888 100644
--- a/configs/omap3_beagle_defconfig
+++ b/configs/omap3_beagle_defconfig
@@ -2,9 +2,11 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
 CONFIG_TARGET_OMAP3_BEAGLE=y
+CONFIG_DEFAULT_DEVICE_TREE="omap3-beagle"
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_DEFAULT_FDT_FILE="omap3-beagle.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 CONFIG_SPL_MTD_SUPPORT=y
@@ -26,7 +28,9 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=nand"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=nand:512k(x-loader),1920k(u-boot),128k(u-boot-env),4m(kernel),-(fs)"
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_NAND=y
+# CONFIG_BLK is not set
 CONFIG_LED_STATUS=y
 CONFIG_LED_STATUS0=y
 CONFIG_LED_STATUS_BIT=1
@@ -59,4 +63,5 @@ CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_MCS7830=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_FAT_WRITE=y
+CONFIG_BCH=y
 CONFIG_OF_LIBFDT=y
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 394bfb7434..843e345ffd 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -14,57 +14,69 @@
 
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 
+#include 
+
 /*
- * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
- * 64 bytes before this address should be set aside for u-boot.img's
- * header. That is 0x800FFFC0--0x8010 should not be used for any
- * other needs.  We use this rather than the inherited defines from
- * ti_armv7_common.h for backwards compatibility.
+ * We are only ever GP parts and will utilize all of the "downloaded image"
+ * area in SRAM which starts at 0x4020 and ends at 0x4020 (64KB).
  */
-#define CONFIG_SYS_TEXT_BASE   0x8010
-#define CONFIG_SPL_BSS_START_ADDR  0x8000
-#define CONFIG_SPL_BSS_MAX_SIZE(512 << 10) /* 512 KB */
-#define CONFIG_SYS_SPL_MALLOC_START0x80208000
-#define CONFIG_SYS_SPL_MALLOC_SIZE 0x10
+#undef CONFIG_SPL_TEXT_BASE
+#define CONFIG_SPL_TEXT_BASE0x4020
 
-#include 
+#define CONFIG_SPL_FRAMEWORK
 
 #define CONFIG_MISC_INIT_R
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
 
-#define CONFIG_REVISION_TAG1
+/* NAND */
+#if defined(CONFIG_NAND)
+#define CONFIG_SYS_FLASH_BASE  NAND_BASE
+#define CONFIG_SYS_MAX_NAND_DEVICE  1
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_COUNT  64
+#define CONFIG_SYS_NAND_PAGE_SIZE   2048
+#define CONFIG_SYS_NAND_OOBSIZE 64
+#define CONFIG_SYS_NAND_BLOCK_SIZE  (128*1024)
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS   NAND_LARGE_BADBLOCK_POS
+#define CONFIG_SYS_NAND_ECCPOS  {2, 3, 4, 5, 6, 7, 8, 9,\
+ 10, 11, 12, 13}
+#define CONFIG_SYS_NAND_ECCSIZE 512
+#define CONFIG_SYS_NAND_ECCBYTES3
+#define CONFIG_NAND_OMAP_ECCSCHEME  OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
+#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x8
+#define CONFIG_ENV_IS_IN_NAND   1
+#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
+#define CONFIG_SYS_ENV_SECT_SIZE(128 << 10) /* 128 KiB */
+#define CONFIG_ENV_OFFSET   0x26
+#define CONFIG_ENV_ADDR 0x26
 #define CONFIG_ENV_OVERWRITE
+#define CONFIG_MTD_PARTITIONS   /* required for UBI partition support 
*/
+/* NAND: SPL falcon mode configs */
+#if defined(CONFIG_SPL_OS_BOOT)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x28
+#endif /* CONFIG_SPL_OS_BOOT */
+#endif /* CONFIG_NAND */
 
-/* Status LED */
-
-/* Enable Multi Bus support for I2C */
-#define CONFIG_I2C_MULTI_BUS   1
-
-/* Probe all devices */
-#define CONFIG_SYS_I2C_NOPROBES{{0x0, 0x0}}
-
-/* USB */
+/* MUSB */
+#define CONFIG_USB_OMAP3
 #define CONFIG_USB_MUSB_OMAP2PLUS
 #define CONFIG_USB_MUSB_PIO_ONLY
-#define 

[U-Boot] [PATCH 1/2] ARM: dts: omap3-beagle{-xm}: Add support for BeagleBoard

2017-12-29 Thread Derald D. Woods
This commit adds OMAP3 BeagleBoard devicetree files from
Linux v4.15-rc5. This includes standard OMAP34XX board revisions as
well as the 'xM' which is OMAP36XX.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 arch/arm/dts/Makefile   |   5 +
 arch/arm/dts/omap3-beagle-u-boot.dtsi   |  29 ++
 arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi |  29 ++
 arch/arm/dts/omap3-beagle-xm-ab.dts |  16 +
 arch/arm/dts/omap3-beagle-xm-u-boot.dtsi|  29 ++
 arch/arm/dts/omap3-beagle-xm.dts| 409 ++
 arch/arm/dts/omap3-beagle.dts   | 436 
 7 files changed, 953 insertions(+)
 create mode 100644 arch/arm/dts/omap3-beagle-u-boot.dtsi
 create mode 100644 arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi
 create mode 100644 arch/arm/dts/omap3-beagle-xm-ab.dts
 create mode 100644 arch/arm/dts/omap3-beagle-xm-u-boot.dtsi
 create mode 100644 arch/arm/dts/omap3-beagle-xm.dts
 create mode 100644 arch/arm/dts/omap3-beagle.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index a895c70284..7cf6ef8bc4 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -438,6 +438,11 @@ dtb-$(CONFIG_TARGET_OMAP3_EVM) += \
omap3-evm-37xx.dtb \
omap3-evm.dtb
 
+dtb-$(CONFIG_TARGET_OMAP3_BEAGLE) += \
+   omap3-beagle-xm-ab.dtb \
+   omap3-beagle-xm.dtb \
+   omap3-beagle.dtb
+
 dtb-$(CONFIG_TARGET_SAMA5D2_PTC_EK) += \
at91-sama5d2_ptc_ek.dtb
 
diff --git a/arch/arm/dts/omap3-beagle-u-boot.dtsi 
b/arch/arm/dts/omap3-beagle-u-boot.dtsi
new file mode 100644
index 00..5325f0ffa4
--- /dev/null
+++ b/arch/arm/dts/omap3-beagle-u-boot.dtsi
@@ -0,0 +1,29 @@
+/*
+ * U-Boot additions
+ *
+ * (C) Copyright 2017 Derald D. Woods <woods.techni...@gmail.com>
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/ {
+   chosen {
+   stdout-path = 
+   };
+};
+
+ {
+   cd-inverted;
+};
+
+ {
+   reg-shift = <2>;
+};
+
+ {
+   reg-shift = <2>;
+};
+
+ {
+   reg-shift = <2>;
+};
diff --git a/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi 
b/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi
new file mode 100644
index 00..5325f0ffa4
--- /dev/null
+++ b/arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi
@@ -0,0 +1,29 @@
+/*
+ * U-Boot additions
+ *
+ * (C) Copyright 2017 Derald D. Woods <woods.techni...@gmail.com>
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/ {
+   chosen {
+   stdout-path = 
+   };
+};
+
+ {
+   cd-inverted;
+};
+
+ {
+   reg-shift = <2>;
+};
+
+ {
+   reg-shift = <2>;
+};
+
+ {
+   reg-shift = <2>;
+};
diff --git a/arch/arm/dts/omap3-beagle-xm-ab.dts 
b/arch/arm/dts/omap3-beagle-xm-ab.dts
new file mode 100644
index 00..7ac3bcf59d
--- /dev/null
+++ b/arch/arm/dts/omap3-beagle-xm-ab.dts
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "omap3-beagle-xm.dts"
+
+/ {
+   /* HS USB Port 2 Power enable was inverted with the xM C */
+   hsusb2_power: hsusb2_power_reg {
+   enable-active-high;
+   };
+};
diff --git a/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi 
b/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi
new file mode 100644
index 00..5325f0ffa4
--- /dev/null
+++ b/arch/arm/dts/omap3-beagle-xm-u-boot.dtsi
@@ -0,0 +1,29 @@
+/*
+ * U-Boot additions
+ *
+ * (C) Copyright 2017 Derald D. Woods <woods.techni...@gmail.com>
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/ {
+   chosen {
+   stdout-path = 
+   };
+};
+
+ {
+   cd-inverted;
+};
+
+ {
+   reg-shift = <2>;
+};
+
+ {
+   reg-shift = <2>;
+};
+
+ {
+   reg-shift = <2>;
+};
diff --git a/arch/arm/dts/omap3-beagle-xm.dts b/arch/arm/dts/omap3-beagle-xm.dts
new file mode 100644
index 00..0349fcc9dc
--- /dev/null
+++ b/arch/arm/dts/omap3-beagle-xm.dts
@@ -0,0 +1,409 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/dts-v1/;
+
+#include "omap36xx.dtsi"
+
+/ {
+   model = "TI OMAP3 BeagleBoard xM";
+   compatible = "ti,omap3-beagle-xm", "ti,omap36xx", "ti,omap3";
+
+   cpus {
+   cpu@0 {
+   cpu0-supply = <>;
+   };
+   };
+
+   memory@8000 {
+   device_type = "memory";
+   reg = <0x8000 0x2000>; /* 512 MB */
+   };
+
+   a

[U-Boot] [PATCH 0/2] ARM: omap3-beagle{-xm}: evm: Add OF_CONTROL support

2017-12-29 Thread Derald D. Woods
This series adds OF_CONTROL support for BeagleBoard and BeagleBoard-xM.

Devicetree files are taken from Linux v4.15-rc5.

Note that this is a follow-up to this previous patch series:

https://lists.denx.de/pipermail/u-boot/2017-December/314672.html

Tested using GCC 7.2.0 [--with-float=hard --with-mode=thumb]

Derald D. Woods (2):
  ARM: dts: omap3-beagle{-xm}: Add support for BeagleBoard
  ARM: dts: omap3-beagle{-xm}: Enable DM and devicetree for BeagleBoard

 arch/arm/dts/Makefile   |   5 +
 arch/arm/dts/omap3-beagle-u-boot.dtsi   |  29 ++
 arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi |  29 ++
 arch/arm/dts/omap3-beagle-xm-ab.dts |  16 +
 arch/arm/dts/omap3-beagle-xm-u-boot.dtsi|  29 ++
 arch/arm/dts/omap3-beagle-xm.dts| 409 ++
 arch/arm/dts/omap3-beagle.dts   | 436 
 board/ti/beagle/beagle.c|  11 +
 configs/omap3_beagle_defconfig  |   5 +
 include/configs/omap3_beagle.h  | 145 -
 10 files changed, 1022 insertions(+), 92 deletions(-)
 create mode 100644 arch/arm/dts/omap3-beagle-u-boot.dtsi
 create mode 100644 arch/arm/dts/omap3-beagle-xm-ab-u-boot.dtsi
 create mode 100644 arch/arm/dts/omap3-beagle-xm-ab.dts
 create mode 100644 arch/arm/dts/omap3-beagle-xm-u-boot.dtsi
 create mode 100644 arch/arm/dts/omap3-beagle-xm.dts
 create mode 100644 arch/arm/dts/omap3-beagle.dts

-- 
2.15.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: omap3: evm: Do not relocate FDT address

2017-12-28 Thread Derald D. Woods
On Thu, Dec 28, 2017 at 02:24:08PM -0500, Tom Rini wrote:
> On Thu, Dec 28, 2017 at 01:21:05PM -0600, Derald D. Woods wrote:
> > On Thu, Dec 28, 2017 at 01:43:43PM -0500, Tom Rini wrote:
> > > On Thu, Dec 28, 2017 at 11:48:29AM -0600, Derald D. Woods wrote:
> > > > On Thu, Dec 28, 2017 at 10:37:18AM -0500, Tom Rini wrote:
> > > > > On Thu, Dec 28, 2017 at 01:25:43AM -0600, Derald D. Woods wrote:
> > > > > 
> > > > > > This commit keeps the 'fdtaddr' as provided by 
> > > > > > DEFAULT_LINUX_BOOT_ENV.
> > > > > > 
> > > > > > Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
> > > > > > ---
> > > > > >  include/configs/omap3_evm.h | 1 +
> > > > > >  1 file changed, 1 insertion(+)
> > > > > > 
> > > > > > diff --git a/include/configs/omap3_evm.h 
> > > > > > b/include/configs/omap3_evm.h
> > > > > > index 629d60b961..d95ccdf035 100644
> > > > > > --- a/include/configs/omap3_evm.h
> > > > > > +++ b/include/configs/omap3_evm.h
> > > > > > @@ -127,6 +127,7 @@
> > > > > > "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
> > > > > > "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
> > > > > > "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
> > > > > > +   "fdt_high=0x\0" \
> > > > > > "bootenv=uEnv.txt\0" \
> > > > > > "optargs=\0" \
> > > > > > "mmcdev=0\0" \
> > > > > 
> > > > > What's the problem this solves, and how much memory is on the system 
> > > > > in
> > > > > question?  bootm_size should be ensuring we never relocate it outside 
> > > > > of
> > > > > the first 256MB of memory.  Thanks!
> > > > > 
> > > > 
> > > > The logic within "common/image-fdt.c" lead me down this path. The
> > > > addition of this fairly common environment variable allowed my
> > > > OMAP34XX board to boot the kernel without an appended devicetree.
> > > > When I use the variable to trigger 'disable_relocation', as the code
> > > > indicates, the kernel boot behavior is what I expect. I spent a few
> > > > hours following the code path to a single line edition that works.
> > > > 
> > > > 
> > > > Without 'fdt_high'
> > > > ==
> > > > 
> > > > U-Boot SPL 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 11:16:52)
> > > > Trying to boot from MMC1
> > > > reading u-boot.img
> > > > reading u-boot.img
> > > > 
> > > > 
> > > > U-Boot 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 11:16:52 
> > > > -0600)
> > > > 
> > > > OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 MHz
> > > > Model: TI OMAP35XX EVM (TMDSEVM3530)
> > > > OMAP3 EVM board + LPDDR/NAND
> > > > I2C:   ready
> > > > DRAM:  256 MiB
> > > > NAND:  256 MiB
> > > > MMC:   OMAP SD/MMC: 0
> > > > Read back SMSC id 0x9220
> > > > OMAP die ID: 265a0024040365fa1801b01f
> > > > Net:   smc911x-0
> > > > starting USB...
> > > > USB0:   USB EHCI 1.00
> > > > scanning bus 0 for devices... 1 USB Device(s) found
> > > > Hit any key to stop autoboot:  0 
> > > > switch to partitions #0, OK
> > > > mmc0 is current device
> > > > Scanning mmc 0:1...
> > > > switch to partitions #0, OK
> > > > mmc0 is current device
> > > > ** Unable to read file uEnv.txt **
> > > > reading zImage
> > > > 4637344 bytes read in 407 ms (10.9 MiB/s)
> > > > reading omap3-evm.dtb
> > > > 62832 bytes read in 10 ms (6 MiB/s)
> > > > Booting zImage from mmc ...
> > > > *  fdt: cmdline image address = 0x8800
> > > > ## Checking for 'FDT'/'FDT Image' at 8800
> > > > *  fdt: raw FDT blob
> > > > ## Flattened Device Tree blob at 8800
> > > >Booting using the fdt blob at 0x8800
> > > >of_flat_tree at 0x8800 size 0xf570
> > > > ## device tree at 8800 ... 8800f56f (len=75120 [0x12570])
> > > >Loading Device Tree to 8ffed000, en

Re: [U-Boot] [PATCH] ARM: omap3: evm: Do not relocate FDT address

2017-12-28 Thread Derald D. Woods
On Thu, Dec 28, 2017 at 02:24:08PM -0500, Tom Rini wrote:
> On Thu, Dec 28, 2017 at 01:21:05PM -0600, Derald D. Woods wrote:
> > On Thu, Dec 28, 2017 at 01:43:43PM -0500, Tom Rini wrote:
> > > On Thu, Dec 28, 2017 at 11:48:29AM -0600, Derald D. Woods wrote:
> > > > On Thu, Dec 28, 2017 at 10:37:18AM -0500, Tom Rini wrote:
> > > > > On Thu, Dec 28, 2017 at 01:25:43AM -0600, Derald D. Woods wrote:
> > > > > 
> > > > > > This commit keeps the 'fdtaddr' as provided by 
> > > > > > DEFAULT_LINUX_BOOT_ENV.
> > > > > > 
> > > > > > Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
> > > > > > ---
> > > > > >  include/configs/omap3_evm.h | 1 +
> > > > > >  1 file changed, 1 insertion(+)
> > > > > > 
> > > > > > diff --git a/include/configs/omap3_evm.h 
> > > > > > b/include/configs/omap3_evm.h
> > > > > > index 629d60b961..d95ccdf035 100644
> > > > > > --- a/include/configs/omap3_evm.h
> > > > > > +++ b/include/configs/omap3_evm.h
> > > > > > @@ -127,6 +127,7 @@
> > > > > > "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
> > > > > > "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
> > > > > > "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
> > > > > > +   "fdt_high=0x\0" \
> > > > > > "bootenv=uEnv.txt\0" \
> > > > > > "optargs=\0" \
> > > > > > "mmcdev=0\0" \
> > > > > 
> > > > > What's the problem this solves, and how much memory is on the system 
> > > > > in
> > > > > question?  bootm_size should be ensuring we never relocate it outside 
> > > > > of
> > > > > the first 256MB of memory.  Thanks!
> > > > > 
> > > > 
> > > > The logic within "common/image-fdt.c" lead me down this path. The
> > > > addition of this fairly common environment variable allowed my
> > > > OMAP34XX board to boot the kernel without an appended devicetree.
> > > > When I use the variable to trigger 'disable_relocation', as the code
> > > > indicates, the kernel boot behavior is what I expect. I spent a few
> > > > hours following the code path to a single line edition that works.
> > > > 
> > > > 
> > > > Without 'fdt_high'
> > > > ==
> > > > 
> > > > U-Boot SPL 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 11:16:52)
> > > > Trying to boot from MMC1
> > > > reading u-boot.img
> > > > reading u-boot.img
> > > > 
> > > > 
> > > > U-Boot 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 11:16:52 
> > > > -0600)
> > > > 
> > > > OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 MHz
> > > > Model: TI OMAP35XX EVM (TMDSEVM3530)
> > > > OMAP3 EVM board + LPDDR/NAND
> > > > I2C:   ready
> > > > DRAM:  256 MiB
> > > > NAND:  256 MiB
> > > > MMC:   OMAP SD/MMC: 0
> > > > Read back SMSC id 0x9220
> > > > OMAP die ID: 265a0024040365fa1801b01f
> > > > Net:   smc911x-0
> > > > starting USB...
> > > > USB0:   USB EHCI 1.00
> > > > scanning bus 0 for devices... 1 USB Device(s) found
> > > > Hit any key to stop autoboot:  0 
> > > > switch to partitions #0, OK
> > > > mmc0 is current device
> > > > Scanning mmc 0:1...
> > > > switch to partitions #0, OK
> > > > mmc0 is current device
> > > > ** Unable to read file uEnv.txt **
> > > > reading zImage
> > > > 4637344 bytes read in 407 ms (10.9 MiB/s)
> > > > reading omap3-evm.dtb
> > > > 62832 bytes read in 10 ms (6 MiB/s)
> > > > Booting zImage from mmc ...
> > > > *  fdt: cmdline image address = 0x8800
> > > > ## Checking for 'FDT'/'FDT Image' at 8800
> > > > *  fdt: raw FDT blob
> > > > ## Flattened Device Tree blob at 8800
> > > >Booting using the fdt blob at 0x8800
> > > >of_flat_tree at 0x8800 size 0xf570
> > > > ## device tree at 8800 ... 8800f56f (len=75120 [0x12570])
> > > >Loading Device Tree to 8ffed000, en

Re: [U-Boot] [PATCH] ARM: omap3: evm: Do not relocate FDT address

2017-12-28 Thread Derald D. Woods
On Thu, Dec 28, 2017 at 01:43:43PM -0500, Tom Rini wrote:
> On Thu, Dec 28, 2017 at 11:48:29AM -0600, Derald D. Woods wrote:
> > On Thu, Dec 28, 2017 at 10:37:18AM -0500, Tom Rini wrote:
> > > On Thu, Dec 28, 2017 at 01:25:43AM -0600, Derald D. Woods wrote:
> > > 
> > > > This commit keeps the 'fdtaddr' as provided by DEFAULT_LINUX_BOOT_ENV.
> > > > 
> > > > Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
> > > > ---
> > > >  include/configs/omap3_evm.h | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > > 
> > > > diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
> > > > index 629d60b961..d95ccdf035 100644
> > > > --- a/include/configs/omap3_evm.h
> > > > +++ b/include/configs/omap3_evm.h
> > > > @@ -127,6 +127,7 @@
> > > > "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
> > > > "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
> > > > "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
> > > > +   "fdt_high=0x\0" \
> > > > "bootenv=uEnv.txt\0" \
> > > > "optargs=\0" \
> > > > "mmcdev=0\0" \
> > > 
> > > What's the problem this solves, and how much memory is on the system in
> > > question?  bootm_size should be ensuring we never relocate it outside of
> > > the first 256MB of memory.  Thanks!
> > > 
> > 
> > The logic within "common/image-fdt.c" lead me down this path. The
> > addition of this fairly common environment variable allowed my
> > OMAP34XX board to boot the kernel without an appended devicetree.
> > When I use the variable to trigger 'disable_relocation', as the code
> > indicates, the kernel boot behavior is what I expect. I spent a few
> > hours following the code path to a single line edition that works.
> > 
> > 
> > Without 'fdt_high'
> > ==
> > 
> > U-Boot SPL 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 11:16:52)
> > Trying to boot from MMC1
> > reading u-boot.img
> > reading u-boot.img
> > 
> > 
> > U-Boot 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 11:16:52 -0600)
> > 
> > OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 MHz
> > Model: TI OMAP35XX EVM (TMDSEVM3530)
> > OMAP3 EVM board + LPDDR/NAND
> > I2C:   ready
> > DRAM:  256 MiB
> > NAND:  256 MiB
> > MMC:   OMAP SD/MMC: 0
> > Read back SMSC id 0x9220
> > OMAP die ID: 265a0024040365fa1801b01f
> > Net:   smc911x-0
> > starting USB...
> > USB0:   USB EHCI 1.00
> > scanning bus 0 for devices... 1 USB Device(s) found
> > Hit any key to stop autoboot:  0 
> > switch to partitions #0, OK
> > mmc0 is current device
> > Scanning mmc 0:1...
> > switch to partitions #0, OK
> > mmc0 is current device
> > ** Unable to read file uEnv.txt **
> > reading zImage
> > 4637344 bytes read in 407 ms (10.9 MiB/s)
> > reading omap3-evm.dtb
> > 62832 bytes read in 10 ms (6 MiB/s)
> > Booting zImage from mmc ...
> > *  fdt: cmdline image address = 0x8800
> > ## Checking for 'FDT'/'FDT Image' at 8800
> > *  fdt: raw FDT blob
> > ## Flattened Device Tree blob at 8800
> >Booting using the fdt blob at 0x8800
> >of_flat_tree at 0x8800 size 0xf570
> > ## device tree at 8800 ... 8800f56f (len=75120 [0x12570])
> >Loading Device Tree to 8ffed000, end 856f ... OK
> > 
> > Starting kernel ...
> > 
> > [HANG]
> > 
> > 
> > Make note of the "of_flat_tree" and "Loading Device Tree" lines.
> 
> Ah, hmmm.  Can you please try setting bootm_size, as an experiment, to
> 0x0a00 ?  I wonder if, since you have 256MB of memory we're not
> putting the DTB into where U-Boot is and we stomp on it a bit, causing
> Linux to boot, see an invalid DTB and not have a console available to
> tell us.  Thanks!
> 


That seemed to do it.

---8<

OMAP3_EVM # echo $bootm_size
0x0a00
OMAP3_EVM # reset
resetting ...
O
U-Boot SPL 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 13:03:42)
Trying to boot from MMC1
reading u-boot.img
reading u-boot.img


U-Boot 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 13:03:42 -0600)

OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 MHz
Model: TI OMAP35XX EVM (TMDSEVM3530)
OMAP3 EVM board + LPDDR/NAND
I2

Re: [U-Boot] [PATCH] ARM: omap3: evm: Do not relocate FDT address

2017-12-28 Thread Derald D. Woods
On Thu, Dec 28, 2017 at 10:37:18AM -0500, Tom Rini wrote:
> On Thu, Dec 28, 2017 at 01:25:43AM -0600, Derald D. Woods wrote:
> 
> > This commit keeps the 'fdtaddr' as provided by DEFAULT_LINUX_BOOT_ENV.
> > 
> > Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
> > ---
> >  include/configs/omap3_evm.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
> > index 629d60b961..d95ccdf035 100644
> > --- a/include/configs/omap3_evm.h
> > +++ b/include/configs/omap3_evm.h
> > @@ -127,6 +127,7 @@
> > "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
> > "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
> > "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
> > +   "fdt_high=0x\0" \
> > "bootenv=uEnv.txt\0" \
> > "optargs=\0" \
> > "mmcdev=0\0" \
> 
> What's the problem this solves, and how much memory is on the system in
> question?  bootm_size should be ensuring we never relocate it outside of
> the first 256MB of memory.  Thanks!
> 

The logic within "common/image-fdt.c" lead me down this path. The
addition of this fairly common environment variable allowed my
OMAP34XX board to boot the kernel without an appended devicetree.
When I use the variable to trigger 'disable_relocation', as the code
indicates, the kernel boot behavior is what I expect. I spent a few
hours following the code path to a single line edition that works.


Without 'fdt_high'
==

U-Boot SPL 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 11:16:52)
Trying to boot from MMC1
reading u-boot.img
reading u-boot.img


U-Boot 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 11:16:52 -0600)

OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 MHz
Model: TI OMAP35XX EVM (TMDSEVM3530)
OMAP3 EVM board + LPDDR/NAND
I2C:   ready
DRAM:  256 MiB
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0
Read back SMSC id 0x9220
OMAP die ID: 265a0024040365fa1801b01f
Net:   smc911x-0
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
switch to partitions #0, OK
mmc0 is current device
** Unable to read file uEnv.txt **
reading zImage
4637344 bytes read in 407 ms (10.9 MiB/s)
reading omap3-evm.dtb
62832 bytes read in 10 ms (6 MiB/s)
Booting zImage from mmc ...
*  fdt: cmdline image address = 0x8800
## Checking for 'FDT'/'FDT Image' at 8800
*  fdt: raw FDT blob
## Flattened Device Tree blob at 8800
   Booting using the fdt blob at 0x8800
   of_flat_tree at 0x8800 size 0xf570
## device tree at 8800 ... 8800f56f (len=75120 [0x12570])
   Loading Device Tree to 8ffed000, end 856f ... OK

Starting kernel ...

[HANG]


Make note of the "of_flat_tree" and "Loading Device Tree" lines.


With 'fdt_high=0x'
==

U-Boot SPL 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 11:24:25)
Trying to boot from MMC1
reading u-boot.img
reading u-boot.img


U-Boot 2018.01-rc2-00028-gaf9da945cd-dirty (Dec 28 2017 - 11:24:25 -0600)

OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 MHz
Model: TI OMAP35XX EVM (TMDSEVM3530)
OMAP3 EVM board + LPDDR/NAND
I2C:   ready
DRAM:  256 MiB
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0
Read back SMSC id 0x9220
OMAP die ID: 265a0024040365fa1801b01f
Net:   smc911x-0
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
switch to partitions #0, OK
mmc0 is current device
** Unable to read file uEnv.txt **
reading zImage
4637344 bytes read in 407 ms (10.9 MiB/s)
reading omap3-evm.dtb
62832 bytes read in 10 ms (6 MiB/s)
Booting zImage from mmc ...
*  fdt: cmdline image address = 0x8800
## Checking for 'FDT'/'FDT Image' at 8800
*  fdt: raw FDT blob
## Flattened Device Tree blob at 8800
   Booting using the fdt blob at 0x8800
   of_flat_tree at 0x8800 size 0xf570
   Using Device Tree in place at 8800, end 8801256f

Starting kernel ...

[0.00] Booting Linux on physical CPU 0x0
[0.00] Linux version 4.15.0-rc5-1-gdc7de7cf5f08 (ddwoods@ethiopia) (gcc 
version 7.2.0 (crosstool-NG crosstool-ng-1.23.0-269-ge832b9b2 - Linux 4.14.y)) 
#17 PREEMPT Wed Dec 27 22:59:37 CST 2017
[0.00] CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c5387d
[0.00] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing 
instruction cache
[0.00] OF: fdt: Machine model: TI OMAP35XX EVM (TMDSEVM3530)
[0.00] Memory policy: Data cache writeback
[0.00] cma: Reserved 16 MiB at 0x

[U-Boot] [PATCH] ARM: omap3: evm: Do not relocate FDT address

2017-12-27 Thread Derald D. Woods
This commit keeps the 'fdtaddr' as provided by DEFAULT_LINUX_BOOT_ENV.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 include/configs/omap3_evm.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 629d60b961..d95ccdf035 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -127,6 +127,7 @@
"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
+   "fdt_high=0x\0" \
"bootenv=uEnv.txt\0" \
"optargs=\0" \
"mmcdev=0\0" \
-- 
2.15.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] Convert CONFIG_SYS_BOOT_GET_{CMDLINE, KBD} to Kconfig

2017-12-27 Thread Derald D. Woods
This converts the following to Kconfig:
CONFIG_SYS_BOOT_GET_CMDLINE
CONFIG_SYS_BOOT_GET_KBD

Additionally, ARM now selects CONFIG_SYS_BOOT_GET_CMDLINE. This enables
the 'boot_get_cmdline' call to be reached from 'image_setup_linux' in
"common/image.c".

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 Kconfig   | 12 
 arch/Kconfig  |  5 +
 arch/m68k/include/asm/config.h|  2 --
 arch/powerpc/include/asm/config.h |  2 --
 scripts/config_whitelist.txt  |  2 --
 5 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/Kconfig b/Kconfig
index 9b8a807799..f713c6a9b1 100644
--- a/Kconfig
+++ b/Kconfig
@@ -83,6 +83,18 @@ config DISTRO_DEFAULTS
  Select this to enable various options and commands which are suitable
  for building u-boot for booting general purpose Linux distributions.
 
+config SYS_BOOT_GET_CMDLINE
+   bool "Enable kernel command line setup"
+   help
+ Enables allocating and saving kernel cmdline in space between
+ "bootm_low" and "bootm_low" + BOOTMAPSZ.
+
+config SYS_BOOT_GET_KBD
+   bool "Enable kernel board information setup"
+   help
+ Enables allocating and saving a kernel copy of the bd_info in
+ space between "bootm_low" and "bootm_low" + BOOTMAPSZ.
+
 config SYS_MALLOC_F
bool "Enable malloc() pool before relocation"
default y if DM
diff --git a/arch/Kconfig b/arch/Kconfig
index 0b12ed986c..41f61a46dc 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -22,10 +22,13 @@ config ARM
select CREATE_ARCH_SYMLINK
select HAVE_PRIVATE_LIBGCC if !ARM64
select SUPPORT_OF_CONTROL
+   select SYS_BOOT_GET_CMDLINE
 
 config M68K
bool "M68000 architecture"
select HAVE_PRIVATE_LIBGCC
+   select SYS_BOOT_GET_CMDLINE
+   select SYS_BOOT_GET_KBD
 
 config MICROBLAZE
bool "MicroBlaze architecture"
@@ -53,6 +56,8 @@ config PPC
bool "PowerPC architecture"
select HAVE_PRIVATE_LIBGCC
select SUPPORT_OF_CONTROL
+   select SYS_BOOT_GET_CMDLINE
+   select SYS_BOOT_GET_KBD
 
 config SANDBOX
bool "Sandbox"
diff --git a/arch/m68k/include/asm/config.h b/arch/m68k/include/asm/config.h
index 9c4d3fb8fd..fd0b5513ee 100644
--- a/arch/m68k/include/asm/config.h
+++ b/arch/m68k/include/asm/config.h
@@ -11,7 +11,5 @@
 
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
-#define CONFIG_SYS_BOOT_GET_CMDLINE
-#define CONFIG_SYS_BOOT_GET_KBD
 
 #endif
diff --git a/arch/powerpc/include/asm/config.h 
b/arch/powerpc/include/asm/config.h
index 6aec815c71..67e4b48a96 100644
--- a/arch/powerpc/include/asm/config.h
+++ b/arch/powerpc/include/asm/config.h
@@ -31,8 +31,6 @@
 
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
-#define CONFIG_SYS_BOOT_GET_CMDLINE
-#define CONFIG_SYS_BOOT_GET_KBD
 
 #ifndef CONFIG_MAX_MEM_MAPPED
 #ifdefined(CONFIG_E500)|| \
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 43a4ff0892..8117d485ec 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2322,8 +2322,6 @@ CONFIG_SYS_BOOTM_LEN
 CONFIG_SYS_BOOTPARAMS_LEN
 CONFIG_SYS_BOOTSZ
 CONFIG_SYS_BOOT_BLOCK
-CONFIG_SYS_BOOT_GET_CMDLINE
-CONFIG_SYS_BOOT_GET_KBD
 CONFIG_SYS_BOOT_RAMDISK_HIGH
 CONFIG_SYS_BR0_64M
 CONFIG_SYS_BR0_8M
-- 
2.15.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 2/3] ARM: dts: omap3-evm: Enable DM and devicetree for TMDSEVM{3530, 3730}

2017-12-27 Thread Derald D. Woods
This commit updates the configuration files needed to support OF_CONTROL
on the OMAP3 EVM baseboard.

Additionally:
- CONFIG_SYS_THUMB_BUILD is enabled
- CONFIG_SPL_ENV_SUPPORT is enabled

Tested using GCC 7.2.0 [--with-float=hard --with-mode=thumb].

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>

--
v4:
- Fix commit message

v3:
- Remove CONFIG_SPL_EXT_SUPPORT from default config

v2:
- Added CONFIG_SPL_ENV_SUPPORT and CONFIG_SPL_EXT_SUPPORT
- Bring back bus and filesystem commands previously dropped
- Update commit message
---
 arch/arm/mach-omap2/omap3/Kconfig | 4 
 configs/omap3_evm_defconfig   | 5 -
 include/configs/omap3_evm.h   | 6 --
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/omap3/Kconfig 
b/arch/arm/mach-omap2/omap3/Kconfig
index 4dbf9a27da..6d714f6cdb 100644
--- a/arch/arm/mach-omap2/omap3/Kconfig
+++ b/arch/arm/mach-omap2/omap3/Kconfig
@@ -61,6 +61,10 @@ config TARGET_DEVKIT8000
 
 config TARGET_OMAP3_EVM
bool "TI OMAP3 EVM"
+   select DM
+   select DM_SERIAL
+   select DM_GPIO
+   select OMAP3_GPIO_3
 
 config TARGET_OMAP3_IGEP00X0
bool "IGEP"
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 5103e9fd8d..d2b8d42175 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -1,16 +1,18 @@
 CONFIG_ARM=y
-# CONFIG_SYS_THUMB_BUILD is not set
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
+CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
+CONFIG_DEFAULT_DEVICE_TREE="omap3-evm"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
+CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
@@ -35,6 +37,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 CONFIG_SPL_PARTITION_UUIDS=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 42f2153637..629d60b961 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -42,8 +42,6 @@
 #define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
 #if defined(CONFIG_SPL_BUILD)
 #undef CONFIG_SYS_NS16550_REG_SIZE
-#else /* !CONFIG_SPL_BUILD  */
-#define CONFIG_SYS_NS16550_REG_SIZE (-1)
 #endif /* CONFIG_SPL_BUILD */
 
 /* NAND */
@@ -86,8 +84,6 @@
 /* Environment */
 #define CONFIG_PREBOOT  "usb start"
 
-#if !defined(CONFIG_SPL_BUILD)
-
 #include 
 
 #define MEM_LAYOUT_ENV_SETTINGS \
@@ -181,6 +177,4 @@
"bootm ${loadaddr} - ${fdtaddr}\0" \
BOOTENV
 
-#endif /* !CONFIG_SPL_BUILD */
-
 #endif /* __CONFIG_H */
-- 
2.15.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 2/3] ARM: dts: omap3-evm: Enable DM and devicetree for TMDSEVM{3530, 3730}

2017-12-27 Thread Derald D. Woods
This commit updates the configuration files needed to support OF_CONTROL
on the OMAP3 EVM baseboard.

Additionally:
- CONFIG_SYS_THUMB_BUILD is enabled
- CONFIG_SPL_ENV_SUPPORT is enabled
- CONFIG_SPL_EXT_SUPPORT is enabled

Tested using GCC 7.2.0 [--with-float=hard --with-mode=thumb].

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>

--
v3:
- Remove CONFIG_SPL_EXT_SUPPORT from default config

v2:
- Added CONFIG_SPL_ENV_SUPPORT and CONFIG_SPL_EXT_SUPPORT
- Bring back bus and filesystem commands previously dropped
- Update commit message
---
 arch/arm/mach-omap2/omap3/Kconfig | 4 
 configs/omap3_evm_defconfig   | 5 -
 include/configs/omap3_evm.h   | 6 --
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/omap3/Kconfig 
b/arch/arm/mach-omap2/omap3/Kconfig
index 4dbf9a27da..6d714f6cdb 100644
--- a/arch/arm/mach-omap2/omap3/Kconfig
+++ b/arch/arm/mach-omap2/omap3/Kconfig
@@ -61,6 +61,10 @@ config TARGET_DEVKIT8000
 
 config TARGET_OMAP3_EVM
bool "TI OMAP3 EVM"
+   select DM
+   select DM_SERIAL
+   select DM_GPIO
+   select OMAP3_GPIO_3
 
 config TARGET_OMAP3_IGEP00X0
bool "IGEP"
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 5103e9fd8d..d2b8d42175 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -1,16 +1,18 @@
 CONFIG_ARM=y
-# CONFIG_SYS_THUMB_BUILD is not set
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
+CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
+CONFIG_DEFAULT_DEVICE_TREE="omap3-evm"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
+CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
@@ -35,6 +37,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 CONFIG_SPL_PARTITION_UUIDS=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 42f2153637..629d60b961 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -42,8 +42,6 @@
 #define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
 #if defined(CONFIG_SPL_BUILD)
 #undef CONFIG_SYS_NS16550_REG_SIZE
-#else /* !CONFIG_SPL_BUILD  */
-#define CONFIG_SYS_NS16550_REG_SIZE (-1)
 #endif /* CONFIG_SPL_BUILD */
 
 /* NAND */
@@ -86,8 +84,6 @@
 /* Environment */
 #define CONFIG_PREBOOT  "usb start"
 
-#if !defined(CONFIG_SPL_BUILD)
-
 #include 
 
 #define MEM_LAYOUT_ENV_SETTINGS \
@@ -181,6 +177,4 @@
"bootm ${loadaddr} - ${fdtaddr}\0" \
BOOTENV
 
-#endif /* !CONFIG_SPL_BUILD */
-
 #endif /* __CONFIG_H */
-- 
2.15.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/3] ARM: dts: omap3-evm: Enable DM and devicetree for TMDSEVM{3530, 3730}

2017-12-27 Thread Derald D. Woods
On Wed, Dec 27, 2017 at 08:15:11AM -0500, Tom Rini wrote:
> On Sat, Dec 16, 2017 at 08:36:06PM -0600, Derald D. Woods wrote:
> 
> > This commit updates the configuration files needed to support OF_CONTROL
> > on the OMAP3 EVM baseboard.
> > 
> > Additionally:
> > - CONFIG_SYS_THUMB_BUILD is enabled
> > - CONFIG_SPL_ENV_SUPPORT is enabled
> > - CONFIG_SPL_EXT_SUPPORT is enabled
> > 
> > Tested using GCC 7.2.0 [--with-float=hard --with-mode=thumb].
> > 
> > Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
> > ---
> > 
> > v2:
> > - Added CONFIG_SPL_ENV_SUPPORT and CONFIG_SPL_EXT_SUPPORT
> > - Bring back bus and filesystem commands previously dropped
> > - Update commit message
> 
> So, this fails for me:
> https://travis-ci.org/trini/u-boot/jobs/321879321
> 
> There's two possible reasons.  One, gcc 7.2.0 is doing a better job of
> optimizing things down and it still fits in SRAM.  Or two, I noticed
> when test building this at first that CONFIG_SPL_EXT_SUPPORT was both
> enabled then disabled in the defconfig, and the disable won.  Given the
> commit message about enabling it specifically I also dropped the disable
> line from the defconfig.  Perhaps there's really not room for
> CONFIG_SPL_EXT_SUPPORT ?
> 

Okay. I will revert the CONFIG_SPL_EXT_SUPPORT so that the 'CI' build
works for the board. A 'V3' will be posted shortly.

Derald

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 0/3] ARM: omap3: evm: Add OF_CONTROL support

2017-12-26 Thread Derald D. Woods
On Tue, Dec 26, 2017 at 11:14:55AM -0500, Tom Rini wrote:
> On Mon, Dec 25, 2017 at 09:34:03PM -0600, Derald D. Woods wrote:
> > On Sat, Dec 16, 2017 at 02:14:47PM -0600, Derald D. Woods wrote:
> > > This series adds OF_CONTROL support for TMDSEVM{3530,3730} and
> > > additionally updates ethaddr setup with smc911x initialization.
> > > 
> > > Devicetree files are taken from Linux v4.15-rc3. Note that this is the
> > > first addition of OMAP34XX devicetree files.
> > > 
> > > Tested using GCC 7.2.0 [--with-float=hard --with-mode=thumb]
> > > 
> > > --- 8< -
> > > U-Boot SPL 2018.01-rc1-00177-g27f9740bcf (Dec 16 2017 - 13:13:10)
> > > Trying to boot from MMC1
> > > reading u-boot.img
> > > reading u-boot.img
> > > 
> > > 
> > > U-Boot 2018.01-rc1-00177-g27f9740bcf (Dec 16 2017 - 13:13:10 -0600)
> > > 
> > > OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 MHz
> > > Model: TI OMAP35XX EVM (TMDSEVM3530)
> > > OMAP3 EVM board + LPDDR/NAND
> > > I2C:   ready
> > > DRAM:  256 MiB
> > > NAND:  256 MiB
> > > MMC:   OMAP SD/MMC: 0
> > > Read back SMSC id 0x9220
> > > OMAP die ID: 265a0024040365fa1801b01f
> > > Net:   smc911x-0
> > > starting USB...
> > > USB0:   USB EHCI 1.00
> > > scanning bus 0 for devices... 1 USB Device(s) found
> > > Hit any key to stop autoboot:  0 
> > > OMAP3_EVM # echo $stdin;echo $stdout;echo $stderr
> > > serial@4806a000
> > > serial@4806a000
> > > serial@4806a000
> > > --- 8< -
> > > 
> > > 
> > > Derald D. Woods (3):
> > >   ARM: dts: omap3-evm: Add support for TMDSEVM{3530,3730}
> > >   ARM: dts: omap3-evm: Enable DM and devicetree for TMDSEVM{3530,3730}
> > >   ARM: omap3: evm: Refactor 'board_eth_init'
> > > 
> > >  arch/arm/dts/Makefile   |   4 +
> > >  arch/arm/dts/omap-gpmc-smsc911x.dtsi|  55 ++
> > >  arch/arm/dts/omap3-evm-37xx-u-boot.dtsi |  29 
> > >  arch/arm/dts/omap3-evm-37xx.dts | 110 
> > >  arch/arm/dts/omap3-evm-common.dtsi  | 195 
> > > +
> > >  arch/arm/dts/omap3-evm-processor-common.dtsi| 216 
> > > 
> > >  arch/arm/dts/omap3-evm-u-boot.dtsi  |  29 
> > >  arch/arm/dts/omap3-evm.dts  |  89 ++
> > >  arch/arm/dts/omap3-panel-sharp-ls037v7dw01.dtsi |  73 
> > >  arch/arm/dts/omap34xx.dtsi  |  84 +
> > >  arch/arm/mach-omap2/omap3/Kconfig   |   4 +
> > >  board/ti/evm/evm.c  |  24 +--
> > >  configs/omap3_evm_defconfig |   9 +-
> > >  include/configs/omap3_evm.h |   2 -
> > >  14 files changed, 896 insertions(+), 27 deletions(-)
> > >  create mode 100644 arch/arm/dts/omap-gpmc-smsc911x.dtsi
> > >  create mode 100644 arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
> > >  create mode 100644 arch/arm/dts/omap3-evm-37xx.dts
> > >  create mode 100644 arch/arm/dts/omap3-evm-common.dtsi
> > >  create mode 100644 arch/arm/dts/omap3-evm-processor-common.dtsi
> > >  create mode 100644 arch/arm/dts/omap3-evm-u-boot.dtsi
> > >  create mode 100644 arch/arm/dts/omap3-evm.dts
> > >  create mode 100644 arch/arm/dts/omap3-panel-sharp-ls037v7dw01.dtsi
> > >  create mode 100644 arch/arm/dts/omap34xx.dtsi
> > > 
> > > -- 
> > > 2.15.1
> > > 
> > 
> > Ping. If there is any concern, please let me know and I will make
> > corrections. I plan to also update beagleboard and overo to use their
> > respective devicetree files. I would like to have these three OMAP34XX
> > boards, that I possess, to be near the same level of support. It will
> > help me to continue testing OMAP34XX stuff in general.
> 
> It's localized enough that it's your call, do you want it in for
> v2018.01 or .03?  Thanks!
> 

I would like it to land in v2018.01 if possible.

Derald

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 0/3] ARM: omap3: evm: Add OF_CONTROL support

2017-12-25 Thread Derald D. Woods
On Sat, Dec 16, 2017 at 02:14:47PM -0600, Derald D. Woods wrote:
> This series adds OF_CONTROL support for TMDSEVM{3530,3730} and
> additionally updates ethaddr setup with smc911x initialization.
> 
> Devicetree files are taken from Linux v4.15-rc3. Note that this is the
> first addition of OMAP34XX devicetree files.
> 
> Tested using GCC 7.2.0 [--with-float=hard --with-mode=thumb]
> 
> --- 8< -
> U-Boot SPL 2018.01-rc1-00177-g27f9740bcf (Dec 16 2017 - 13:13:10)
> Trying to boot from MMC1
> reading u-boot.img
> reading u-boot.img
> 
> 
> U-Boot 2018.01-rc1-00177-g27f9740bcf (Dec 16 2017 - 13:13:10 -0600)
> 
> OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 MHz
> Model: TI OMAP35XX EVM (TMDSEVM3530)
> OMAP3 EVM board + LPDDR/NAND
> I2C:   ready
> DRAM:  256 MiB
> NAND:  256 MiB
> MMC:   OMAP SD/MMC: 0
> Read back SMSC id 0x9220
> OMAP die ID: 265a0024040365fa1801b01f
> Net:   smc911x-0
> starting USB...
> USB0:   USB EHCI 1.00
> scanning bus 0 for devices... 1 USB Device(s) found
> Hit any key to stop autoboot:  0 
> OMAP3_EVM # echo $stdin;echo $stdout;echo $stderr
> serial@4806a000
> serial@4806a000
> serial@4806a000
> --- 8< -
> 
> 
> Derald D. Woods (3):
>   ARM: dts: omap3-evm: Add support for TMDSEVM{3530,3730}
>   ARM: dts: omap3-evm: Enable DM and devicetree for TMDSEVM{3530,3730}
>   ARM: omap3: evm: Refactor 'board_eth_init'
> 
>  arch/arm/dts/Makefile   |   4 +
>  arch/arm/dts/omap-gpmc-smsc911x.dtsi|  55 ++
>  arch/arm/dts/omap3-evm-37xx-u-boot.dtsi |  29 
>  arch/arm/dts/omap3-evm-37xx.dts | 110 
>  arch/arm/dts/omap3-evm-common.dtsi  | 195 +
>  arch/arm/dts/omap3-evm-processor-common.dtsi| 216 
> 
>  arch/arm/dts/omap3-evm-u-boot.dtsi  |  29 
>  arch/arm/dts/omap3-evm.dts  |  89 ++
>  arch/arm/dts/omap3-panel-sharp-ls037v7dw01.dtsi |  73 
>  arch/arm/dts/omap34xx.dtsi  |  84 +
>  arch/arm/mach-omap2/omap3/Kconfig   |   4 +
>  board/ti/evm/evm.c  |  24 +--
>  configs/omap3_evm_defconfig |   9 +-
>  include/configs/omap3_evm.h |   2 -
>  14 files changed, 896 insertions(+), 27 deletions(-)
>  create mode 100644 arch/arm/dts/omap-gpmc-smsc911x.dtsi
>  create mode 100644 arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
>  create mode 100644 arch/arm/dts/omap3-evm-37xx.dts
>  create mode 100644 arch/arm/dts/omap3-evm-common.dtsi
>  create mode 100644 arch/arm/dts/omap3-evm-processor-common.dtsi
>  create mode 100644 arch/arm/dts/omap3-evm-u-boot.dtsi
>  create mode 100644 arch/arm/dts/omap3-evm.dts
>  create mode 100644 arch/arm/dts/omap3-panel-sharp-ls037v7dw01.dtsi
>  create mode 100644 arch/arm/dts/omap34xx.dtsi
> 
> -- 
> 2.15.1
> 

Ping. If there is any concern, please let me know and I will make
corrections. I plan to also update beagleboard and overo to use their
respective devicetree files. I would like to have these three OMAP34XX
boards, that I possess, to be near the same level of support. It will
help me to continue testing OMAP34XX stuff in general.

Derald

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/3] ARM: dts: omap3-evm: Enable DM and devicetree for TMDSEVM{3530, 3730}

2017-12-16 Thread Derald D. Woods
This commit updates the configuration files needed to support OF_CONTROL
on the OMAP3 EVM baseboard.

Additionally:
- CONFIG_SYS_THUMB_BUILD is enabled
- CONFIG_SPL_ENV_SUPPORT is enabled
- CONFIG_SPL_EXT_SUPPORT is enabled

Tested using GCC 7.2.0 [--with-float=hard --with-mode=thumb].

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>

---

v2:
- Added CONFIG_SPL_ENV_SUPPORT and CONFIG_SPL_EXT_SUPPORT
- Bring back bus and filesystem commands previously dropped
- Update commit message

 arch/arm/mach-omap2/omap3/Kconfig | 4 
 configs/omap3_evm_defconfig   | 6 +-
 include/configs/omap3_evm.h   | 6 --
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/omap3/Kconfig 
b/arch/arm/mach-omap2/omap3/Kconfig
index 4dbf9a27da..6d714f6cdb 100644
--- a/arch/arm/mach-omap2/omap3/Kconfig
+++ b/arch/arm/mach-omap2/omap3/Kconfig
@@ -61,6 +61,10 @@ config TARGET_DEVKIT8000
 
 config TARGET_OMAP3_EVM
bool "TI OMAP3 EVM"
+   select DM
+   select DM_SERIAL
+   select DM_GPIO
+   select OMAP3_GPIO_3
 
 config TARGET_OMAP3_IGEP00X0
bool "IGEP"
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 0c513664fe..c69b880bcc 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -1,10 +1,11 @@
 CONFIG_ARM=y
-# CONFIG_SYS_THUMB_BUILD is not set
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
+CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
+CONFIG_DEFAULT_DEVICE_TREE="omap3-evm"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTCOMMAND=y
@@ -12,6 +13,8 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
+CONFIG_SPL_ENV_SUPPORT=y
+CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
@@ -36,6 +39,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 CONFIG_SPL_PARTITION_UUIDS=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 42f2153637..629d60b961 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -42,8 +42,6 @@
 #define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
 #if defined(CONFIG_SPL_BUILD)
 #undef CONFIG_SYS_NS16550_REG_SIZE
-#else /* !CONFIG_SPL_BUILD  */
-#define CONFIG_SYS_NS16550_REG_SIZE (-1)
 #endif /* CONFIG_SPL_BUILD */
 
 /* NAND */
@@ -86,8 +84,6 @@
 /* Environment */
 #define CONFIG_PREBOOT  "usb start"
 
-#if !defined(CONFIG_SPL_BUILD)
-
 #include 
 
 #define MEM_LAYOUT_ENV_SETTINGS \
@@ -181,6 +177,4 @@
"bootm ${loadaddr} - ${fdtaddr}\0" \
BOOTENV
 
-#endif /* !CONFIG_SPL_BUILD */
-
 #endif /* __CONFIG_H */
-- 
2.15.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] OMAP34XX FDT, OF_CONTROL, and bootargs

2017-12-16 Thread Derald D. Woods
All,

Are there users of OMAP34XX boards (i.e. OMAP35x Platform) that have
U-Boot booting Linux without an appended devicetree? And with 'bootargs'
being passed to the kernel command line?

I have been working on OMAP3 EVM and would like to know if there are any
known issues, that may not be widely known, due to the age of the SOC
family in question. I work with a couple of OMAP36XX boards (i.e.
DM3730) that seem to boot just fine with an appended devicetree and
bootargs are passed properly.

I already know the chips are old. I am just probing for information from
the community.

Thanks.

Derald D. Woods

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 3/3] ARM: omap3: evm: Refactor 'board_eth_init'

2017-12-16 Thread Derald D. Woods
This commit clears 'ethaddr' before calling 'smc911x_initialize' to
allow the SROM MAC address to be assigned properly.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 board/ti/evm/evm.c | 24 +---
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 4d5ddff1e1..3a9680ffec 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -299,26 +299,12 @@ static void reset_net_chip(void)
 
 int board_eth_init(bd_t *bis)
 {
-   int rc = 0;
 #if defined(CONFIG_SMC911X)
-#define STR_ENV_ETHADDR"ethaddr"
-
-   struct eth_device *dev;
-   uchar eth_addr[6];
-
-   rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
-
-   if (!eth_env_get_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
-   dev = eth_get_dev_by_index(0);
-   if (dev) {
-   eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr);
-   } else {
-   printf("omap3evm: Couldn't get eth device\n");
-   rc = -1;
-   }
-   }
-#endif /* CONFIG_SMC911X */
-   return rc;
+   env_set("ethaddr", NULL);
+   return smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#else
+   return 0;
+#endif
 }
 #endif /* CONFIG_CMD_NET */
 
-- 
2.15.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/3] ARM: dts: omap3-evm: Enable DM and devicetree for TMDSEVM{3530, 3730}

2017-12-16 Thread Derald D. Woods
This commit updates the configuration files needed to support OF_CONTROL
on the OMAP3 EVM baseboard.

Tested using GCC 7.2.0 [--with-float=hard --with-mode=thumb].

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 arch/arm/mach-omap2/omap3/Kconfig | 4 
 configs/omap3_evm_defconfig   | 9 +++--
 include/configs/omap3_evm.h   | 2 --
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/omap3/Kconfig 
b/arch/arm/mach-omap2/omap3/Kconfig
index 4dbf9a27da..6d714f6cdb 100644
--- a/arch/arm/mach-omap2/omap3/Kconfig
+++ b/arch/arm/mach-omap2/omap3/Kconfig
@@ -61,6 +61,10 @@ config TARGET_DEVKIT8000
 
 config TARGET_OMAP3_EVM
bool "TI OMAP3 EVM"
+   select DM
+   select DM_SERIAL
+   select DM_GPIO
+   select OMAP3_GPIO_3
 
 config TARGET_OMAP3_IGEP00X0
bool "IGEP"
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 0c513664fe..bf4480fc5d 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -1,10 +1,11 @@
 CONFIG_ARM=y
-# CONFIG_SYS_THUMB_BUILD is not set
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x8010
+CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
+CONFIG_DEFAULT_DEVICE_TREE="omap3-evm"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTCOMMAND=y
@@ -20,15 +21,11 @@ CONFIG_SYS_PROMPT="OMAP3_EVM # "
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
-CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FS_UUID=y
 CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1792k(u-boot),128k(dtb),128k(u-boot-env),6m(kernel),-(rootfs)"
@@ -36,6 +33,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 CONFIG_SPL_PARTITION_UUIDS=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
@@ -61,7 +59,6 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5678
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
-CONFIG_FAT_WRITE=y
 CONFIG_BCH=y
 CONFIG_OF_LIBFDT=y
 CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 42f2153637..0bf3423129 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -42,8 +42,6 @@
 #define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
 #if defined(CONFIG_SPL_BUILD)
 #undef CONFIG_SYS_NS16550_REG_SIZE
-#else /* !CONFIG_SPL_BUILD  */
-#define CONFIG_SYS_NS16550_REG_SIZE (-1)
 #endif /* CONFIG_SPL_BUILD */
 
 /* NAND */
-- 
2.15.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/3] ARM: dts: omap3-evm: Add support for TMDSEVM{3530, 3730}

2017-12-16 Thread Derald D. Woods
This commit adds OMAP3 EVM devicetree files from Linux v4.15-rc3. Note
that this is the first addition of OMAP34XX devicetree files.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 arch/arm/dts/Makefile   |   4 +
 arch/arm/dts/omap-gpmc-smsc911x.dtsi|  55 ++
 arch/arm/dts/omap3-evm-37xx-u-boot.dtsi |  29 
 arch/arm/dts/omap3-evm-37xx.dts | 110 
 arch/arm/dts/omap3-evm-common.dtsi  | 195 +
 arch/arm/dts/omap3-evm-processor-common.dtsi| 216 
 arch/arm/dts/omap3-evm-u-boot.dtsi  |  29 
 arch/arm/dts/omap3-evm.dts  |  89 ++
 arch/arm/dts/omap3-panel-sharp-ls037v7dw01.dtsi |  73 
 arch/arm/dts/omap34xx.dtsi  |  84 +
 10 files changed, 884 insertions(+)
 create mode 100644 arch/arm/dts/omap-gpmc-smsc911x.dtsi
 create mode 100644 arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
 create mode 100644 arch/arm/dts/omap3-evm-37xx.dts
 create mode 100644 arch/arm/dts/omap3-evm-common.dtsi
 create mode 100644 arch/arm/dts/omap3-evm-processor-common.dtsi
 create mode 100644 arch/arm/dts/omap3-evm-u-boot.dtsi
 create mode 100644 arch/arm/dts/omap3-evm.dts
 create mode 100644 arch/arm/dts/omap3-panel-sharp-ls037v7dw01.dtsi
 create mode 100644 arch/arm/dts/omap34xx.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 1c9ac1468b..cf23a46f4c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -432,6 +432,10 @@ dtb-$(CONFIG_TARGET_OMAP3_LOGIC) += \
logicpd-torpedo-37xx-devkit.dtb \
logicpd-som-lv-37xx-devkit.dtb
 
+dtb-$(CONFIG_TARGET_OMAP3_EVM) += \
+   omap3-evm-37xx.dtb \
+   omap3-evm.dtb
+
 dtb-$(CONFIG_TARGET_SAMA5D2_PTC_EK) += \
at91-sama5d2_ptc_ek.dtb
 
diff --git a/arch/arm/dts/omap-gpmc-smsc911x.dtsi 
b/arch/arm/dts/omap-gpmc-smsc911x.dtsi
new file mode 100644
index 00..ded7e8fec9
--- /dev/null
+++ b/arch/arm/dts/omap-gpmc-smsc911x.dtsi
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Common file for GPMC connected smsc911x on omaps
+ *
+ * Note that the board specifc DTS file needs to specify
+ * ranges, pinctrl, reg, interrupt parent and interrupts.
+ */
+
+/ {
+   vddvario: regulator-vddvario {
+ compatible = "regulator-fixed";
+ regulator-name = "vddvario";
+ regulator-always-on;
+   };
+
+   vdd33a: regulator-vdd33a {
+   compatible = "regulator-fixed";
+   regulator-name = "vdd33a";
+   regulator-always-on;
+   };
+};
+
+ {
+   ethernet@gpmc {
+   compatible = "smsc,lan9221", "smsc,lan9115";
+   bank-width = <2>;
+   gpmc,device-width = <1>;
+   gpmc,cycle2cycle-samecsen = <1>;
+   gpmc,cycle2cycle-diffcsen = <1>;
+   gpmc,cs-on-ns = <5>;
+   gpmc,cs-rd-off-ns = <150>;
+   gpmc,cs-wr-off-ns = <150>;
+   gpmc,adv-on-ns = <0>;
+   gpmc,adv-rd-off-ns = <15>;
+   gpmc,adv-wr-off-ns = <40>;
+   gpmc,oe-on-ns = <45>;
+   gpmc,oe-off-ns = <140>;
+   gpmc,we-on-ns = <45>;
+   gpmc,we-off-ns = <140>;
+   gpmc,rd-cycle-ns = <155>;
+   gpmc,wr-cycle-ns = <155>;
+   gpmc,access-ns = <120>;
+   gpmc,page-burst-access-ns = <20>;
+   gpmc,bus-turnaround-ns = <75>;
+   gpmc,cycle2cycle-delay-ns = <75>;
+   gpmc,wait-monitoring-ns = <0>;
+   gpmc,clk-activation-ns = <0>;
+   gpmc,wr-data-mux-bus-ns = <0>;
+   gpmc,wr-access-ns = <0>;
+   vddvario-supply = <>;
+   vdd33a-supply = <>;
+   reg-io-width = <4>;
+   smsc,save-mac-address;
+   };
+};
diff --git a/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi 
b/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
new file mode 100644
index 00..53a489988e
--- /dev/null
+++ b/arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
@@ -0,0 +1,29 @@
+/*
+ * U-Boot additions
+ *
+ * (C) Copyright 2017 Derald D. Woods <woods.techni...@gmail.com>
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/ {
+   chosen {
+   stdout-path = 
+   };
+};
+
+ {
+   cd-inverted;
+};
+
+ {
+   reg-shift = <2>;
+};
+
+ {
+   reg-shift = <2>;
+};
+
+ {
+   reg-shift = <2>;
+};
diff --git a/arch/arm/dts/omap3-evm-37xx.dts b/arch/arm/dts/omap3-evm-37xx.dts
new file mode 100644
index 00..5a4ba0aea4
--- /dev/null
+++ b/arch/arm/dts/omap3-evm-37xx.dts
@@ -0,0 +1,110 @@
+/*
+ * Copyright (

[U-Boot] [PATCH 0/3] ARM: omap3: evm: Add OF_CONTROL support

2017-12-16 Thread Derald D. Woods
This series adds OF_CONTROL support for TMDSEVM{3530,3730} and
additionally updates ethaddr setup with smc911x initialization.

Devicetree files are taken from Linux v4.15-rc3. Note that this is the
first addition of OMAP34XX devicetree files.

Tested using GCC 7.2.0 [--with-float=hard --with-mode=thumb]

--- 8< -
U-Boot SPL 2018.01-rc1-00177-g27f9740bcf (Dec 16 2017 - 13:13:10)
Trying to boot from MMC1
reading u-boot.img
reading u-boot.img


U-Boot 2018.01-rc1-00177-g27f9740bcf (Dec 16 2017 - 13:13:10 -0600)

OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 720 MHz
Model: TI OMAP35XX EVM (TMDSEVM3530)
OMAP3 EVM board + LPDDR/NAND
I2C:   ready
DRAM:  256 MiB
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0
Read back SMSC id 0x9220
OMAP die ID: 265a0024040365fa1801b01f
Net:   smc911x-0
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
Hit any key to stop autoboot:  0 
OMAP3_EVM # echo $stdin;echo $stdout;echo $stderr
serial@4806a000
serial@4806a000
serial@4806a000
--- 8< -----


Derald D. Woods (3):
  ARM: dts: omap3-evm: Add support for TMDSEVM{3530,3730}
  ARM: dts: omap3-evm: Enable DM and devicetree for TMDSEVM{3530,3730}
  ARM: omap3: evm: Refactor 'board_eth_init'

 arch/arm/dts/Makefile   |   4 +
 arch/arm/dts/omap-gpmc-smsc911x.dtsi|  55 ++
 arch/arm/dts/omap3-evm-37xx-u-boot.dtsi |  29 
 arch/arm/dts/omap3-evm-37xx.dts | 110 
 arch/arm/dts/omap3-evm-common.dtsi  | 195 +
 arch/arm/dts/omap3-evm-processor-common.dtsi| 216 
 arch/arm/dts/omap3-evm-u-boot.dtsi  |  29 
 arch/arm/dts/omap3-evm.dts  |  89 ++
 arch/arm/dts/omap3-panel-sharp-ls037v7dw01.dtsi |  73 
 arch/arm/dts/omap34xx.dtsi  |  84 +
 arch/arm/mach-omap2/omap3/Kconfig   |   4 +
 board/ti/evm/evm.c  |  24 +--
 configs/omap3_evm_defconfig |   9 +-
 include/configs/omap3_evm.h |   2 -
 14 files changed, 896 insertions(+), 27 deletions(-)
 create mode 100644 arch/arm/dts/omap-gpmc-smsc911x.dtsi
 create mode 100644 arch/arm/dts/omap3-evm-37xx-u-boot.dtsi
 create mode 100644 arch/arm/dts/omap3-evm-37xx.dts
 create mode 100644 arch/arm/dts/omap3-evm-common.dtsi
 create mode 100644 arch/arm/dts/omap3-evm-processor-common.dtsi
 create mode 100644 arch/arm/dts/omap3-evm-u-boot.dtsi
 create mode 100644 arch/arm/dts/omap3-evm.dts
 create mode 100644 arch/arm/dts/omap3-panel-sharp-ls037v7dw01.dtsi
 create mode 100644 arch/arm/dts/omap34xx.dtsi

-- 
2.15.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] omap3: evm: Explicitly use DISTRO_DEFAULTS features at startup

2017-11-28 Thread Derald D. Woods
[primary] Check MMC 0:1 for /extlinux/extlinux.conf and boot
[fallback 1] Check MMC 0:1 zImage and run mmcbootz
[fallback 2] Check MMC 0:1 uImage and run mmcboot
[fallback 3] Check NAND partitions and run nandboot

If 'extlinux.conf' is not found on MMC 0, the previous boot behavior is
followed.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 configs/omap3_evm_defconfig |  2 +-
 include/configs/omap3_evm.h | 94 -
 2 files changed, 68 insertions(+), 28 deletions(-)

diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index f67bcb1895..0c513664fe 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -6,8 +6,8 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_DISTRO_DEFAULTS=y
-# CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_BOOTDELAY=3
+CONFIG_USE_BOOTCOMMAND=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_VERSION_VARIABLE=y
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index df50325ab6..42f2153637 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -86,8 +86,49 @@
 /* Environment */
 #define CONFIG_PREBOOT  "usb start"
 
+#if !defined(CONFIG_SPL_BUILD)
+
+#include 
+
+#define MEM_LAYOUT_ENV_SETTINGS \
+   DEFAULT_LINUX_BOOT_ENV
+
+#if defined(CONFIG_NAND)
+#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
+   "bootcmd_" #devtypel #instance "=" \
+   "run nandboot\0"
+
+#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
+   #devtypel #instance " "
+#endif /* CONFIG_NAND */
+
+#define BOOTENV_DEV_UIMAGE_MMC(devtypeu, devtypel, instance) \
+   "bootcmd_" #devtypel #instance "=" \
+   "setenv mmcdev " #instance"; " \
+   "run mmcboot\0"
+
+#define BOOTENV_DEV_NAME_UIMAGE_MMC(devtypeu, devtypel, instance) \
+   #devtypel #instance " "
+
+#define BOOTENV_DEV_ZIMAGE_MMC(devtypeu, devtypel, instance) \
+   "bootcmd_" #devtypel #instance "=" \
+   "setenv mmcdev " #instance"; " \
+   "run mmcbootz\0"
+
+#define BOOTENV_DEV_NAME_ZIMAGE_MMC(devtypeu, devtypel, instance) \
+   #devtypel #instance " "
+
+#define BOOT_TARGET_DEVICES(func) \
+   func(MMC, mmc, 0) \
+   func(ZIMAGE_MMC, zimage_mmc, 0) \
+   func(UIMAGE_MMC, uimage_mmc, 0) \
+   func(NAND, nand, 0)
+
+#include 
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   DEFAULT_LINUX_BOOT_ENV \
+   MEM_LAYOUT_ENV_SETTINGS \
+   "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
"bootenv=uEnv.txt\0" \
@@ -107,40 +148,39 @@
"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
"importbootenv=echo Importing environment from mmc ...; " \
"env import -t ${loadaddr} ${filesize}\0" \
-   "bootscript=echo Running bootscript from mmc ...; " \
-   "source ${loadaddr}\0" \
+   "mmcbootenv=" \
+   "mmc dev ${mmcdev}; " \
+   "if mmc rescan && run loadbootenv; then " \
+   "run importbootenv; " \
+   "if test -n $uenvcmd; then " \
+   "echo Running uenvcmd ...; " \
+   "run uenvcmd; " \
+   "fi; " \
+   "fi\0" \
"loaduimage=setenv bootfile uImage; " \
"fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
"loadzimage=setenv bootfile zImage; " \
"fatload mmc ${mmcdev} ${loadaddr} zImage\0" \
-   "loaddtb=fatload mmc ${mmcdev} ${fdtaddr} " CONFIG_DEFAULT_FDT_FILE 
"\0" \
-   "mmcboot=echo Booting ${bootfile} from mmc ...; " \
-   "run mmcargs; " \
-   "bootm ${loadaddr} - ${fdtaddr}\0" \
-   "mmcbootz=echo Booting ${bootfile} from mmc ...; " \
-   "run mmcargs; " \
-   "bootz ${loadaddr} - ${fdtaddr}\0" \
+   "loaddtb=fatload mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0" \
+   "mmcboot=run mmcbootenv; " \
+   "if run loaduimage && run loaddtb; then " \
+   "echo Booting ${bootfile} from mmc ...; " \
+   "run mmcargs; " \
+   "bootm ${loadaddr} - ${fdtaddr}; " \

Re: [U-Boot] [PATCH 2/2] ARM: omap3: am3517-evm: Add device tree and DM support

2017-09-20 Thread Derald D. Woods
On Tue, Sep 19, 2017 at 08:32:11PM -0500, Adam Ford wrote:
> With the device tree ported from Linux 4.13, this enables
> Driver Model and Device Tree support for the am3517-evm
> 
> Signed-off-by: Adam Ford <aford...@gmail.com>

Tested-by: Derald D. Woods <woods.techni...@gmail.com>

> ---
>  arch/arm/mach-omap2/omap3/Kconfig   |  5 +++
>  board/logicpd/am3517evm/am3517evm.c | 71 
> -
>  configs/am3517_evm_defconfig|  6 ++--
>  include/configs/am3517_evm.h| 14 +---
>  4 files changed, 57 insertions(+), 39 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/omap3/Kconfig 
> b/arch/arm/mach-omap2/omap3/Kconfig
> index 11f5f05..4dbf9a2 100644
> --- a/arch/arm/mach-omap2/omap3/Kconfig
> +++ b/arch/arm/mach-omap2/omap3/Kconfig
> @@ -22,6 +22,11 @@ choice
>  
>  config TARGET_AM3517_EVM
>   bool "AM3517 EVM"
> + select DM
> + select DM_SERIAL
> + select DM_GPIO
> + select DM_I2C
> + select DM_MMC
>  
>  config TARGET_MT_VENTOUX
>   bool "TeeJet Mt.Ventoux"
> diff --git a/board/logicpd/am3517evm/am3517evm.c 
> b/board/logicpd/am3517evm/am3517evm.c
> index c18a5a3..29f136a 100644
> --- a/board/logicpd/am3517evm/am3517evm.c
> +++ b/board/logicpd/am3517evm/am3517evm.c
> @@ -12,6 +12,8 @@
>   */
>  
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -34,6 +36,22 @@ DECLARE_GLOBAL_DATA_PTR;
>  
>  #define AM3517_IP_SW_RESET   0x48002598
>  #define CPGMACSS_SW_RST  (1 << 1)
> +#define PHY_GPIO 30
> +
> +/* This is only needed until SPL gets OF support */
> +#ifdef CONFIG_SPL_BUILD
> +static const struct ns16550_platdata am3517_serial = {
> + .base = OMAP34XX_UART3,
> + .reg_shift = 2,
> + .clock = V_NS16550_CLK,
> + .fcr = UART_FCR_DEFVAL,
> +};
> +
> +U_BOOT_DEVICE(am3517_uart) = {
> + "ns16550_serial",
> + _serial
> +};
> +#endif
>  
>  /*
>   * Routine: board_init
> @@ -113,30 +131,35 @@ int misc_init_r(void)
>  
>   am3517_evm_musb_init();
>  
> - /* activate PHY reset */
> - gpio_direction_output(30, 0);
> - gpio_set_value(30, 0);
> -
> - ctr  = 0;
> - do {
> - udelay(1000);
> - ctr++;
> - } while (ctr < 300);
> -
> - /* deactivate PHY reset */
> - gpio_set_value(30, 1);
> -
> - /* allow the PHY to stabilize and settle down */
> - ctr = 0;
> - do {
> - udelay(1000);
> - ctr++;
> - } while (ctr < 300);
> -
> - /* ensure that the module is out of reset */
> - reset = readl(AM3517_IP_SW_RESET);
> - reset &= (~CPGMACSS_SW_RST);
> - writel(reset,AM3517_IP_SW_RESET);
> + if (gpio_request(PHY_GPIO, "gpio_30") == 0) {
> + /* activate PHY reset */
> + gpio_direction_output(PHY_GPIO, 0);
> + gpio_set_value(PHY_GPIO, 0);
> +
> + ctr  = 0;
> + do {
> + udelay(1000);
> + ctr++;
> + } while (ctr < 300);
> +
> + /* deactivate PHY reset */
> + gpio_set_value(PHY_GPIO, 1);
> +
> + /* allow the PHY to stabilize and settle down */
> + ctr = 0;
> + do {
> + udelay(1000);
> + ctr++;
> + } while (ctr < 300);
> +
> + /* ensure that the module is out of reset */
> + reset = readl(AM3517_IP_SW_RESET);
> + reset &= (~CPGMACSS_SW_RST);
> + writel(reset, AM3517_IP_SW_RESET);
> +
> + /* Free requested GPIO */
> + gpio_free(PHY_GPIO);
> + }
>  
>   return 0;
>  }
> diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig
> index 920c61c..8ab0186 100644
> --- a/configs/am3517_evm_defconfig
> +++ b/configs/am3517_evm_defconfig
> @@ -4,11 +4,14 @@ CONFIG_ARCH_OMAP2PLUS=y
>  CONFIG_SYS_TEXT_BASE=0x8010
>  CONFIG_TI_COMMON_CMD_OPTIONS=y
>  # CONFIG_SPL_GPIO_SUPPORT is not set
> +CONFIG_SYS_MALLOC_F_LEN=0x2000
>  CONFIG_TARGET_AM3517_EVM=y
>  CONFIG_EMIF4=y
> +CONFIG_DEFAULT_DEVICE_TREE="am3517-evm"
>  CONFIG_BOOTDELAY=10
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_SPL=y
> +CONFIG_SPL_SYS_MALLOC_SIMPLE=y
>  # CONFIG_SPL_EXT_SUPPORT is not set
>  CONFIG_SPL_MTD_SUPPORT=y
>  CONFIG_HUSH_PARSER=y
> @@ -27,13 +30,12 @@ CONFIG_CMD_CACHE=y
>  # CONFIG_CMD_TIME is not set
>  CONFIG_CMD_UBI=y
>  CONFIG_SPL_PARTITION_UUIDS=y
> +C

Re: [U-Boot] [PATCH 1/2] arm: dts: am3517_evm: Sync DTS files with Linux 4.13-RC5

2017-09-20 Thread Derald D. Woods
On Tue, Sep 19, 2017 at 08:32:10PM -0500, Adam Ford wrote:
> To keep the DTS and DTSI files clean and in sync with Linux, new
> u-boot.dtsi files are added.
> 
> There are some spacing issues in the patch, but they appear to be
> present in the Linux source files.  I'll try to get to fixing them there,
> and do a future re-sync at a later date.
> 
> Signed-off-by: Adam Ford <aford...@gmail.com>

Tested-by: Derald D. Woods <woods.techni...@gmail.com>

> ---
>  arch/arm/dts/am3517-evm-u-boot.dtsi |  12 
>  arch/arm/dts/am3517-evm.dts |  61 +
>  arch/arm/dts/am3517-u-boot.dtsi |  10 +++
>  arch/arm/dts/am3517.dtsi| 107 ++
>  arch/arm/dts/am35xx-clocks.dtsi | 128 
> 
>  5 files changed, 318 insertions(+)
> 
> diff --git a/arch/arm/dts/am3517-evm-u-boot.dtsi 
> b/arch/arm/dts/am3517-evm-u-boot.dtsi
> new file mode 100644
> index 000..24a67db
> --- /dev/null
> +++ b/arch/arm/dts/am3517-evm-u-boot.dtsi
> @@ -0,0 +1,12 @@
> +/*
> + * Copyright (C) 2017
> + * Logic PD - http://www.logicpd.com
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +/ {
> + chosen {
> + stdout-path = 
> + };
> +};
> diff --git a/arch/arm/dts/am3517-evm.dts b/arch/arm/dts/am3517-evm.dts
> new file mode 100644
> index 000..0e4a125
> --- /dev/null
> +++ b/arch/arm/dts/am3517-evm.dts
> @@ -0,0 +1,61 @@
> +/*
> + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +/dts-v1/;
> +
> +#include "am3517.dtsi"
> +
> +/ {
> + model = "TI AM3517 EVM (AM3517/05 TMDSEVM3517)";
> + compatible = "ti,am3517-evm", "ti,am3517", "ti,omap3";
> +
> + memory@8000 {
> + device_type = "memory";
> + reg = <0x8000 0x1000>; /* 256 MB */
> + };
> +
> +vmmc_fixed: vmmc {
> +compatible = "regulator-fixed";
> +regulator-name = "vmmc_fixed";
> +regulator-min-microvolt = <330>;
> +regulator-max-microvolt = <330>;
> +};
> +};
> +
> +_emac {
> +  status = "okay";
> +};
> +
> +_mdio {
> +  status = "okay";
> +};
> +
> + {
> + clock-frequency = <40>;
> +};
> +
> + {
> + clock-frequency = <40>;
> +};
> +
> + {
> + clock-frequency = <40>;
> +};
> +
> + {
> + vmmc-supply = <_fixed>;
> + bus-width = <4>;
> +};
> +
> + {
> +  status = "disabled";
> +};
> +
> + {
> +  status = "disabled";
> +};
> +
> diff --git a/arch/arm/dts/am3517-u-boot.dtsi b/arch/arm/dts/am3517-u-boot.dtsi
> new file mode 100644
> index 000..2190052
> --- /dev/null
> +++ b/arch/arm/dts/am3517-u-boot.dtsi
> @@ -0,0 +1,10 @@
> +/*
> + * Copyright (C) 2017
> + * Logic PD - http://www.logicpd.com
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> + {
> + reg-shift = <2>;
> +};
> diff --git a/arch/arm/dts/am3517.dtsi b/arch/arm/dts/am3517.dtsi
> new file mode 100644
> index 000..00da3f2
> --- /dev/null
> +++ b/arch/arm/dts/am3517.dtsi
> @@ -0,0 +1,107 @@
> +/*
> + * Device Tree Source for am3517 SoC
> + *
> + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2.  This program is licensed "as is" without any warranty of any
> + * kind, whether express or implied.
> + */
> +
> +#include "omap3.dtsi"
> +
> +/ {
> + aliases {
> + serial3 = 
> + can = 
> + };
> +
> + ocp@6800 {
> + am35x_otg_hs: am35x_otg_hs@5c04 {
> + compatible = "ti,omap3-musb";
> + ti,hwmods = "am35x_otg_hs";
> + status = "disabled";
> + reg = <0x5c04 0x1000>;
> + interrupts = <71>;
> + interrupt-names = "mc";
> + };
> +
> + davinci_emac: ethernet@0x5c00 {
> + compatible = "ti,am3517-emac";
&g

[U-Boot] [PATCH v3] omap3: evm: Fixes for CONFIG_NAND, SPL_OS_BOOT, USB, and environment

2017-09-02 Thread Derald D. Woods
- Pass MTDPARTS kernel arguments to kernel
- Use Kconfig CONFIG_NAND instead of CONFIG_SYS_EXTRA_OPTIONS="NAND"
- Call 'usb_stop' on kernel start
- Update Falcon mode setup to match other OMAP3 boards
- Use "uEnv.txt" as boot script instead of "boot.scr"

---
Changes in v3:
- Fix subject 'PATCHi' -> 'PATCH'

Changes in v2:
- Rebase with master on 2017-09-02

---
 board/ti/evm/evm.c  | 20 +++-
 configs/omap3_evm_defconfig |  3 ++-
 include/configs/omap3_evm.h | 31 ---
 3 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 6bf57f9269..1f0433dcc0 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -122,6 +122,17 @@ int board_init(void)
return 0;
 }
 
+#if defined(CONFIG_SPL_OS_BOOT)
+int spl_start_uboot(void)
+{
+   /* break into full u-boot on 'c' */
+   if (serial_tstc() && serial_getc() == 'c')
+   return 1;
+
+   return 0;
+}
+#endif /* CONFIG_SPL_OS_BOOT */
+
 #if defined(CONFIG_SPL_BUILD)
 /*
  * Routine: get_board_mem_timings
@@ -323,7 +334,14 @@ void board_mmc_power_init(void)
 }
 #endif /* CONFIG_MMC */
 
-#if defined(CONFIG_USB_EHCI_HCD)
+#if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD)
+/* Call usb_stop() before starting the kernel */
+void show_boot_progress(int val)
+{
+   if (val == BOOTSTAGE_ID_RUN_OS)
+   usb_stop();
+}
+
 static struct omap_usbhs_board_data usbhs_bdata = {
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 9977e8e10f..51fd210d41 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -7,7 +7,7 @@ CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_SPL_STACK_R_ADDR=0x8200
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_SYS_EXTRA_OPTIONS="NAND"
+CONFIG_ENV_IS_IN_NAND=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
@@ -44,6 +44,7 @@ CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_NAND=y
 CONFIG_MTD=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index dd7ea5c8a6..2c48b4f3d8 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -36,7 +36,6 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
-
 /* Override OMAP3 serial console configuration */
 #undef CONFIG_CONS_INDEX
 #define CONFIG_CONS_INDEX   1
@@ -72,13 +71,15 @@
 #define CONFIG_ENV_OFFSET   SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
 #define CONFIG_MTD_PARTITIONS   /* required for UBI partition support 
*/
+/* NAND: SPL falcon mode configs */
+#if defined(CONFIG_SPL_OS_BOOT)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x28
+#endif /* CONFIG_SPL_OS_BOOT */
 #endif /* CONFIG_NAND */
 
-#define CONFIG_USB_OMAP3
-
 /* MUSB */
+#define CONFIG_USB_OMAP3
 #define CONFIG_USB_MUSB_OMAP2PLUS
 #define CONFIG_USB_MUSB_PIO_ONLY
 #define CONFIG_USB_ETHER
@@ -99,28 +100,32 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
-   "mtdids=" CONFIG_MTDIDS_DEFAULT "\0"\
+   "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
-   "loadaddr=0x8200\0" \
-   "usbtty=cdc_acm\0" \
+   "bootenv=uEnv.txt\0" \
+   "optargs=\0" \
"mmcdev=0\0" \
"console=ttyO0,115200n8\0" \
"mmcargs=setenv bootargs console=${console} " \
+   "${mtdparts} " \
"${optargs} " \
"root=/dev/mmcblk0p2 rw " \
"rootfstype=ext4 rootwait\0" \
"nandargs=setenv bootargs console=${console} " \
+   "${mtdparts} " \
"${optargs} " \
"root=ubi0:rootfs rw ubi.mtd=rootfs noinitrd " \
"rootfstype=ubifs rootwait\0" \
-   "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+   "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+   "importbootenv=echo Importing environment from mmc ...; " \
+   "env import -t ${loadaddr} ${filesize}\0" \
"bootscript=echo Running bootscript from mmc ...; " \
"source ${loadaddr}\0" \
"loaduimage=setenv bootfile uImage; " \
"fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
"loadzimage=setenv bootfile zImage; " \
"fatload mmc ${mmcdev} ${loadaddr} zImage\0" \
-   "loaddtb=fatload mmc ${mmcdev} ${fdtaddr} omap3-evm.dtb\0" \
+   "loaddtb=fatload mmc ${mmcdev} ${fdtaddr} " CONFIG_DEFAULT_FDT_FILE 
"\0" \
"mmcboot=echo Booting ${bootfile} from mmc ...; " \
"run mmcargs; " \
"bootm ${loadaddr} - 

[U-Boot] [PATCHi v2] omap3: evm: Fixes for CONFIG_NAND, SPL_OS_BOOT, USB, and environment

2017-09-02 Thread Derald D. Woods
- Pass MTDPARTS kernel arguments to kernel
- Use Kconfig CONFIG_NAND instead of CONFIG_SYS_EXTRA_OPTIONS="NAND"
- Call 'usb_stop' on kernel start
- Update Falcon mode setup to match other OMAP3 boards
- Use "uEnv.txt" as boot script instead of "boot.scr"

---
Changes in v2:
- Rebase with master on 2017-09-02

---
 board/ti/evm/evm.c  | 20 +++-
 configs/omap3_evm_defconfig |  3 ++-
 include/configs/omap3_evm.h | 31 ---
 3 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 6bf57f9269..1f0433dcc0 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -122,6 +122,17 @@ int board_init(void)
return 0;
 }
 
+#if defined(CONFIG_SPL_OS_BOOT)
+int spl_start_uboot(void)
+{
+   /* break into full u-boot on 'c' */
+   if (serial_tstc() && serial_getc() == 'c')
+   return 1;
+
+   return 0;
+}
+#endif /* CONFIG_SPL_OS_BOOT */
+
 #if defined(CONFIG_SPL_BUILD)
 /*
  * Routine: get_board_mem_timings
@@ -323,7 +334,14 @@ void board_mmc_power_init(void)
 }
 #endif /* CONFIG_MMC */
 
-#if defined(CONFIG_USB_EHCI_HCD)
+#if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD)
+/* Call usb_stop() before starting the kernel */
+void show_boot_progress(int val)
+{
+   if (val == BOOTSTAGE_ID_RUN_OS)
+   usb_stop();
+}
+
 static struct omap_usbhs_board_data usbhs_bdata = {
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 9977e8e10f..51fd210d41 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -7,7 +7,7 @@ CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_SPL_STACK_R_ADDR=0x8200
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_SYS_EXTRA_OPTIONS="NAND"
+CONFIG_ENV_IS_IN_NAND=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
@@ -44,6 +44,7 @@ CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_NAND=y
 CONFIG_MTD=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index dd7ea5c8a6..2c48b4f3d8 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -36,7 +36,6 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
-
 /* Override OMAP3 serial console configuration */
 #undef CONFIG_CONS_INDEX
 #define CONFIG_CONS_INDEX   1
@@ -72,13 +71,15 @@
 #define CONFIG_ENV_OFFSET   SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
 #define CONFIG_MTD_PARTITIONS   /* required for UBI partition support 
*/
+/* NAND: SPL falcon mode configs */
+#if defined(CONFIG_SPL_OS_BOOT)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x28
+#endif /* CONFIG_SPL_OS_BOOT */
 #endif /* CONFIG_NAND */
 
-#define CONFIG_USB_OMAP3
-
 /* MUSB */
+#define CONFIG_USB_OMAP3
 #define CONFIG_USB_MUSB_OMAP2PLUS
 #define CONFIG_USB_MUSB_PIO_ONLY
 #define CONFIG_USB_ETHER
@@ -99,28 +100,32 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
-   "mtdids=" CONFIG_MTDIDS_DEFAULT "\0"\
+   "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
-   "loadaddr=0x8200\0" \
-   "usbtty=cdc_acm\0" \
+   "bootenv=uEnv.txt\0" \
+   "optargs=\0" \
"mmcdev=0\0" \
"console=ttyO0,115200n8\0" \
"mmcargs=setenv bootargs console=${console} " \
+   "${mtdparts} " \
"${optargs} " \
"root=/dev/mmcblk0p2 rw " \
"rootfstype=ext4 rootwait\0" \
"nandargs=setenv bootargs console=${console} " \
+   "${mtdparts} " \
"${optargs} " \
"root=ubi0:rootfs rw ubi.mtd=rootfs noinitrd " \
"rootfstype=ubifs rootwait\0" \
-   "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+   "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+   "importbootenv=echo Importing environment from mmc ...; " \
+   "env import -t ${loadaddr} ${filesize}\0" \
"bootscript=echo Running bootscript from mmc ...; " \
"source ${loadaddr}\0" \
"loaduimage=setenv bootfile uImage; " \
"fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
"loadzimage=setenv bootfile zImage; " \
"fatload mmc ${mmcdev} ${loadaddr} zImage\0" \
-   "loaddtb=fatload mmc ${mmcdev} ${fdtaddr} omap3-evm.dtb\0" \
+   "loaddtb=fatload mmc ${mmcdev} ${fdtaddr} " CONFIG_DEFAULT_FDT_FILE 
"\0" \
"mmcboot=echo Booting ${bootfile} from mmc ...; " \
"run mmcargs; " \
"bootm ${loadaddr} - ${fdtaddr}\0" \
@@ -135,8 +140,12 @@
 
 #define 

Re: [U-Boot] [PATCH 2/2] omap3: am3517_evm: Enable TI_COMMON_CMD_OPTION

2017-08-28 Thread Derald D. Woods
On Tue, Aug 22, 2017 at 10:50:02AM -0500, Adam Ford wrote:
> Enable TI_COMMON_CMD_OPTIONS and remove similar options
> from the defconfig. Updated with savedefconfig.
> 
> Signed-off-by: Adam Ford <aford...@gmail.com>

Tested-by: Derald D. Woods <woods.techni...@gmail.com>

> ---
>  board/logicpd/am3517evm/Kconfig |  2 ++
>  configs/am3517_evm_defconfig| 23 ---
>  2 files changed, 10 insertions(+), 15 deletions(-)
> 
> diff --git a/board/logicpd/am3517evm/Kconfig b/board/logicpd/am3517evm/Kconfig
> index 901f609..743e500 100644
> --- a/board/logicpd/am3517evm/Kconfig
> +++ b/board/logicpd/am3517evm/Kconfig
> @@ -9,4 +9,6 @@ config SYS_VENDOR
>  config SYS_CONFIG_NAME
>   default "am3517_evm"
>  
> +source "board/ti/common/Kconfig"
> +
>  endif
> diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig
> index e37d8cf..34043f8 100644
> --- a/configs/am3517_evm_defconfig
> +++ b/configs/am3517_evm_defconfig
> @@ -2,9 +2,9 @@ CONFIG_ARM=y
>  # CONFIG_SYS_THUMB_BUILD is not set
>  CONFIG_ARCH_OMAP2PLUS=y
>  CONFIG_SYS_TEXT_BASE=0x8010
> +CONFIG_TI_COMMON_CMD_OPTIONS=y
>  # CONFIG_SPL_GPIO_SUPPORT is not set
>  CONFIG_TARGET_AM3517_EVM=y
> -CONFIG_ENV_IS_IN_NAND=y
>  CONFIG_BOOTDELAY=10
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_SPL=y
> @@ -12,33 +12,26 @@ CONFIG_SPL=y
>  CONFIG_SPL_MTD_SUPPORT=y
>  CONFIG_HUSH_PARSER=y
>  CONFIG_SYS_PROMPT="AM3517_EVM # "
> -CONFIG_CMD_BOOTZ=y
>  # CONFIG_CMD_IMI is not set
>  # CONFIG_CMD_IMLS is not set
> -CONFIG_CMD_ASKENV=y
> +# CONFIG_CMD_EEPROM is not set
>  # CONFIG_CMD_FLASH is not set
>  # CONFIG_CMD_FPGA is not set
> -CONFIG_CMD_GPIO=y
> -CONFIG_CMD_I2C=y
> -CONFIG_CMD_MMC=y
> +# CONFIG_CMD_GPT is not set
>  CONFIG_CMD_NAND=y
> -CONFIG_CMD_PART=y
> -CONFIG_CMD_USB=y
> +# CONFIG_CMD_SPI is not set
>  # CONFIG_CMD_SETEXPR is not set
> -CONFIG_CMD_DHCP=y
> -CONFIG_CMD_PING=y
> +# CONFIG_CMD_MII is not set
>  CONFIG_CMD_CACHE=y
> -CONFIG_CMD_EXT2=y
> -CONFIG_CMD_EXT4=y
> -CONFIG_CMD_EXT4_WRITE=y
> -CONFIG_CMD_FAT=y
> -CONFIG_CMD_FS_GENERIC=y
> +# CONFIG_CMD_TIME is not set
>  CONFIG_CMD_UBI=y
>  CONFIG_SPL_PARTITION_UUIDS=y
> +CONFIG_ENV_IS_IN_NAND=y
>  CONFIG_MMC_OMAP_HS=y
>  CONFIG_NAND=y
>  CONFIG_SYS_NS16550=y
>  CONFIG_USB=y
>  CONFIG_USB_MUSB_HOST=y
>  CONFIG_USB_STORAGE=y
> +# CONFIG_FAT_WRITE is not set
>  CONFIG_OF_LIBFDT=y
> -- 
> 2.7.4
> 
> ___
> 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


Re: [U-Boot] [PATCH 1/2] ARM: OMAP3: am3517_evm: Move header to ti_omap3_common.h

2017-08-28 Thread Derald D. Woods
On Tue, Aug 22, 2017 at 10:50:01AM -0500, Adam Ford wrote:
> Much of the AM3517 functions are copies of the standard definitions
> used in ti_omap3_common.h.  Moving to include a common file
> reduces the amount of duplicative code and clutter.  A few
> AM3517 specific functions (like EMIF4) are explictly defined
> and a few items are undefined or redefined, but overall the number
> of lines of code shink.
> 
> Signed-off-by: Adam Ford <aford...@gmail.com>

Tested-by: Derald D. Woods <woods.techni...@gmail.com>

> ---
>  include/configs/am3517_evm.h | 48 
> +---
>  1 file changed, 5 insertions(+), 43 deletions(-)
> 
> diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
> index e957a28..9bf50e6 100644
> --- a/include/configs/am3517_evm.h
> +++ b/include/configs/am3517_evm.h
> @@ -14,7 +14,6 @@
>  #define __CONFIG_H
>  
>  #define CONFIG_NR_DRAM_BANKS 2   /* CS1 may or may not be populated */
> -
>  #define CONFIG_EMIF4 /* The chip has EMIF4 controller */
>  
>  /*
> @@ -27,39 +26,26 @@
>  #define CONFIG_SYS_SPL_MALLOC_START  0x80208000
>  #define CONFIG_SYS_SPL_MALLOC_SIZE   0x10
>  
> -#include /* get chip and board defs */
> -#include 
> +#include 
> +#undef CONFIG_SDRC   /* Disable SDRC since we have EMIF4 */
>  
>  #define CONFIG_MISC_INIT_R
> -#define CONFIG_CMDLINE_TAG   /* enable passing of ATAGs */
> -#define CONFIG_SETUP_MEMORY_TAGS
> -#define CONFIG_INITRD_TAG
>  #define CONFIG_REVISION_TAG
>  
> -/* Clock Defines */
> -#define V_OSCK   2600/* Clock output from T2 
> */
> -#define V_SCLK   (V_OSCK >> 1)
> -
> -/* Size of malloc() pool */
> -#define CONFIG_SYS_MALLOC_LEN(16 << 20)
> -
>  /* Hardware drivers */
>  
>  /* NS16550 Configuration */
> -#define V_NS16550_CLK4800/* 48MHz 
> (APLL96/2) */
>  #define CONFIG_SYS_NS16550_SERIAL
>  #define CONFIG_SYS_NS16550_REG_SIZE  (-4)
> -#define CONFIG_SYS_NS16550_CLK   V_NS16550_CLK
>  
>  /* select serial console configuration */
>  #define CONFIG_CONS_INDEX3
>  #define CONFIG_SYS_NS16550_COM3  OMAP34XX_UART3
>  #define CONFIG_SERIAL3   3   /* UART3 on AM3517 EVM 
> */
>  
> +
>  /* allow to overwrite serial and ethaddr */
>  #define CONFIG_ENV_OVERWRITE
> -#define CONFIG_SYS_BAUDRATE_TABLE{4800, 9600, 19200, 38400, 57600,\
> - 115200}
>  
>  /*
>   * USB configuration
> @@ -104,16 +90,10 @@
>  
>  /* Board NAND Info. */
>  #ifdef CONFIG_NAND
> -#define CONFIG_NAND_OMAP_GPMC
>  #define CONFIG_NAND_OMAP_GPMC_PREFETCH
>  #define CONFIG_BCH
>  #define CONFIG_SYS_NAND_ADDR NAND_BASE   /* physical address */
>   /* to access nand */
> -#define CONFIG_SYS_NAND_BASE NAND_BASE   /* physical address */
> - /* to access */
> - /* nand at CS0 */
> -#define CONFIG_SYS_MAX_NAND_DEVICE   1   /* Max number of */
> - /* NAND devices */
>  #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
>  #define CONFIG_SYS_NAND_5_ADDR_CYCLE
>  #define CONFIG_SYS_NAND_PAGE_COUNT   64
> @@ -233,8 +213,6 @@
>  /* We set the max number of command args high to avoid HUSH bugs. */
>  #define CONFIG_SYS_MAXARGS   64
>  
> -/* Console I/O Buffer Size */
> -#define CONFIG_SYS_CBSIZE512
>  /* Print Buffer Size */
>  #define CONFIG_SYS_PBSIZE(CONFIG_SYS_CBSIZE \
>   + sizeof(CONFIG_SYS_PROMPT) + 16)
> @@ -246,27 +224,10 @@
>  #define CONFIG_SYS_MEMTEST_END   (OMAP34XX_SDRC_CS0 + \
>   0x01F0) /* 31MB */
>  
> -#define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default load */
> - /* address */
> -
> -/*
> - * AM3517 has 12 GP timers, they can be driven by the system clock
> - * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
> - * This rate is divided by a local divisor.
> - */
> -#define CONFIG_SYS_TIMERBASE OMAP34XX_GPT2
> -#define CONFIG_SYS_PTV   2   /* Divisor: 2^(PTV+1) 
> => 8 */
> -
>  /* Physical Memory Map */
> -#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
> -#define PHYS_SDRAM_2 OMAP

[U-Boot] [PATCH] omap3: evm: Fixes for CONFIG_NAND, SPL_OS_BOOT, USB, and environment

2017-08-28 Thread Derald D. Woods
- Pass MTDPARTS kernel arguments to kernel
- Use Kconfig CONFIG_NAND instead of CONFIG_SYS_EXTRA_OPTIONS="NAND"
- Call 'usb_stop' on kernel start
- Update Falcon mode setup to match other OMAP3 boards
- Use "uEnv.txt" as boot script instead of "boot.scr"
---
 board/ti/evm/evm.c  | 20 +++-
 configs/omap3_evm_defconfig |  2 +-
 include/configs/omap3_evm.h | 30 --
 3 files changed, 40 insertions(+), 12 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 6bf57f9269..1f0433dcc0 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -122,6 +122,17 @@ int board_init(void)
return 0;
 }
 
+#if defined(CONFIG_SPL_OS_BOOT)
+int spl_start_uboot(void)
+{
+   /* break into full u-boot on 'c' */
+   if (serial_tstc() && serial_getc() == 'c')
+   return 1;
+
+   return 0;
+}
+#endif /* CONFIG_SPL_OS_BOOT */
+
 #if defined(CONFIG_SPL_BUILD)
 /*
  * Routine: get_board_mem_timings
@@ -323,7 +334,14 @@ void board_mmc_power_init(void)
 }
 #endif /* CONFIG_MMC */
 
-#if defined(CONFIG_USB_EHCI_HCD)
+#if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD)
+/* Call usb_stop() before starting the kernel */
+void show_boot_progress(int val)
+{
+   if (val == BOOTSTAGE_ID_RUN_OS)
+   usb_stop();
+}
+
 static struct omap_usbhs_board_data usbhs_bdata = {
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index a07ea0fd55..6316b797fd 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -7,7 +7,6 @@ CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
 CONFIG_SPL_STACK_R_ADDR=0x8200
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_SYS_EXTRA_OPTIONS="NAND"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
@@ -44,6 +43,7 @@ CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_NAND=y
 CONFIG_MTD=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 9930483406..8972e96366 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -36,7 +36,6 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
-
 /* Override OMAP3 serial console configuration */
 #undef CONFIG_CONS_INDEX
 #define CONFIG_CONS_INDEX   1
@@ -76,11 +75,14 @@
 #define CONFIG_SPL_OMAP3_ID_NAND
 #define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
 #define CONFIG_MTD_PARTITIONS   /* required for UBI partition support 
*/
+/* NAND: SPL falcon mode configs */
+#if defined(CONFIG_SPL_OS_BOOT)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x28
+#endif /* CONFIG_SPL_OS_BOOT */
 #endif /* CONFIG_NAND */
 
-#define CONFIG_USB_OMAP3
-
 /* MUSB */
+#define CONFIG_USB_OMAP3
 #define CONFIG_USB_MUSB_OMAP2PLUS
 #define CONFIG_USB_MUSB_PIO_ONLY
 #define CONFIG_USB_ETHER
@@ -101,28 +103,32 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
-   "mtdids=" CONFIG_MTDIDS_DEFAULT "\0"\
+   "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
-   "loadaddr=0x8200\0" \
-   "usbtty=cdc_acm\0" \
+   "bootenv=uEnv.txt\0" \
+   "optargs=\0" \
"mmcdev=0\0" \
"console=ttyO0,115200n8\0" \
"mmcargs=setenv bootargs console=${console} " \
+   "${mtdparts} " \
"${optargs} " \
"root=/dev/mmcblk0p2 rw " \
"rootfstype=ext4 rootwait\0" \
"nandargs=setenv bootargs console=${console} " \
+   "${mtdparts} " \
"${optargs} " \
"root=ubi0:rootfs rw ubi.mtd=rootfs noinitrd " \
"rootfstype=ubifs rootwait\0" \
-   "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+   "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+   "importbootenv=echo Importing environment from mmc ...; " \
+   "env import -t ${loadaddr} ${filesize}\0" \
"bootscript=echo Running bootscript from mmc ...; " \
"source ${loadaddr}\0" \
"loaduimage=setenv bootfile uImage; " \
"fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
"loadzimage=setenv bootfile zImage; " \
"fatload mmc ${mmcdev} ${loadaddr} zImage\0" \
-   "loaddtb=fatload mmc ${mmcdev} ${fdtaddr} omap3-evm.dtb\0" \
+   "loaddtb=fatload mmc ${mmcdev} ${fdtaddr} " CONFIG_DEFAULT_FDT_FILE 
"\0" \
"mmcboot=echo Booting ${bootfile} from mmc ...; " \
"run mmcargs; " \
"bootm ${loadaddr} - ${fdtaddr}\0" \
@@ -137,8 +143,12 @@
 
 #define CONFIG_BOOTCOMMAND \
"mmc dev ${mmcdev}; if mmc rescan; then " \
-   "if run loadbootscript; then " \
-   "run bootscript; " \
+   "if run loadbootenv; then " \
+   

[U-Boot] [PATCH v3] omap3: evm: Update board, defconfig, and maintainer file

2017-08-05 Thread Derald D. Woods
This patch brings the OMAP3 EVM to a bootable state, on master, as of
v2017.09-rc1.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>

--- 

Changes in v3:
- Update MAINTAINERS file
- Update commit message

Changes in v2:
- Unset {EFI,ISO}_PARTITION
- Unset EFI_LOADER
- Unset SPL_EXT_SUPPORT
- Unset THUMB_BUILD
** It does boot with THUMB_BUILD, it just should not be default

---
 board/ti/evm/MAINTAINERS|   2 +-
 board/ti/evm/evm.c  | 126 +++---
 board/ti/evm/evm.h  |  25 +--
 configs/omap3_evm_defconfig |  70 +++-
 include/configs/omap3_evm.h | 390 ++--
 5 files changed, 269 insertions(+), 344 deletions(-)

diff --git a/board/ti/evm/MAINTAINERS b/board/ti/evm/MAINTAINERS
index 612a08ace0..cd315c1635 100644
--- a/board/ti/evm/MAINTAINERS
+++ b/board/ti/evm/MAINTAINERS
@@ -1,5 +1,5 @@
 EVM BOARD
-M: Tom Rini <tr...@konsulko.com>
+M:     Derald D. Woods <woods.techni...@gmail.com>
 S: Maintained
 F: board/ti/evm/
 F: include/configs/omap3_evm.h
diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index fe8e79312f..e770ac04d0 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -12,6 +12,8 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -22,14 +24,35 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include "evm.h"
 
-#define OMAP3EVM_GPIO_ETH_RST_GEN1 64
-#define OMAP3EVM_GPIO_ETH_RST_GEN2 7
+#ifdef CONFIG_USB_EHCI_HCD
+#include 
+#include 
+#endif
+
+#define OMAP3EVM_GPIO_ETH_RST_GEN1 64
+#define OMAP3EVM_GPIO_ETH_RST_GEN2 7
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static const struct ns16550_platdata omap3_evm_serial = {
+   .base = OMAP34XX_UART1,
+   .reg_shift = 2,
+   .clock = V_NS16550_CLK,
+   .fcr = UART_FCR_DEFVAL,
+};
+
+U_BOOT_DEVICE(omap3_evm_uart) = {
+   "ns16550_serial",
+   _evm_serial
+};
+
 static u32 omap3_evm_version;
 
 u32 get_omap3_evm_rev(void)
@@ -60,25 +83,19 @@ static void omap3_evm_get_revision(void)
default:
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
}
-#else
+#else /* !CONFIG_CMD_NET */
 #if defined(CONFIG_STATIC_BOARD_REV)
-   /*
-* Look for static defintion of the board revision
-*/
+   /* Look for static defintion of the board revision */
omap3_evm_version = CONFIG_STATIC_BOARD_REV;
 #else
-   /*
-* Fallback to the default above.
-*/
+   /* Fallback to the default above */
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
-#endif
-#endif /* CONFIG_CMD_NET */
+#endif /* CONFIG_STATIC_BOARD_REV */
+#endif /* CONFIG_CMD_NET */
 }
 
-#ifdef CONFIG_USB_OMAP3
-/*
- * MUSB port on OMAP3EVM Rev >= E requires extvbus programming.
- */
+#if defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)
+/* MUSB port on OMAP3EVM Rev >= E requires extvbus programming. */
 u8 omap3_evm_need_extvbus(void)
 {
u8 retval = 0;
@@ -88,7 +105,7 @@ u8 omap3_evm_need_extvbus(void)
 
return retval;
 }
-#endif
+#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */
 
 /*
  * Routine: board_init
@@ -105,7 +122,7 @@ int board_init(void)
return 0;
 }
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD)
 /*
  * Routine: get_board_mem_timings
  * Description: If we use SPL then there is no x-loader nor config header
@@ -138,7 +155,34 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
timings->mr = MICRON_V_MR_165;
 }
-#endif
+#endif /* CONFIG_SPL_BUILD */
+
+#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
+static struct musb_hdrc_config musb_config = {
+   .multipoint = 1,
+   .dyn_fifo   = 1,
+   .num_eps= 16,
+   .ram_bits   = 12,
+};
+
+static struct omap_musb_board_data musb_board_data = {
+   .interface_type = MUSB_INTERFACE_ULPI,
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#if defined(CONFIG_USB_MUSB_HOST)
+   .mode   = MUSB_HOST,
+#elif defined(CONFIG_USB_MUSB_GADGET)
+   .mode   = MUSB_PERIPHERAL,
+#else
+#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
+#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */
+   .config = _config,
+   .power  = 100,
+   .platform_ops   = _ops,
+   .board_data = _board_data,
+};
+#endif /* CONFIG_USB_MUSB_OMAP2PLUS */
 
 /*
  * Routine: misc_init_r
@@ -146,8 +190,9 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
  */
 int misc_init_r(void)
 {
+   twl4030_power_init();
 
-#ifdef CONFIG_SYS_I2C_OMAP34XX
+#if defined(CONFIG_SYS_I2C_OMAP34XX)
i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 #endif
 
@@ -161,6 +206,13 @@ int misc_init_r(void)
 #endif
omap_die_id_display();
 
+#if de

[U-Boot] [PATCH v2] omap3evm: Update board and defconfig files

2017-08-04 Thread Derald D. Woods
This patch brings the OMAP3 EVM to a bootable state, on master, as of
v2017.09-rc1.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>

--- 
Changes in v2:
- Unset {EFI,ISO}_PARTITION
- Unset EFI_LOADER
- Unset SPL_EXT_SUPPORT
- Unset THUMB_BUILD
** It does boot with THUMB_BUILD, it just should not be default

---
 board/ti/evm/evm.c  | 126 +++---
 board/ti/evm/evm.h  |  25 +--
 configs/omap3_evm_defconfig |  70 +++-
 include/configs/omap3_evm.h | 390 ++--
 4 files changed, 268 insertions(+), 343 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index fe8e79312f..e770ac04d0 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -12,6 +12,8 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -22,14 +24,35 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include "evm.h"
 
-#define OMAP3EVM_GPIO_ETH_RST_GEN1 64
-#define OMAP3EVM_GPIO_ETH_RST_GEN2 7
+#ifdef CONFIG_USB_EHCI_HCD
+#include 
+#include 
+#endif
+
+#define OMAP3EVM_GPIO_ETH_RST_GEN1 64
+#define OMAP3EVM_GPIO_ETH_RST_GEN2 7
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static const struct ns16550_platdata omap3_evm_serial = {
+   .base = OMAP34XX_UART1,
+   .reg_shift = 2,
+   .clock = V_NS16550_CLK,
+   .fcr = UART_FCR_DEFVAL,
+};
+
+U_BOOT_DEVICE(omap3_evm_uart) = {
+   "ns16550_serial",
+   _evm_serial
+};
+
 static u32 omap3_evm_version;
 
 u32 get_omap3_evm_rev(void)
@@ -60,25 +83,19 @@ static void omap3_evm_get_revision(void)
default:
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
}
-#else
+#else /* !CONFIG_CMD_NET */
 #if defined(CONFIG_STATIC_BOARD_REV)
-   /*
-* Look for static defintion of the board revision
-*/
+   /* Look for static defintion of the board revision */
omap3_evm_version = CONFIG_STATIC_BOARD_REV;
 #else
-   /*
-* Fallback to the default above.
-*/
+   /* Fallback to the default above */
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
-#endif
-#endif /* CONFIG_CMD_NET */
+#endif /* CONFIG_STATIC_BOARD_REV */
+#endif /* CONFIG_CMD_NET */
 }
 
-#ifdef CONFIG_USB_OMAP3
-/*
- * MUSB port on OMAP3EVM Rev >= E requires extvbus programming.
- */
+#if defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)
+/* MUSB port on OMAP3EVM Rev >= E requires extvbus programming. */
 u8 omap3_evm_need_extvbus(void)
 {
u8 retval = 0;
@@ -88,7 +105,7 @@ u8 omap3_evm_need_extvbus(void)
 
return retval;
 }
-#endif
+#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */
 
 /*
  * Routine: board_init
@@ -105,7 +122,7 @@ int board_init(void)
return 0;
 }
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD)
 /*
  * Routine: get_board_mem_timings
  * Description: If we use SPL then there is no x-loader nor config header
@@ -138,7 +155,34 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
timings->mr = MICRON_V_MR_165;
 }
-#endif
+#endif /* CONFIG_SPL_BUILD */
+
+#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
+static struct musb_hdrc_config musb_config = {
+   .multipoint = 1,
+   .dyn_fifo   = 1,
+   .num_eps= 16,
+   .ram_bits   = 12,
+};
+
+static struct omap_musb_board_data musb_board_data = {
+   .interface_type = MUSB_INTERFACE_ULPI,
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#if defined(CONFIG_USB_MUSB_HOST)
+   .mode   = MUSB_HOST,
+#elif defined(CONFIG_USB_MUSB_GADGET)
+   .mode   = MUSB_PERIPHERAL,
+#else
+#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
+#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */
+   .config = _config,
+   .power  = 100,
+   .platform_ops   = _ops,
+   .board_data = _board_data,
+};
+#endif /* CONFIG_USB_MUSB_OMAP2PLUS */
 
 /*
  * Routine: misc_init_r
@@ -146,8 +190,9 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
  */
 int misc_init_r(void)
 {
+   twl4030_power_init();
 
-#ifdef CONFIG_SYS_I2C_OMAP34XX
+#if defined(CONFIG_SYS_I2C_OMAP34XX)
i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 #endif
 
@@ -161,6 +206,13 @@ int misc_init_r(void)
 #endif
omap_die_id_display();
 
+#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
+   musb_register(_plat, _board_data, (void *)MUSB_BASE);
+#endif
+
+#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET)
+   omap_die_id_usbethaddr();
+#endif
return 0;
 }
 
@@ -175,7 +227,7 @@ void set_muxconf_regs(void)
MUX_EVM();
 }
 
-#ifdef CONFIG_CMD_NET
+#if defined(CONFIG_CMD_NET)
 /*
  * Routine: setup_net_chip
  * Description: Setting up the configuration GPMC registers specific to the
@

[U-Boot] [PATCH] omap3evm: Update board and defconfig files

2017-08-02 Thread Derald D. Woods
This patch brings the OMAP3 EVM to a bootable state, on master, as of
v2017.09-rc1.

Signed-off-by: Derald D. Woods <woods.techni...@gmail.com>
---
 board/ti/evm/evm.c  | 126 +++---
 board/ti/evm/evm.h  |  25 +--
 configs/omap3_evm_defconfig |  67 +++-
 include/configs/omap3_evm.h | 390 ++--
 4 files changed, 263 insertions(+), 345 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index fe8e79312f..e770ac04d0 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -12,6 +12,8 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -22,14 +24,35 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include "evm.h"
 
-#define OMAP3EVM_GPIO_ETH_RST_GEN1 64
-#define OMAP3EVM_GPIO_ETH_RST_GEN2 7
+#ifdef CONFIG_USB_EHCI_HCD
+#include 
+#include 
+#endif
+
+#define OMAP3EVM_GPIO_ETH_RST_GEN1 64
+#define OMAP3EVM_GPIO_ETH_RST_GEN2 7
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static const struct ns16550_platdata omap3_evm_serial = {
+   .base = OMAP34XX_UART1,
+   .reg_shift = 2,
+   .clock = V_NS16550_CLK,
+   .fcr = UART_FCR_DEFVAL,
+};
+
+U_BOOT_DEVICE(omap3_evm_uart) = {
+   "ns16550_serial",
+   _evm_serial
+};
+
 static u32 omap3_evm_version;
 
 u32 get_omap3_evm_rev(void)
@@ -60,25 +83,19 @@ static void omap3_evm_get_revision(void)
default:
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
}
-#else
+#else /* !CONFIG_CMD_NET */
 #if defined(CONFIG_STATIC_BOARD_REV)
-   /*
-* Look for static defintion of the board revision
-*/
+   /* Look for static defintion of the board revision */
omap3_evm_version = CONFIG_STATIC_BOARD_REV;
 #else
-   /*
-* Fallback to the default above.
-*/
+   /* Fallback to the default above */
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
-#endif
-#endif /* CONFIG_CMD_NET */
+#endif /* CONFIG_STATIC_BOARD_REV */
+#endif /* CONFIG_CMD_NET */
 }
 
-#ifdef CONFIG_USB_OMAP3
-/*
- * MUSB port on OMAP3EVM Rev >= E requires extvbus programming.
- */
+#if defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)
+/* MUSB port on OMAP3EVM Rev >= E requires extvbus programming. */
 u8 omap3_evm_need_extvbus(void)
 {
u8 retval = 0;
@@ -88,7 +105,7 @@ u8 omap3_evm_need_extvbus(void)
 
return retval;
 }
-#endif
+#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */
 
 /*
  * Routine: board_init
@@ -105,7 +122,7 @@ int board_init(void)
return 0;
 }
 
-#ifdef CONFIG_SPL_BUILD
+#if defined(CONFIG_SPL_BUILD)
 /*
  * Routine: get_board_mem_timings
  * Description: If we use SPL then there is no x-loader nor config header
@@ -138,7 +155,34 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
timings->mr = MICRON_V_MR_165;
 }
-#endif
+#endif /* CONFIG_SPL_BUILD */
+
+#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
+static struct musb_hdrc_config musb_config = {
+   .multipoint = 1,
+   .dyn_fifo   = 1,
+   .num_eps= 16,
+   .ram_bits   = 12,
+};
+
+static struct omap_musb_board_data musb_board_data = {
+   .interface_type = MUSB_INTERFACE_ULPI,
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#if defined(CONFIG_USB_MUSB_HOST)
+   .mode   = MUSB_HOST,
+#elif defined(CONFIG_USB_MUSB_GADGET)
+   .mode   = MUSB_PERIPHERAL,
+#else
+#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
+#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */
+   .config = _config,
+   .power  = 100,
+   .platform_ops   = _ops,
+   .board_data = _board_data,
+};
+#endif /* CONFIG_USB_MUSB_OMAP2PLUS */
 
 /*
  * Routine: misc_init_r
@@ -146,8 +190,9 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
  */
 int misc_init_r(void)
 {
+   twl4030_power_init();
 
-#ifdef CONFIG_SYS_I2C_OMAP34XX
+#if defined(CONFIG_SYS_I2C_OMAP34XX)
i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 #endif
 
@@ -161,6 +206,13 @@ int misc_init_r(void)
 #endif
omap_die_id_display();
 
+#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
+   musb_register(_plat, _board_data, (void *)MUSB_BASE);
+#endif
+
+#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET)
+   omap_die_id_usbethaddr();
+#endif
return 0;
 }
 
@@ -175,7 +227,7 @@ void set_muxconf_regs(void)
MUX_EVM();
 }
 
-#ifdef CONFIG_CMD_NET
+#if defined(CONFIG_CMD_NET)
 /*
  * Routine: setup_net_chip
  * Description: Setting up the configuration GPMC registers specific to the
@@ -237,7 +289,7 @@ static void reset_net_chip(void)
 int board_eth_init(bd_t *bis)
 {
int rc = 0;
-#ifdef CONFIG_SMC911X
+#if defined(CONFIG_SMC911X)
 #define STR_ENV_E

[U-Boot] [PATCH] arm: omap: Fix 'get_device_type()' for OMAP34XX

2017-07-30 Thread Derald D. Woods
Fixes 00bbe96ebabb (arm: omap: Unify get_device_type() function) where
the control status register value is embedded in a structure somewhere
in SRAM. This patch allows OMAP3 EVM (TMDSEVM3530) to boot again using
a known global constant and offset for 'readl'.
---
 arch/arm/mach-omap2/sysinfo-common.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-omap2/sysinfo-common.c 
b/arch/arm/mach-omap2/sysinfo-common.c
index 1dc7051ab3..3955e803ad 100644
--- a/arch/arm/mach-omap2/sysinfo-common.c
+++ b/arch/arm/mach-omap2/sysinfo-common.c
@@ -16,6 +16,10 @@
  */
 u32 get_device_type(void)
 {
+#if defined(CONFIG_OMAP34XX)
+   return (readl(OMAP34XX_CTRL_BASE + 0x2f0) & DEVICE_TYPE_MASK) >>
+   DEVICE_TYPE_SHIFT;
+#endif
return (readl((*ctrl)->control_status) & DEVICE_TYPE_MASK) >>
DEVICE_TYPE_SHIFT;
 }
-- 
2.13.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


  1   2   >