diff options
author | Tom Rini <trini@konsulko.com> | 2021-11-19 16:33:33 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-11-19 16:33:33 -0500 |
commit | 454a97485a1854d4ac4f3b7d408caf3b355beca0 (patch) | |
tree | c40b9364239d50f2a772363ac6b9556da1f420d6 | |
parent | b5f2c68d5c86d1300240483c4c0c3cc6015754a8 (diff) | |
parent | 28f70cfcfd82ac509c8da772b74e5dc2df795fd2 (diff) | |
download | u-boot-454a97485a1854d4ac4f3b7d408caf3b355beca0.zip u-boot-454a97485a1854d4ac4f3b7d408caf3b355beca0.tar.gz u-boot-454a97485a1854d4ac4f3b7d408caf3b355beca0.tar.bz2 |
Merge tag 'u-boot-amlogic-20211119' of https://source.denx.de/u-boot/custodians/u-boot-amlogicWIP/19Nov2021
- pinctrl: Correct the driver GPIO declaration
- meson64_android: handle errors on boot and run fastboot on boot failure
-rw-r--r-- | drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/meson/pinctrl-meson-gx.h | 2 | ||||
-rw-r--r-- | drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 4 | ||||
-rw-r--r-- | drivers/pinctrl/meson/pinctrl-meson-gxl.c | 4 | ||||
-rw-r--r-- | include/configs/meson64_android.h | 47 |
5 files changed, 35 insertions, 24 deletions
diff --git a/drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c b/drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c index 159f340..99502d8 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c @@ -145,7 +145,7 @@ static const struct dm_gpio_ops meson_gx_gpio_ops = { .direction_output = meson_gpio_direction_output, }; -const struct driver meson_gx_gpio_driver = { +U_BOOT_DRIVER(meson_gx_gpio_driver) = { .name = "meson-gx-gpio", .id = UCLASS_GPIO, .probe = meson_gpio_probe, diff --git a/drivers/pinctrl/meson/pinctrl-meson-gx.h b/drivers/pinctrl/meson/pinctrl-meson-gx.h index 4c1aa1a..c70c1f5 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gx.h +++ b/drivers/pinctrl/meson/pinctrl-meson-gx.h @@ -43,6 +43,6 @@ struct meson_gx_pmx_data { } extern const struct pinctrl_ops meson_gx_pinctrl_ops; -extern const struct driver meson_gx_gpio_driver; +extern U_BOOT_DRIVER(meson_gx_gpio_driver); #endif /* __PINCTRL_MESON_GX_H__ */ diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c index 8c01c73..93a895c 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c @@ -439,7 +439,7 @@ struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_gxbb_periphs_groups), .num_funcs = ARRAY_SIZE(meson_gxbb_periphs_functions), .num_banks = ARRAY_SIZE(meson_gxbb_periphs_banks), - .gpio_driver = &meson_gx_gpio_driver, + .gpio_driver = DM_DRIVER_REF(meson_gx_gpio_driver), }; struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = { @@ -452,7 +452,7 @@ struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_gxbb_aobus_groups), .num_funcs = ARRAY_SIZE(meson_gxbb_aobus_functions), .num_banks = ARRAY_SIZE(meson_gxbb_aobus_banks), - .gpio_driver = &meson_gx_gpio_driver, + .gpio_driver = DM_DRIVER_REF(meson_gx_gpio_driver), }; static const struct udevice_id meson_gxbb_pinctrl_match[] = { diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c index 51a0b4c..a44145e 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c @@ -701,7 +701,7 @@ struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_gxl_periphs_groups), .num_funcs = ARRAY_SIZE(meson_gxl_periphs_functions), .num_banks = ARRAY_SIZE(meson_gxl_periphs_banks), - .gpio_driver = &meson_gx_gpio_driver, + .gpio_driver = DM_DRIVER_REF(meson_gx_gpio_driver), }; struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = { @@ -714,7 +714,7 @@ struct meson_pinctrl_data meson_gxl_aobus_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_gxl_aobus_groups), .num_funcs = ARRAY_SIZE(meson_gxl_aobus_functions), .num_banks = ARRAY_SIZE(meson_gxl_aobus_banks), - .gpio_driver = &meson_gx_gpio_driver, + .gpio_driver = DM_DRIVER_REF(meson_gx_gpio_driver), }; static const struct udevice_id meson_gxl_pinctrl_match[] = { diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h index fb3ccc3..7cd1ab0 100644 --- a/include/configs/meson64_android.h +++ b/include/configs/meson64_android.h @@ -140,24 +140,27 @@ "echo Fastboot forced by usb rom boot;" \ "setenv run_fastboot 1;" \ "fi;" \ - "if gpt verify mmc ${mmcdev} ${partitions}; then; " \ - "else " \ - "echo Broken MMC partition scheme;" \ - "setenv run_fastboot 1;" \ - "fi;" \ - "if bcb load " __stringify(CONFIG_FASTBOOT_FLASH_MMC_DEV) " " \ - CONTROL_PARTITION "; then " \ - "if bcb test command = bootonce-bootloader; then " \ - "echo BCB: Bootloader boot...; " \ - "bcb clear command; bcb store; " \ + "if test \"${run_fastboot}\" -eq 0; then " \ + "if gpt verify mmc ${mmcdev} ${partitions}; then; " \ + "else " \ + "echo Broken MMC partition scheme;" \ "setenv run_fastboot 1;" \ "fi; " \ - "if bcb test command = boot-fastboot; then " \ - "echo BCB: fastboot userspace boot...; " \ - "setenv force_recovery 1;" \ - "fi; " \ - "else " \ - "echo Warning: BCB is corrupted or does not exist; " \ + "fi;" \ + "if test \"${run_fastboot}\" -eq 0; then " \ + "if bcb load " __stringify(CONFIG_FASTBOOT_FLASH_MMC_DEV) " " \ + CONTROL_PARTITION "; then " \ + "if bcb test command = bootonce-bootloader; then " \ + "echo BCB: Bootloader boot...; " \ + "bcb clear command; bcb store; " \ + "setenv run_fastboot 1;" \ + "elif bcb test command = boot-fastboot; then " \ + "echo BCB: fastboot userspace boot...; " \ + "setenv force_recovery 1;" \ + "fi; " \ + "else " \ + "echo Warning: BCB is corrupted or does not exist; " \ + "fi;" \ "fi;" \ "if test \"${run_fastboot}\" -eq 1; then " \ "echo Running Fastboot...;" \ @@ -230,16 +233,24 @@ "echo Running Android...;" \ BOOT_CMD \ "fi;" \ - "echo Failed to boot Android...;" \ - "reset\0" + "echo Failed to boot Android...;\0" #define BOOTENV_DEV_NAME_SYSTEM(devtypeu, devtypel, instance) \ "system " +#define BOOTENV_DEV_PANIC(devtypeu, devtypel, instance) \ + "bootcmd_panic=" \ + "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \ + "reset\0" + +#define BOOTENV_DEV_NAME_PANIC(devtypeu, devtypel, instance) \ + "panic " + #define BOOT_TARGET_DEVICES(func) \ func(FASTBOOT, fastboot, na) \ func(RECOVERY, recovery, na) \ func(SYSTEM, system, na) \ + func(PANIC, panic, na) \ #define PREBOOT_LOAD_LOGO \ "if test \"${boot_source}\" != \"usb\" && " \ |