Re: [U-Boot] [PATCH 1/2] Revert "configs: Remove am335x_boneblack_defconfig"

2019-09-12 Thread Sam Protsenko
On Thu, Sep 12, 2019 at 6:23 PM Sam Protsenko
 wrote:
>
> Commit 8fa7f65dd02c ("configs: Remove am335x_boneblack_defconfig")
> removes defconfig for BeagleBone Black board, and it's advised to use
> am335x_evm_defconfig for all AM335x boards. But it's impossible to use
> am335x_evm_defconfig in eMMC use-case without modifications for BBB
> (NAND must be disabled, MMC enabled, etc). This is inconvenient for user
> to do such modifications via menuconfig (only developer knows what
> should be done). Furthermore, enabling MMC options in
> am335x_evm_defconfig leads to wrong pin-muxing scheme in
> board/ti/am335x/mux.c, because both NAND and MMC options are going to be
> enabled in the config, so that pins are muxed for BBB with NAND cape,
> which in turn leads to non-functioning eMMC. There is no way to make the
> single defconfig working for both eMMC and NAND use-cases, because we
> can't figure out in run-time which board configuration is used by user
> (EVM, BBB, or BBB with NAND cape). Hence we rely on CONFIG options to
> figure out which configuration is used. Because of this we can't use
> single defconfig for AM335x EVM and BBB.
>
> All that said, let's bring back am335x_boneblack_defconfig, because
> right now users are not able to use U-Boot for BBB. Further patch will
> update this defconfig by enabling Driver Model and pulling some other
> useful options from am335x_evm_defconfig.
>
> Fixes: 8fa7f65dd02c ("configs: Remove am335x_boneblack_defconfig")
> Signed-off-by: Sam Protsenko 
> ---

Superseded by v2.

>  configs/am335x_boneblack_defconfig | 50 ++
>  1 file changed, 50 insertions(+)
>  create mode 100644 configs/am335x_boneblack_defconfig
>
> diff --git a/configs/am335x_boneblack_defconfig 
> b/configs/am335x_boneblack_defconfig
> new file mode 100644
> index 00..439d0cba05
> --- /dev/null
> +++ b/configs/am335x_boneblack_defconfig
> @@ -0,0 +1,50 @@
> +CONFIG_ARM=y
> +CONFIG_ARCH_OMAP2PLUS=y
> +CONFIG_TI_COMMON_CMD_OPTIONS=y
> +CONFIG_AM33XX=y
> +CONFIG_SPL=y
> +CONFIG_DISTRO_DEFAULTS=y
> +CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT"
> +CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; 
> run findfdt; run init_console; run envboot; run distro_bootcmd"
> +CONFIG_SYS_CONSOLE_INFO_QUIET=y
> +CONFIG_VERSION_VARIABLE=y
> +CONFIG_ARCH_MISC_INIT=y
> +CONFIG_SPL_MUSB_NEW_SUPPORT=y
> +# CONFIG_SPL_NAND_SUPPORT is not set
> +CONFIG_SPL_OS_BOOT=y
> +CONFIG_AUTOBOOT_KEYED=y
> +CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
> +CONFIG_AUTOBOOT_DELAY_STR="d"
> +CONFIG_AUTOBOOT_STOP_STR=" "
> +CONFIG_CMD_SPL=y
> +# CONFIG_CMD_FLASH is not set
> +# CONFIG_CMD_SETEXPR is not set
> +CONFIG_ENV_IS_IN_MMC=y
> +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
> +CONFIG_BOOTCOUNT_LIMIT=y
> +CONFIG_DFU_TFTP=y
> +CONFIG_DFU_MMC=y
> +CONFIG_DFU_RAM=y
> +CONFIG_USB_FUNCTION_FASTBOOT=y
> +CONFIG_FASTBOOT_FLASH=y
> +CONFIG_FASTBOOT_FLASH_MMC_DEV=1
> +CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
> +CONFIG_MMC_OMAP_HS=y
> +CONFIG_SPI_FLASH=y
> +CONFIG_SPI_FLASH_WINBOND=y
> +CONFIG_MII=y
> +CONFIG_DRIVER_TI_CPSW=y
> +CONFIG_SPI=y
> +CONFIG_OMAP3_SPI=y
> +CONFIG_USB=y
> +CONFIG_USB_MUSB_HOST=y
> +CONFIG_USB_MUSB_GADGET=y
> +CONFIG_USB_MUSB_DSPS=y
> +CONFIG_USB_GADGET=y
> +CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
> +CONFIG_USB_GADGET_VENDOR_NUM=0x0451
> +CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
> +CONFIG_USB_ETHER=y
> +CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
> +CONFIG_LZO=y
> +CONFIG_OF_LIBFDT=y
> --
> 2.23.0.rc1
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] Revert "configs: Remove am335x_boneblack_defconfig"

2019-09-12 Thread Sam Protsenko
The eMMC boot works fine, but "env save" fails with message:

Saving Environment to FAT... Failed (1)

That's because CONFIG_ENV_IS_IN_MMC=y is not enabled, which wouldn't
work without CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT", because in
include/configs/am335x_evm.h it defines eMMC environment options:

...
#elif defined(CONFIG_EMMC_BOOT)
#define CONFIG_SYS_MMC_ENV_DEV1
#define CONFIG_SYS_MMC_ENV_PART0
#define CONFIG_ENV_OFFSET0x26
#define CONFIG_ENV_OFFSET_REDUND(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
#define CONFIG_SYS_MMC_MAX_DEVICE2

And if we enable those two options in am335x_evm_defconfig, it leads
to wrong pin-muxing in board/ti/am335x/mux.c (because CONFIG_NAND is
also enabled in am335x_evm_defconfig):

} else if (board_is_bone_lt()) {
...
configure_module_pin_mux(mmc0_pin_mux);
#if defined(CONFIG_NAND) && defined(CONFIG_EMMC_BOOT)
configure_module_pin_mux(nand_pin_mux);  < this line is executed
#elif defined(CONFIG_NOR) && defined(CONFIG_EMMC_BOOT)
configure_module_pin_mux(bone_norcape_pin_mux);
#else
configure_module_pin_mux(mmc1_pin_mux);
#endif

So I don't see any other way to overcome this issue other than keeping
separate defconfig for NAND and eMMC board variants. Of course, I can
fix commit message to state the reason more clearly. We can also
rename am335x_boneblack_defconfig to am335x_evm_mmc_defconfig, but it
doesn't change the fact it should be done. If somebody sees another
way around, please do tell.

Thanks!

On Thu, Sep 12, 2019 at 6:43 PM Andre Heider  wrote:
>
> Hi,
>
> On 9/12/19 5:23 PM, Sam Protsenko wrote:
> > Commit 8fa7f65dd02c ("configs: Remove am335x_boneblack_defconfig")
> > removes defconfig for BeagleBone Black board, and it's advised to use
> > am335x_evm_defconfig for all AM335x boards. But it's impossible to use
> > am335x_evm_defconfig in eMMC use-case without modifications for BBB
> > (NAND must be disabled, MMC enabled, etc). This is inconvenient for user
> > to do such modifications via menuconfig (only developer knows what
> > should be done). Furthermore, enabling MMC options in
> > am335x_evm_defconfig leads to wrong pin-muxing scheme in
> > board/ti/am335x/mux.c, because both NAND and MMC options are going to be
> > enabled in the config, so that pins are muxed for BBB with NAND cape,
> > which in turn leads to non-functioning eMMC. There is no way to make the
> > single defconfig working for both eMMC and NAND use-cases, because we
> > can't figure out in run-time which board configuration is used by user
> > (EVM, BBB, or BBB with NAND cape). Hence we rely on CONFIG options to
> > figure out which configuration is used. Because of this we can't use
> > single defconfig for AM335x EVM and BBB.
>
> for the record: I booted my bbb with am335x_evm_defconfig without any
> config changes from emmc using master a few days ago just fine. It works
> just as well as booting from sd card.
>
> That's with using distro boot, the legacy env cmds don't try to boot off
> emmc iirc.
>
> Regards,
> Andre
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] Revert "configs: Remove am335x_boneblack_defconfig"

2019-09-12 Thread Andre Heider

Hi,

On 9/12/19 5:23 PM, Sam Protsenko wrote:

Commit 8fa7f65dd02c ("configs: Remove am335x_boneblack_defconfig")
removes defconfig for BeagleBone Black board, and it's advised to use
am335x_evm_defconfig for all AM335x boards. But it's impossible to use
am335x_evm_defconfig in eMMC use-case without modifications for BBB
(NAND must be disabled, MMC enabled, etc). This is inconvenient for user
to do such modifications via menuconfig (only developer knows what
should be done). Furthermore, enabling MMC options in
am335x_evm_defconfig leads to wrong pin-muxing scheme in
board/ti/am335x/mux.c, because both NAND and MMC options are going to be
enabled in the config, so that pins are muxed for BBB with NAND cape,
which in turn leads to non-functioning eMMC. There is no way to make the
single defconfig working for both eMMC and NAND use-cases, because we
can't figure out in run-time which board configuration is used by user
(EVM, BBB, or BBB with NAND cape). Hence we rely on CONFIG options to
figure out which configuration is used. Because of this we can't use
single defconfig for AM335x EVM and BBB.


for the record: I booted my bbb with am335x_evm_defconfig without any 
config changes from emmc using master a few days ago just fine. It works 
just as well as booting from sd card.


That's with using distro boot, the legacy env cmds don't try to boot off 
emmc iirc.


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


[U-Boot] [PATCH 1/2] Revert "configs: Remove am335x_boneblack_defconfig"

2019-09-12 Thread Sam Protsenko
Commit 8fa7f65dd02c ("configs: Remove am335x_boneblack_defconfig")
removes defconfig for BeagleBone Black board, and it's advised to use
am335x_evm_defconfig for all AM335x boards. But it's impossible to use
am335x_evm_defconfig in eMMC use-case without modifications for BBB
(NAND must be disabled, MMC enabled, etc). This is inconvenient for user
to do such modifications via menuconfig (only developer knows what
should be done). Furthermore, enabling MMC options in
am335x_evm_defconfig leads to wrong pin-muxing scheme in
board/ti/am335x/mux.c, because both NAND and MMC options are going to be
enabled in the config, so that pins are muxed for BBB with NAND cape,
which in turn leads to non-functioning eMMC. There is no way to make the
single defconfig working for both eMMC and NAND use-cases, because we
can't figure out in run-time which board configuration is used by user
(EVM, BBB, or BBB with NAND cape). Hence we rely on CONFIG options to
figure out which configuration is used. Because of this we can't use
single defconfig for AM335x EVM and BBB.

All that said, let's bring back am335x_boneblack_defconfig, because
right now users are not able to use U-Boot for BBB. Further patch will
update this defconfig by enabling Driver Model and pulling some other
useful options from am335x_evm_defconfig.

Fixes: 8fa7f65dd02c ("configs: Remove am335x_boneblack_defconfig")
Signed-off-by: Sam Protsenko 
---
 configs/am335x_boneblack_defconfig | 50 ++
 1 file changed, 50 insertions(+)
 create mode 100644 configs/am335x_boneblack_defconfig

diff --git a/configs/am335x_boneblack_defconfig 
b/configs/am335x_boneblack_defconfig
new file mode 100644
index 00..439d0cba05
--- /dev/null
+++ b/configs/am335x_boneblack_defconfig
@@ -0,0 +1,50 @@
+CONFIG_ARM=y
+CONFIG_ARCH_OMAP2PLUS=y
+CONFIG_TI_COMMON_CMD_OPTIONS=y
+CONFIG_AM33XX=y
+CONFIG_SPL=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT"
+CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run 
findfdt; run init_console; run envboot; run distro_bootcmd"
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_ARCH_MISC_INIT=y
+CONFIG_SPL_MUSB_NEW_SUPPORT=y
+# CONFIG_SPL_NAND_SUPPORT is not set
+CONFIG_SPL_OS_BOOT=y
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
+CONFIG_AUTOBOOT_DELAY_STR="d"
+CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_SPL=y
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_DFU_TFTP=y
+CONFIG_DFU_MMC=y
+CONFIG_DFU_RAM=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=1
+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_MMC_OMAP_HS=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_MII=y
+CONFIG_DRIVER_TI_CPSW=y
+CONFIG_SPI=y
+CONFIG_OMAP3_SPI=y
+CONFIG_USB=y
+CONFIG_USB_MUSB_HOST=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_MUSB_DSPS=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
+CONFIG_LZO=y
+CONFIG_OF_LIBFDT=y
-- 
2.23.0.rc1

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