Re: [PATCH 29/88] i2c: Rename I2C_MUX_PCA954x

2023-01-23 Thread Luca Ceresoli
Hi Simon,

On Mon, 23 Jan 2023 14:59:32 -0700
Simon Glass  wrote:

> CONFIG options must not use lower-case letter. Convert this to upper case.
> 
> Signed-off-by: Simon Glass 
> ---
...
>  configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig | 2 +-

FYI, this board has been removed from Michal's tree:

https://lore.kernel.org/u-boot/093405ed-7e96-da00-cb7a-9ac3ad07b...@amd.com/

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


[PATCH v6 3/3] ARM: tegra: include timer as default option

2023-01-23 Thread Svyatoslav Ryhel
Enable TIMER as default option for all Tegra devices and
enable TEGRA_TIMER for TEGRA_ARMV7_COMMON. Additionally
enable SPL_TIMER if build as SPL part and drop deprecated
configs from common header.

Signed-off-by: Svyatoslav Ryhel 
Reviewed-by: Simon Glass 
---
 arch/arm/Kconfig   | 1 +
 arch/arm/mach-tegra/Kconfig| 2 ++
 include/configs/tegra-common.h | 6 --
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c9a44ebc22..92cf509e97 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1284,6 +1284,7 @@ config ARCH_TEGRA
select GPIO_EXTRA_HEADER
imply DISTRO_DEFAULTS
imply FAT_WRITE
+   imply SPL_TIMER if SPL
 
 config ARCH_VEXPRESS64
bool "Support ARMv8 Arm Ltd. VExpress based boards and models"
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 1b575cc0f4..cc3f00e501 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -56,6 +56,7 @@ config TEGRA_COMMON
select MISC
select OF_CONTROL
select SPI
+   select TIMER
imply CMD_DM
imply CRC32_VERIFY
 
@@ -81,6 +82,7 @@ config TEGRA_ARMV7_COMMON
select TEGRA_NO_BPMP
select TEGRA_PINCTRL
select TEGRA_PMC
+   select TEGRA_TIMER
 
 config TEGRA_ARMV8_COMMON
bool "Tegra 64-bit common options"
diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
index bde7ffce00..c558679d04 100644
--- a/include/configs/tegra-common.h
+++ b/include/configs/tegra-common.h
@@ -15,12 +15,6 @@
 
 #include /* get chip and board defs */
 
-/* Use the Tegra US timer on ARMv7, but the architected timer on ARMv8. */
-#ifndef CONFIG_ARM64
-#define CFG_SYS_TIMER_RATE 100
-#define CFG_SYS_TIMER_COUNTER  NV_PA_TMRUS_BASE
-#endif
-
 /* Environment */
 
 /*
-- 
2.37.2



[PATCH v6 1/3] ARM: tegra: remap clock_osc_freq for all Tegra family

2023-01-23 Thread Svyatoslav Ryhel
Enum clock_osc_freq was designed to use only with T20.
This patch remaps it to use additional frequencies, added in
T30+ SoC while maintaining backwards compatibility with T20.

Tested-by: Andreas Westman Dorcsak  # ASUS TF600T T30
Tested-by: Jonas Schwöbel  # Surface RT T30
Tested-by: Robert Eckelmann  # ASUS TF101 T20
Tested-by: Agneli  # Toshiba AC100 T20
Tested-by: Svyatoslav Ryhel  # LG P895 T30
Signed-off-by: Svyatoslav Ryhel 
Reviewed-by: Simon Glass 
---
 arch/arm/include/asm/arch-tegra/clock.h |  9 ++--
 arch/arm/mach-tegra/clock.c | 17 --
 arch/arm/mach-tegra/cpu.c   | 70 -
 arch/arm/mach-tegra/tegra114/clock.c| 13 ++---
 arch/arm/mach-tegra/tegra124/clock.c| 13 ++---
 arch/arm/mach-tegra/tegra20/clock.c |  4 +-
 arch/arm/mach-tegra/tegra210/clock.c| 22 ++--
 arch/arm/mach-tegra/tegra30/clock.c | 10 +---
 drivers/usb/host/ehci-tegra.c   | 46 
 9 files changed, 131 insertions(+), 73 deletions(-)

diff --git a/arch/arm/include/asm/arch-tegra/clock.h 
b/arch/arm/include/asm/arch-tegra/clock.h
index 6586015fd2..1dd5d0742c 100644
--- a/arch/arm/include/asm/arch-tegra/clock.h
+++ b/arch/arm/include/asm/arch-tegra/clock.h
@@ -13,12 +13,13 @@ struct udevice;
 /* Set of oscillator frequencies supported in the internal API. */
 enum clock_osc_freq {
/* All in MHz, so 13_0 is 13.0MHz */
-   CLOCK_OSC_FREQ_13_0,
-   CLOCK_OSC_FREQ_19_2,
-   CLOCK_OSC_FREQ_12_0,
-   CLOCK_OSC_FREQ_26_0,
+   CLOCK_OSC_FREQ_13_0 = 0,
+   CLOCK_OSC_FREQ_16_8,
+   CLOCK_OSC_FREQ_19_2 = 4,
CLOCK_OSC_FREQ_38_4,
+   CLOCK_OSC_FREQ_12_0 = 8,
CLOCK_OSC_FREQ_48_0,
+   CLOCK_OSC_FREQ_26_0 = 12,
 
CLOCK_OSC_FREQ_COUNT,
 };
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index 77c8ad978e..11bffc1701 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -28,16 +28,23 @@
 static unsigned pll_rate[CLOCK_ID_COUNT];
 
 /*
- * The oscillator frequency is fixed to one of four set values. Based on this
+ * The oscillator frequency is fixed to one of seven set values. Based on this
  * the other clocks are set up appropriately.
  */
 static unsigned osc_freq[CLOCK_OSC_FREQ_COUNT] = {
1300,
+   1680,
+  0,
+  0,
1920,
-   1200,
-   2600,
3840,
+  0,
+  0,
+   1200,
4800,
+  0,
+  0,
+   2600,
 };
 
 /* return 1 if a peripheral ID is in range */
@@ -766,6 +773,7 @@ void tegra30_set_up_pllp(void)
 */
switch (clock_get_osc_freq()) {
case CLOCK_OSC_FREQ_12_0: /* OSC is 12Mhz */
+   case CLOCK_OSC_FREQ_48_0: /* OSC is 48Mhz */
clock_set_rate(CLOCK_ID_PERIPH, 408, 12, 0, 8);
clock_set_rate(CLOCK_ID_CGENERAL, 456, 12, 1, 8);
break;
@@ -776,10 +784,13 @@ void tegra30_set_up_pllp(void)
break;
 
case CLOCK_OSC_FREQ_13_0: /* OSC is 13Mhz */
+   case CLOCK_OSC_FREQ_16_8: /* OSC is 16.8Mhz */
clock_set_rate(CLOCK_ID_PERIPH, 408, 13, 0, 8);
clock_set_rate(CLOCK_ID_CGENERAL, 600, 13, 0, 8);
break;
+
case CLOCK_OSC_FREQ_19_2:
+   case CLOCK_OSC_FREQ_38_4:
default:
/*
 * These are not supported. It is too early to print a
diff --git a/arch/arm/mach-tegra/cpu.c b/arch/arm/mach-tegra/cpu.c
index 65b15b79fe..59ca8aeaba 100644
--- a/arch/arm/mach-tegra/cpu.c
+++ b/arch/arm/mach-tegra/cpu.c
@@ -55,11 +55,18 @@ struct clk_pll_table 
tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
 */
{
{ .n = 1000, .m = 13, .p = 0, .cpcon = 12 }, /* OSC: 13.0 MHz */
+   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* N/A */
+   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* N/A */
+   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* N/A */
{ .n =  625, .m = 12, .p = 0, .cpcon =  8 }, /* OSC: 19.2 MHz */
+   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* N/A */
+   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* N/A */
+   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* N/A */
{ .n = 1000, .m = 12, .p = 0, .cpcon = 12 }, /* OSC: 12.0 MHz */
+   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* N/A */
+   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* N/A */
+   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* N/A */
{ .n = 1000, .m = 26, .p = 0, .cpcon = 12 }, /* OSC: 26.0 MHz */
-   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* OSC: 38.4 MHz 
(N/A) */
-   { .n =0, .m =  0, .p = 0, .cpcon =  0 }, /* OSC: 48.0 MHz 
(N/A) */
},
/*
 * T25: 1.2 GHz
@@ -73,11 +80,18 @@ struct cl

[PATCH v6 2/3] drivers: timer: add timer driver for ARMv7 based Tegra devices

2023-01-23 Thread Svyatoslav Ryhel
Add timer support for T20/T30/T114 and T124 based devices.
Driver is based on DM, has device tree support and can be
used on SPL and early boot stage.

Arm64 Tegra according to comment in tegra-common.h uses
architected timer.

Tested-by: Andreas Westman Dorcsak  # ASUS TF600T T30
Tested-by: Jonas Schwöbel  # Surface RT T30
Tested-by: Robert Eckelmann  # ASUS TF101 T20
Tested-by: Agneli  # Toshiba AC100 T20
Tested-by: Svyatoslav Ryhel  # LG P895 T30
Co-developed-by: Jonas Schwöbel 
Signed-off-by: Jonas Schwöbel 
Signed-off-by: Svyatoslav Ryhel 
Reviewed-by: Simon Glass 

---
Changed in v6:
 - added paz00 tester

Changed in v5:
 - added comments

Changed in v4:
 - removed BOOTSTAGE ifdefs
 - use early timer on boot stage unconditionally
---
 drivers/timer/Kconfig   |   8 +++
 drivers/timer/Makefile  |   1 +
 drivers/timer/tegra-timer.c | 126 
 3 files changed, 135 insertions(+)
 create mode 100644 drivers/timer/tegra-timer.c

diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
index 6d6665005c..f32bd16227 100644
--- a/drivers/timer/Kconfig
+++ b/drivers/timer/Kconfig
@@ -252,6 +252,14 @@ config STM32_TIMER
  Select this to enable support for the timer found on
  STM32 devices.
 
+config TEGRA_TIMER
+   bool "Tegra timer support"
+   depends on TIMER
+   select TIMER_EARLY
+   help
+ Select this to enable support for the timer found on
+ Tegra devices.
+
 config X86_TSC_TIMER
bool "x86 Time-Stamp Counter (TSC) timer support"
depends on TIMER && X86
diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile
index 6470fd5426..3c92113fc6 100644
--- a/drivers/timer/Makefile
+++ b/drivers/timer/Makefile
@@ -27,6 +27,7 @@ obj-$(CONFIG_SP804_TIMER) += sp804_timer.o
 obj-$(CONFIG_$(SPL_)SIFIVE_CLINT) += sifive_clint_timer.o
 obj-$(CONFIG_ARM_GLOBAL_TIMER) += arm_global_timer.o
 obj-$(CONFIG_STM32_TIMER)  += stm32_timer.o
+obj-$(CONFIG_TEGRA_TIMER)  += tegra-timer.o
 obj-$(CONFIG_X86_TSC_TIMER)+= tsc_timer.o
 obj-$(CONFIG_MTK_TIMER)+= mtk_timer.o
 obj-$(CONFIG_MCHP_PIT64B_TIMER)+= mchp-pit64b-timer.o
diff --git a/drivers/timer/tegra-timer.c b/drivers/timer/tegra-timer.c
new file mode 100644
index 00..d2d163cf3f
--- /dev/null
+++ b/drivers/timer/tegra-timer.c
@@ -0,0 +1,126 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2022 Svyatoslav Ryhel 
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define TEGRA_OSC_CLK_ENB_L_SET(NV_PA_CLK_RST_BASE + 0x320)
+#define TEGRA_OSC_SET_CLK_ENB_TMR  BIT(5)
+
+#define TEGRA_TIMER_USEC_CNTR  (NV_PA_TMRUS_BASE + 0)
+#define TEGRA_TIMER_USEC_CFG   (NV_PA_TMRUS_BASE + 4)
+
+#define TEGRA_TIMER_RATE   100 /* 1 MHz */
+
+/*
+ * On pre-DM stage timer should be left configured by
+ * previous bootloader for correct 1MHz clock.
+ * In the case of reset default value set is 1/13 of
+ * osc clock which should be decent enough to safely
+ * get to DM stage.
+ */
+u64 notrace timer_early_get_count(void)
+{
+   /* At this stage raw timer is used */
+   return readl(TEGRA_TIMER_USEC_CNTR);
+}
+
+unsigned long notrace timer_early_get_rate(void)
+{
+   return TEGRA_TIMER_RATE;
+}
+
+ulong timer_get_boot_us(void)
+{
+   return timer_early_get_count();
+}
+
+/*
+ * At moment of calling get_count, timer driver is already
+ * probed and is configured to have precise 1MHz clock.
+ * Tegra timer has a step of 1 microsecond which removes
+ * need of using adjusments involving uc_priv->clock_rate.
+ */
+static notrace u64 tegra_timer_get_count(struct udevice *dev)
+{
+   u32 val = timer_early_get_count();
+   return timer_conv_64(val);
+}
+
+static int tegra_timer_probe(struct udevice *dev)
+{
+   struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
+   u32 usec_config, value;
+
+   /* Timer rate has to be set unconditionally */
+   uc_priv->clock_rate = TEGRA_TIMER_RATE;
+
+   /*
+* Configure microsecond timers to have 1MHz clock
+* Config register is 0xqqww, where qq is "dividend", ww is "divisor"
+* Uses n+1 scheme
+*/
+   switch (clock_get_osc_freq()) {
+   case CLOCK_OSC_FREQ_13_0:
+   usec_config = 0x000c; /* (12+1)/(0+1) */
+   break;
+   case CLOCK_OSC_FREQ_19_2:
+   usec_config = 0x045f; /* (95+1)/(4+1) */
+   break;
+   case CLOCK_OSC_FREQ_12_0:
+   usec_config = 0x000b; /* (11+1)/(0+1) */
+   break;
+   case CLOCK_OSC_FREQ_26_0:
+   usec_config = 0x0019; /* (25+1)/(0+1) */
+   break;
+   case CLOCK_OSC_FREQ_16_8:
+   usec_config = 0x0453; /* (83+1)/(4+1) */
+   break;
+   case CLOCK_OSC_FREQ_38_4:
+   usec_config = 0x04bf; /* (191+1)/(4+1) */
+   break;
+   case CLOCK_OSC_FREQ

[PATCH v6 0/3] Timer support for ARM Tegra

2023-01-23 Thread Svyatoslav Ryhel
- ARM: tegra: remap clock_osc_freq for all Tegra family
Enum clock_osc_freq was designed to use only with T20.
This patch remaps it to use additional frequencies, added in
T30+ SoC while maintaining backwards compatibility with T20.

- drivers: timer: add timer driver for ARMv7 based Tegra devices
Add timer support for T20/T30/T114 and T124 based devices.
Driver is based on DM, has device tree support and can be
used on SPL and early boot stage.

- ARM: tegra: include timer as default option
Enable TIMER as default option for all Tegra devices and
enable TEGRA_TIMER for TEGRA_ARMV7_COMMON. Additionally
enable SPL_TIMER if build as SPL part and drop deprecated
configs from common header.

P. S. I have no arm64 Tegra and according to comment in 
tegra-common.h
Use the Tegra US timer on ARMv7, but the architected timer on ARMv8.

Svyatoslav Ryhel (3):
  ARM: tegra: remap clock_osc_freq for all Tegra family
  drivers: timer: add timer driver for ARMv7 based Tegra devices
  ARM: tegra: include timer as default option

 arch/arm/Kconfig|   1 +
 arch/arm/include/asm/arch-tegra/clock.h |   9 +-
 arch/arm/mach-tegra/Kconfig |   2 +
 arch/arm/mach-tegra/clock.c |  17 +++-
 arch/arm/mach-tegra/cpu.c   |  70 ++---
 arch/arm/mach-tegra/tegra114/clock.c|  13 +--
 arch/arm/mach-tegra/tegra124/clock.c|  13 +--
 arch/arm/mach-tegra/tegra20/clock.c |   4 +-
 arch/arm/mach-tegra/tegra210/clock.c|  22 +
 arch/arm/mach-tegra/tegra30/clock.c |  10 +-
 drivers/timer/Kconfig   |   8 ++
 drivers/timer/Makefile  |   1 +
 drivers/timer/tegra-timer.c | 126 
 drivers/usb/host/ehci-tegra.c   |  46 +++--
 include/configs/tegra-common.h  |   6 --
 15 files changed, 269 insertions(+), 79 deletions(-)
 create mode 100644 drivers/timer/tegra-timer.c

-- 
2.37.2



[PATCH v5 2/4] eficonfig: refactor change boot order implementation

2023-01-23 Thread Masahisa Kojima
This commit removes the change boot order specific
menu implementation. The change boot order implementation
calls eficonfig_process_common() same as other menus.

The change boot order menu requires own item_data_print
and item_choice implementation, but display_statusline
function can be a same function as other menus.

Signed-off-by: Masahisa Kojima 
Acked-by: Ilias Apalodimas 
Reviewed-by: Ilias Apalodimas 
---
No update since v3

Changes in v3:
- modify "reverse" local variable type to bool

Changes in v2:
- add comment when the user key press is not valid
- add const qualifier to eficonfig_change_boot_order_desc

 cmd/eficonfig.c | 246 +---
 1 file changed, 151 insertions(+), 95 deletions(-)

diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index 24d6bdb6bf..01bd1b05bc 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -25,6 +25,11 @@ static struct efi_simple_text_input_protocol *cin;
 const char *eficonfig_menu_desc =
"  Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit";
 
+static const char *eficonfig_change_boot_order_desc =
+   "  Press UP/DOWN to move, +/- to change orde\n"
+   "  Press SPACE to activate or deactivate the entry\n"
+   "  Select [Save] to complete, ESC/CTRL+C to quit";
+
 #define EFICONFIG_DESCRIPTION_MAX 32
 #define EFICONFIG_OPTIONAL_DATA_MAX 64
 
@@ -106,6 +111,17 @@ struct eficonfig_boot_order_data {
bool active;
 };
 
+/**
+ * struct eficonfig_save_boot_order_data - structure to be used to change boot 
order
+ *
+ * @efi_menu:  pointer to efimenu structure
+ * @selected:  flag to indicate user selects "Save" entry
+ */
+struct eficonfig_save_boot_order_data {
+   struct efimenu *efi_menu;
+   bool selected;
+};
+
 /**
  * eficonfig_print_msg() - print message
  *
@@ -174,10 +190,9 @@ void eficonfig_display_statusline(struct menu *m)
  "\n%s\n"
   ANSI_CURSOR_POSITION ANSI_CLEAR_LINE ANSI_CURSOR_POSITION
   "%s"
-  ANSI_CLEAR_LINE_TO_END ANSI_CURSOR_POSITION ANSI_CLEAR_LINE,
+  ANSI_CLEAR_LINE_TO_END,
   1, 1, entry->efi_menu->menu_header, entry->efi_menu->count + 5, 
1,
-  entry->efi_menu->count + 6, 1, entry->efi_menu->menu_desc,
-  entry->efi_menu->count + 7, 1);
+  entry->efi_menu->count + 6, 1, entry->efi_menu->menu_desc);
 }
 
 /**
@@ -1844,63 +1859,44 @@ out:
 }
 
 /**
- * eficonfig_display_change_boot_order() - display the BootOrder list
+ * eficonfig_print_change_boot_order_entry() - print the boot option entry
  *
- * @efi_menu:  pointer to the efimenu structure
- * Return: status code
+ * @data:  pointer to the data associated with each menu entry
  */
-static void eficonfig_display_change_boot_order(struct efimenu *efi_menu)
+static void eficonfig_print_change_boot_order_entry(void *data)
 {
-   bool reverse;
-   struct list_head *pos, *n;
-   struct eficonfig_entry *entry;
-
-   printf(ANSI_CLEAR_CONSOLE ANSI_CURSOR_POSITION
-  "\n  ** Change Boot Order **\n"
-  ANSI_CURSOR_POSITION
-  "  Press UP/DOWN to move, +/- to change order"
-  ANSI_CURSOR_POSITION
-  "  Press SPACE to activate or deactivate the entry"
-  ANSI_CURSOR_POSITION
-  "  Select [Save] to complete, ESC/CTRL+C to quit"
-  ANSI_CURSOR_POSITION ANSI_CLEAR_LINE,
-  1, 1, efi_menu->count + 5, 1, efi_menu->count + 6, 1,
-  efi_menu->count + 7, 1,  efi_menu->count + 8, 1);
-
-   /* draw boot option list */
-   list_for_each_safe(pos, n, &efi_menu->list) {
-   entry = list_entry(pos, struct eficonfig_entry, list);
-   reverse = (entry->num == efi_menu->active);
+   struct eficonfig_entry *entry = data;
+   bool reverse = (entry->efi_menu->active == entry->num);
 
-   printf(ANSI_CURSOR_POSITION, entry->num + 4, 7);
+   printf(ANSI_CURSOR_POSITION, entry->num + 4, 7);
 
-   if (reverse)
-   puts(ANSI_COLOR_REVERSE);
+   if (reverse)
+   puts(ANSI_COLOR_REVERSE);
 
-   if (entry->num < efi_menu->count - 2) {
-   if (((struct eficonfig_boot_order_data 
*)entry->data)->active)
-   printf("[*]  ");
-   else
-   printf("[ ]  ");
-   }
+   if (entry->num < entry->efi_menu->count - 2) {
+   if (((struct eficonfig_boot_order_data *)entry->data)->active)
+   printf("[*]  ");
+   else
+   printf("[ ]  ");
+   }
 
-   printf("%s", entry->title);
+   printf("%s", entry->title);
 
-   if (reverse)
-   puts(ANSI_COLOR_RESET);
-   }
+   if (reverse)
+   puts(ANSI_COLOR_RESET);
 }
 
 /**
- * eficonfig_choice_cha

[PATCH v5 3/4] eficonfig: add vertical scroll support

2023-01-23 Thread Masahisa Kojima
The current eficonfig menu does not support vertical scroll,
so it can not display the menu entries greater than
the console row size.

This commit add the vertial scroll support.
The console size is retrieved by
SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then
calculates the row size for menu entry by subtracting
menu header and description row size from the console row size.
"start" and "end" are added in the efimenu structure.
"start" keeps the menu entry index at the top, "end" keeps
the bottom menu entry index. item_data_print() menu function
only draws the menu entry between "start" and "end".

This commit also fixes the issue that "Save" and "Quit"
entries can be moved by BKEY_PLUS in change boot order menu.

Signed-off-by: Masahisa Kojima 
---
Changes in v5:
- create common function to update efi_menu active, start and end
- fix the issue that "Save" and "Quit" can be moved by BKEY_PLUS press

Changes in v3:
- modify "reverse" local variable type to bool

Changes in v2:
- add comment when the user key press is not valid
- add const qualifier to eficonfig_change_boot_order_desc

 cmd/eficonfig.c  | 92 
 include/efi_config.h |  4 ++
 include/efi_loader.h |  1 +
 3 files changed, 80 insertions(+), 17 deletions(-)

diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index 01bd1b05bc..47c04cf536 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -30,8 +30,13 @@ static const char *eficonfig_change_boot_order_desc =
"  Press SPACE to activate or deactivate the entry\n"
"  Select [Save] to complete, ESC/CTRL+C to quit";
 
+static struct efi_simple_text_output_protocol *cout;
+static int avail_row;
+
 #define EFICONFIG_DESCRIPTION_MAX 32
 #define EFICONFIG_OPTIONAL_DATA_MAX 64
+#define EFICONFIG_MENU_HEADER_ROW_NUM 3
+#define EFICONFIG_MENU_DESC_ROW_NUM 5
 
 /**
  * struct eficonfig_filepath_info - structure to be used to store file path
@@ -122,6 +127,30 @@ struct eficonfig_save_boot_order_data {
bool selected;
 };
 
+/**
+ * struct eficonfig_menu_adjust - update start and end entry index
+ *
+ * @efi_menu:  pointer to efimenu structure
+ * @add:   flag to add or substract the index
+ */
+static void eficonfig_menu_adjust(struct efimenu *efi_menu, bool add)
+{
+   if (add)
+   ++efi_menu->active;
+   else
+   --efi_menu->active;
+
+   if (add && efi_menu->end < efi_menu->active) {
+   efi_menu->start++;
+   efi_menu->end++;
+   } else if (!add && efi_menu->start > efi_menu->active) {
+   efi_menu->start--;
+   efi_menu->end--;
+   }
+}
+#define eficonfig_menu_up(_a) eficonfig_menu_adjust(_a, false)
+#define eficonfig_menu_down(_a) eficonfig_menu_adjust(_a, true)
+
 /**
  * eficonfig_print_msg() - print message
  *
@@ -157,18 +186,16 @@ void eficonfig_print_entry(void *data)
struct eficonfig_entry *entry = data;
bool reverse = (entry->efi_menu->active == entry->num);
 
-   /* TODO: support scroll or page for many entries */
+   if (entry->efi_menu->start > entry->num || entry->efi_menu->end < 
entry->num)
+   return;
 
-   /*
-* Move cursor to line where the entry will be drawn (entry->num)
-* First 3 lines(menu header) + 1 empty line
-*/
-   printf(ANSI_CURSOR_POSITION, entry->num + 4, 7);
+   printf(ANSI_CURSOR_POSITION, (entry->num - entry->efi_menu->start) +
+  EFICONFIG_MENU_HEADER_ROW_NUM + 1, 7);
 
if (reverse)
puts(ANSI_COLOR_REVERSE);
 
-   printf("%s", entry->title);
+   printf(ANSI_CLEAR_LINE "%s", entry->title);
 
if (reverse)
puts(ANSI_COLOR_RESET);
@@ -191,8 +218,8 @@ void eficonfig_display_statusline(struct menu *m)
   ANSI_CURSOR_POSITION ANSI_CLEAR_LINE ANSI_CURSOR_POSITION
   "%s"
   ANSI_CLEAR_LINE_TO_END,
-  1, 1, entry->efi_menu->menu_header, entry->efi_menu->count + 5, 
1,
-  entry->efi_menu->count + 6, 1, entry->efi_menu->menu_desc);
+  1, 1, entry->efi_menu->menu_header, avail_row + 4, 1,
+  avail_row + 5, 1, entry->efi_menu->menu_desc);
 }
 
 /**
@@ -217,12 +244,14 @@ char *eficonfig_choice_entry(void *data)
switch (key) {
case BKEY_UP:
if (efi_menu->active > 0)
-   --efi_menu->active;
+   eficonfig_menu_up(efi_menu);
+
/* no menu key selected, regenerate menu */
return NULL;
case BKEY_DOWN:
if (efi_menu->active < efi_menu->count - 1)
-   ++efi_menu->active;
+   eficonfig_menu_down(efi_menu);
+
/* no menu key selected, regenerate menu */
return NULL;
case BKEY_SELECT:
@@ -402,6 +43

[PATCH v5 4/4] eficonfig: increase the number of menu entries

2023-01-23 Thread Masahisa Kojima
Current eficonfig has the maximum number of menu entries and
it is 99. If there are more EFI load options and files in the
system, eficonfig can not handle it.

This commit increases this maximum number of menu entries
to INT_MAX.

Signed-off-by: Masahisa Kojima 
Reviewed-by: Ilias Apalodimas 
---
Newly created in v4

 include/efi_config.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/efi_config.h b/include/efi_config.h
index 6a104e4b1d..e5edbb5e09 100644
--- a/include/efi_config.h
+++ b/include/efi_config.h
@@ -11,7 +11,7 @@
 #include 
 #include 
 
-#define EFICONFIG_ENTRY_NUM_MAX 99
+#define EFICONFIG_ENTRY_NUM_MAX INT_MAX
 #define EFICONFIG_VOLUME_PATH_MAX 512
 #define EFICONFIG_FILE_PATH_MAX 512
 #define EFICONFIG_FILE_PATH_BUF_SIZE (EFICONFIG_FILE_PATH_MAX * sizeof(u16))
-- 
2.17.1



[PATCH v5 1/4] eficonfig: refactor eficonfig_process_common function

2023-01-23 Thread Masahisa Kojima
Current change boot order implementation does not call
eficonfig_process_common() and call own menu functions
for display_statusline, item_data_print and item_choice.
Change boot order functionality should call
eficonfig_process_common() to improve maintenanceability.

This commit is a preparation to remove the change boot
order specific implementation. The menu functions
(display_statusline, item_data_print and item_choice) are
added as argument of eficonfig_process_common().
The menu description string displayed at the bottom of
the menu is also added as argument.

Signed-off-by: Masahisa Kojima 
Reviewed-by: Ilias Apalodimas 
---
No update since v3

Changes in v3:
- modify "reverse" local variable type to bool

Changes in v2:
- add const qualifier to eficonfig_menu_desc, change it to pointer

 cmd/eficonfig.c   | 71 +--
 cmd/eficonfig_sbkey.c | 18 +--
 include/efi_config.h  | 13 +++-
 3 files changed, 82 insertions(+), 20 deletions(-)

diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index d830e4af53..24d6bdb6bf 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -22,6 +22,8 @@
 #include 
 
 static struct efi_simple_text_input_protocol *cin;
+const char *eficonfig_menu_desc =
+   "  Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit";
 
 #define EFICONFIG_DESCRIPTION_MAX 32
 #define EFICONFIG_OPTIONAL_DATA_MAX 64
@@ -134,10 +136,10 @@ void eficonfig_print_msg(char *msg)
  *
  * @data:  pointer to the data associated with each menu entry
  */
-static void eficonfig_print_entry(void *data)
+void eficonfig_print_entry(void *data)
 {
struct eficonfig_entry *entry = data;
-   int reverse = (entry->efi_menu->active == entry->num);
+   bool reverse = (entry->efi_menu->active == entry->num);
 
/* TODO: support scroll or page for many entries */
 
@@ -161,7 +163,7 @@ static void eficonfig_print_entry(void *data)
  *
  * @m: pointer to the menu structure
  */
-static void eficonfig_display_statusline(struct menu *m)
+void eficonfig_display_statusline(struct menu *m)
 {
struct eficonfig_entry *entry;
 
@@ -171,10 +173,11 @@ static void eficonfig_display_statusline(struct menu *m)
printf(ANSI_CURSOR_POSITION
  "\n%s\n"
   ANSI_CURSOR_POSITION ANSI_CLEAR_LINE ANSI_CURSOR_POSITION
-  "  Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit"
+  "%s"
   ANSI_CLEAR_LINE_TO_END ANSI_CURSOR_POSITION ANSI_CLEAR_LINE,
   1, 1, entry->efi_menu->menu_header, entry->efi_menu->count + 5, 
1,
-  entry->efi_menu->count + 6, 1, entry->efi_menu->count + 7, 1);
+  entry->efi_menu->count + 6, 1, entry->efi_menu->menu_desc,
+  entry->efi_menu->count + 7, 1);
 }
 
 /**
@@ -183,7 +186,7 @@ static void eficonfig_display_statusline(struct menu *m)
  * @data:  pointer to the efimenu structure
  * Return: key string to identify the selected entry
  */
-static char *eficonfig_choice_entry(void *data)
+char *eficonfig_choice_entry(void *data)
 {
struct cli_ch_state s_cch, *cch = &s_cch;
struct list_head *pos, *n;
@@ -361,9 +364,17 @@ out:
  *
  * @efi_menu:  pointer to the efimenu structure
  * @menu_header:   pointer to the menu header string
+ * @menu_desc: pointer to the menu description
+ * @display_statusline:function pointer to draw statusline
+ * @item_data_print:   function pointer to draw the menu item
+ * @item_choice:   function pointer to handle the key press
  * Return: status code
  */
-efi_status_t eficonfig_process_common(struct efimenu *efi_menu, char 
*menu_header)
+efi_status_t eficonfig_process_common(struct efimenu *efi_menu,
+ char *menu_header, const char *menu_desc,
+ void (*display_statusline)(struct menu *),
+ void (*item_data_print)(void *),
+ char *(*item_choice)(void *))
 {
struct menu *menu;
void *choice = NULL;
@@ -382,10 +393,11 @@ efi_status_t eficonfig_process_common(struct efimenu 
*efi_menu, char *menu_heade
if (!efi_menu->menu_header)
return EFI_OUT_OF_RESOURCES;
}
+   if (menu_desc)
+   efi_menu->menu_desc = menu_desc;
 
-   menu = menu_create(NULL, 0, 1, eficonfig_display_statusline,
-  eficonfig_print_entry, eficonfig_choice_entry,
-  efi_menu);
+   menu = menu_create(NULL, 0, 1, display_statusline, item_data_print,
+  item_choice, efi_menu);
if (!menu)
return EFI_INVALID_PARAMETER;
 
@@ -644,7 +656,12 @@ static efi_status_t eficonfig_select_volume(struct 
eficonfig_select_file_info *f
if (ret != EFI_SUCCESS)
goto out;
 
-   ret = eficonfig_process_common(efi_menu, "

[PATCH v5 0/4] eficonfig: add vertical scroll support and refactoring

2023-01-23 Thread Masahisa Kojima
This series aims to add the vertical scroll for the eficonfig menu.
Before adding scroll support, this series does the refactoring
of change boot order implementation since it has own menu handling
and it should be removed to improve maintainability.

The eficonfig menu handles file selection for EFI load option
and secure boot keys, it likely to enumerate tens of files.
User can not select the file without scroll if theare are
many files under the target directory.

This series only modifies the eficonfig menus. Other menus
such as bootmenu is not yet done. We need to enhance the
U-Boot menu framework itself if we support other menus.

Masahisa Kojima (4):
  eficonfig: refactor eficonfig_process_common function
  eficonfig: refactor change boot order implementation
  eficonfig: add vertical scroll support
  eficonfig: increase the number of menu entries

 cmd/eficonfig.c   | 399 +-
 cmd/eficonfig_sbkey.c |  18 +-
 include/efi_config.h  |  19 +-
 include/efi_loader.h  |   1 +
 4 files changed, 309 insertions(+), 128 deletions(-)

-- 
2.17.1



Re: [PATCH v1 1/2] cmd: exit: add continue on key press command

2023-01-23 Thread Svyatoslav Ryhel
Hello Simon!

Thanks for your review. Heinrich Schuchardt made a valid remark that
command with such functionality already exists. It is called - pause -
and my commit fully duplicates it.

Pause command was merged 2022.09 while I have made this command
approx. a year ago in my fork and did not check since then if any new commands
were added. This commit will be dropped in V2, but the second commit
in this patchset, seems, to have no other implementations.

Best regards, Svyatoslav R.

вт, 24 січ. 2023 р. о 00:25 Simon Glass  пише:
>
> On Mon, 23 Jan 2023 at 13:04, Svyatoslav Ryhel  wrote:
> >
> > This command stops performing script until any
> > key is pressed. It is useful for keeping logs
> > on screen until user decides to continue.
> >
> > Co-developed-by: Jonas Schwöbel 
> > Signed-off-by: Jonas Schwöbel 
> > Signed-off-by: Svyatoslav Ryhel 
> > ---
> >  cmd/exit.c | 17 +
> >  1 file changed, 17 insertions(+)
> >
>
> Please add a file in doc/usage/cmd
>
> Also how about a test?
>
> > diff --git a/cmd/exit.c b/cmd/exit.c
> > index 7bf241ec73..673b4b6be7 100644
> > --- a/cmd/exit.c
> > +++ b/cmd/exit.c
> > @@ -7,6 +7,17 @@
> >  #include 
> >  #include 
> >
> > +static int do_continue(struct cmd_tbl *cmdtp, int flag, int argc,
> > +  char *const argv[])
> > +{
> > +   while (true) {
> > +   if (getchar())
> > +   break;
> > +   }
> > +
> > +   return 0;
> > +}
> > +
> >  static int do_exit(struct cmd_tbl *cmdtp, int flag, int argc,
> >char *const argv[])
> >  {
> > @@ -19,6 +30,12 @@ static int do_exit(struct cmd_tbl *cmdtp, int flag, int 
> > argc,
> > return -r - 2;
> >  }
> >
> > +U_BOOT_CMD(
> > +   continue,   1,  0,  do_continue,
> > +   "continue script on key pressed",
> > +   ""
> > +);
> > +
> >  U_BOOT_CMD(
> > exit,   2,  1,  do_exit,
> > "exit script",
> > --
> > 2.25.1
> >
>
> Regards,
> Simon


Re: [PATCH v1 1/2] cmd: exit: add continue on key press command

2023-01-23 Thread Svyatoslav Ryhel
вт, 24 січ. 2023 р. о 00:43 Heinrich Schuchardt  пише:
>
>
>
> Am 23. Januar 2023 23:25:41 MEZ schrieb Simon Glass :
> >On Mon, 23 Jan 2023 at 13:04, Svyatoslav Ryhel  wrote:
> >>
> >> This command stops performing script until any
> >> key is pressed. It is useful for keeping logs
> >> on screen until user decides to continue.
> >>
> >> Co-developed-by: Jonas Schwöbel 
> >> Signed-off-by: Jonas Schwöbel 
> >> Signed-off-by: Svyatoslav Ryhel 
> >> ---
> >>  cmd/exit.c | 17 +
> >>  1 file changed, 17 insertions(+)
> >>
> >
> >Please add a file in doc/usage/cmd
> >
> >Also how about a test?
> >
> >> diff --git a/cmd/exit.c b/cmd/exit.c
> >> index 7bf241ec73..673b4b6be7 100644
> >> --- a/cmd/exit.c
> >> +++ b/cmd/exit.c
> >> @@ -7,6 +7,17 @@
> >>  #include 
> >>  #include 
> >>
> >> +static int do_continue(struct cmd_tbl *cmdtp, int flag, int argc,
> >> +  char *const argv[])
> >> +{
> >> +   while (true) {
> >> +   if (getchar())
> >> +   break;
> >> +   }
> >> +
> >> +   return 0;
> >> +}

Hello, Heinrich!

> We already have the sleep command which waits until CTRL+C is pressed or a 
> time interval has elapsed.

You are correct, this commit duplicates same command, but not sleep.
Pause command was merged 2022.09 while I have made this command
approx. a year ago and did not check since then if any new commands
were added. This commit will be dropped in V2, but the second commit
in this patchset has no other implementations.

> Why does that command not satisfy the use case?

My keyboard has only 3 keys: up, down and enter. I have no luxury of a
108 key keyboard.

> The command name continue is used in other languages for control structures. 
> We should not use it for pausing.
>
> We should not put a new command into an existing C module without good reason.
>
> Best regards
>
> Heinrich
>

Thanks for your review.
Best regards, Svyatoslav R.

>
> >> +
> >>  static int do_exit(struct cmd_tbl *cmdtp, int flag, int argc,
> >>char *const argv[])
> >>  {
> >> @@ -19,6 +30,12 @@ static int do_exit(struct cmd_tbl *cmdtp, int flag, int 
> >> argc,
> >> return -r - 2;
> >>  }
> >>
> >> +U_BOOT_CMD(
> >> +   continue,   1,  0,  do_continue,
> >> +   "continue script on key pressed",
> >> +   ""
> >> +);
> >> +
> >>  U_BOOT_CMD(
> >> exit,   2,  1,  do_exit,
> >> "exit script",
> >> --
> >> 2.25.1
> >>
> >
> >Regards,
> >Simon


Re: [PATCH 76/88] ppc: Makefile: Drop unused ppc4xx code

2023-01-23 Thread Stefan Roese

On 1/23/23 23:00, Simon Glass wrote:

CONFIG_UBOOT_PAD_TO is not defined anywhere. Drop this dead code.

Signed-off-by: Simon Glass 
---

  Makefile | 11 ---
  1 file changed, 11 deletions(-)

diff --git a/Makefile b/Makefile
index 5c5b3d2d651..fccc5a9e094 100644
--- a/Makefile
+++ b/Makefile
@@ -1647,17 +1647,6 @@ OBJCOPYFLAGS_u-boot-with-spl-pbl.bin = -I binary -O 
binary --pad-to=$(CONFIG_SPL
  u-boot-with-spl-pbl.bin: spl/u-boot-spl.pbl $(UBOOT_BINLOAD) FORCE
$(call if_changed,pad_cat)
  
-# PPC4xx needs the SPL at the end of the image, since the reset vector

-# is located at 0xfffc. So we can't use the "u-boot-img.bin" target
-# and need to introduce a new build target with the full blown U-Boot
-# at the start padded up to the start of the SPL image. And then concat
-# the SPL image to the end.
-
-OBJCOPYFLAGS_u-boot-img-spl-at-end.bin := -I binary -O binary \
-   --pad-to=$(CONFIG_UBOOT_PAD_TO) --gap-fill=0xff
-u-boot-img-spl-at-end.bin: u-boot.img spl/u-boot-spl.bin FORCE
-   $(call if_changed,pad_cat)
-
  quiet_cmd_u-boot-elf ?= LD  $@
cmd_u-boot-elf ?= $(LD) u-boot-elf.o -o $@ \
$(if $(CONFIG_SYS_BIG_ENDIAN),-EB,-EL) \


Reviewed-by: Stefan Roese 

Thanks,
Stefan


Re: [PATCH 12/88] arm: mvebu: Drop reference to CONFIG_ARMADA_39X

2023-01-23 Thread Stefan Roese

On 1/23/23 22:59, Simon Glass wrote:

This is not defined anywhere. Drop it.

Signed-off-by: Simon Glass 
---

  arch/arm/mach-mvebu/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index 1a9dfc047c9..207ee1b6b89 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -38,7 +38,7 @@ extra-y += kwbimage.cfg
  ifneq ($(CONFIG_ARMADA_3700)$(CONFIG_ARMADA_XP),)
KWB_REPLACE += CPU
KWB_CFG_CPU = SHEEVA
-else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X),)
+else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X),)
KWB_REPLACE += CPU
KWB_CFG_CPU = A9
  endif


Reviewed-by: Stefan Roese 

Thanks,
Stefan


Re: [PATCH 11/88] arm: mvebu: Correct reference to ARMADA_370

2023-01-23 Thread Stefan Roese

Hi Simon,

On 1/23/23 22:59, Simon Glass wrote:

Presumably this should be ARMADA_3700. Fix it.


No. Please see below.


Signed-off-by: Simon Glass 
---

  arch/arm/mach-mvebu/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index a23511b113b..1a9dfc047c9 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -35,7 +35,7 @@ endif
  
  extra-y += kwbimage.cfg
  
-ifneq ($(CONFIG_ARMADA_370)$(CONFIG_ARMADA_XP),)

+ifneq ($(CONFIG_ARMADA_3700)$(CONFIG_ARMADA_XP),)
KWB_REPLACE += CPU
KWB_CFG_CPU = SHEEVA
  else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X),)


Armada 370 is an older 32bit Marvell SoC and not Armada 3700. Still you
have detected a problem with CONFIG_ARMADA_370. AFAICT, it's not
referenced anywhere else in the code. So please remove this reference
instead of changing it to 3700.

Thanks,
Stefan


Re: [PATCH 72/88] sh4: Drop unused kona_i2c driver

2023-01-23 Thread Heiko Schocher
Hello Simon,

On 23.01.23 23:00, Simon Glass wrote:
> This is not used. Drop the driver and Kconfig option.
> 
> Signed-off-by: Simon Glass 
> ---
> 
>  drivers/i2c/Makefile   |   1 -
>  drivers/i2c/kona_i2c.c | 728 -
>  2 files changed, 729 deletions(-)
>  delete mode 100644 drivers/i2c/kona_i2c.c

Thanks!

Reviewed-by: Heiko Schocher 

bye,
Heiko
-- 
DENX Software Engineering GmbH,  Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de


Re: [PATCH 29/88] i2c: Rename I2C_MUX_PCA954x

2023-01-23 Thread Heiko Schocher
Hello Simon,

On 23.01.23 22:59, Simon Glass wrote:
> CONFIG options must not use lower-case letter. Convert this to upper case.
> 
> Signed-off-by: Simon Glass 
> ---
> 
>  arch/arm/mach-mvebu/Kconfig| 2 +-
>  configs/SBx81LIFKW_defconfig   | 2 +-
>  configs/SBx81LIFXCAT_defconfig | 2 +-
>  configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig | 2 +-
>  configs/cgtqmx8_defconfig  | 2 +-
>  configs/ge_bx50v3_defconfig| 2 +-
>  configs/imx8qm_mek_defconfig   | 2 +-
>  configs/imx8qm_rom7720_a1_4G_defconfig | 2 +-
>  configs/imx8qxp_mek_defconfig  | 2 +-
>  configs/kmcent2_defconfig  | 2 +-
>  configs/kmcoge5ne_defconfig| 2 +-
>  configs/kmeter1_defconfig  | 2 +-
>  configs/kmopti2_defconfig  | 2 +-
>  configs/kmsupx5_defconfig  | 2 +-
>  configs/kmtepr2_defconfig  | 2 +-
>  configs/ls1028aqds_tfa_SECURE_BOOT_defconfig   | 2 +-
>  configs/ls1028aqds_tfa_defconfig   | 2 +-
>  configs/ls1028aqds_tfa_lpuart_defconfig| 2 +-
>  configs/ls1028ardb_tfa_SECURE_BOOT_defconfig   | 2 +-
>  configs/ls1028ardb_tfa_defconfig   | 2 +-
>  configs/ls1088aqds_tfa_defconfig   | 2 +-
>  configs/ls1088ardb_tfa_SECURE_BOOT_defconfig   | 2 +-
>  configs/ls1088ardb_tfa_defconfig   | 2 +-
>  configs/ls2088aqds_tfa_defconfig   | 2 +-
>  configs/ls2088ardb_tfa_SECURE_BOOT_defconfig   | 2 +-
>  configs/ls2088ardb_tfa_defconfig   | 2 +-
>  configs/lx2160aqds_tfa_SECURE_BOOT_defconfig   | 2 +-
>  configs/lx2160aqds_tfa_defconfig   | 2 +-
>  configs/lx2162aqds_tfa_SECURE_BOOT_defconfig   | 2 +-
>  configs/lx2162aqds_tfa_defconfig   | 2 +-
>  configs/lx2162aqds_tfa_verified_boot_defconfig | 2 +-
>  configs/mvebu_puzzle-m801-88f8040_defconfig| 2 +-
>  configs/mx53ppd_defconfig  | 2 +-
>  configs/octeontx2_96xx_defconfig   | 2 +-
>  configs/tuge1_defconfig| 2 +-
>  configs/tuxx1_defconfig| 2 +-
>  configs/x530_defconfig | 2 +-
>  configs/xilinx_versal_net_virt_defconfig   | 2 +-
>  configs/xilinx_versal_virt_defconfig   | 2 +-
>  configs/xilinx_zynq_virt_defconfig | 2 +-
>  configs/xilinx_zynqmp_virt_defconfig   | 2 +-
>  drivers/i2c/muxes/Kconfig  | 2 +-
>  drivers/i2c/muxes/Makefile | 2 +-
>  43 files changed, 43 insertions(+), 43 deletions(-)

Thanks!

Reviewed-by: Heiko Schocher 

bye,
Heiko
-- 
DENX Software Engineering GmbH,  Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de


Re: [PATCH v2 2/4] sunxi: binman: Move BL31 and SCP firmware addresses to Kconfig

2023-01-23 Thread Samuel Holland
Hi Simon,

On 1/23/23 12:42, Simon Glass wrote:
> HI Samuel,
> 
> On Sun, 22 Jan 2023 at 14:16, Samuel Holland  wrote:
>>
>> This is easier to read than the #ifdef staircase, provides better
>> visibility into the memory map (alongside the other Kconfig
>> definitions), and allows these addresses to be reused from code.
>>
>> Signed-off-by: Samuel Holland 
>> ---
>>
>> Changes in v2:
>>  - New patch for v2, split from the .dtsi changes
>>
>>  arch/arm/dts/sunxi-u-boot.dtsi | 24 +++-
>>  arch/arm/mach-sunxi/Kconfig| 17 +
>>  2 files changed, 24 insertions(+), 17 deletions(-)
> 
> Reviewed-by: Simon Glass 
> 
> Is this info not in the device tree?

It is not. These values do not correspond to any hardware property. For
example, on A64/H5/H6, BL31 and SCP share a single "SRAM A2" region. The
division of the SRAM between them was chosen arbitrarily (though now it
is ABI). How would you represent this in the devicetree?

Regards,
Samuel



[PATCH v2 1/1] include: configs: am62x_evm: Add .env file for Am62x

2023-01-23 Thread Nikhil M Jain
Use .env file for setting board related environment variables,
in place of am62x_evm.h file. Except for BOOTENV settings, as
config_distro_boot.env file doesn't exist.

Signed-off-by: Nikhil M Jain 
---
 board/ti/am62x/am62x.env| 103 
 include/configs/am62x_evm.h |  43 ---
 2 files changed, 103 insertions(+), 43 deletions(-)
 create mode 100644 board/ti/am62x/am62x.env

diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env
new file mode 100644
index 00..e465d0010b
--- /dev/null
+++ b/board/ti/am62x/am62x.env
@@ -0,0 +1,103 @@
+loadaddr=0x8200
+kernel_addr_r=0x8200
+fdtaddr=0x8800
+dtboaddr=0x8900
+fdt_addr_r=0x8800
+fdtoverlay_addr_r=0x8900
+rdaddr=0x8808
+ramdisk_addr_r=0x8808
+scriptaddr=0x8000
+pxefile_addr_r=0x8010
+bootm_size=0x1000
+boot_fdt=try
+
+mmcrootfstype=ext4 rootwait
+finduuid=part uuid ${boot} ${bootpart} uuid
+args_mmc=run finduuid;setenv bootargs console=${console}
+   ${optargs}
+   root=PARTUUID=${uuid} rw
+   rootfstype=${mmcrootfstype}
+loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
+bootscript=echo Running bootscript from mmc${mmcdev} ...;
+   source ${loadaddr}
+bootenvfile=uEnv.txt
+importbootenv=echo Importing environment from mmc${mmcdev} ...;
+   env import -t ${loadaddr} ${filesize}
+loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
+loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
+loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
+envboot=mmc dev ${mmcdev};
+   if mmc rescan; then
+   echo SD/MMC found on device ${mmcdev};
+   if run loadbootscript; then
+   run bootscript;
+   else
+   if run loadbootenv; then
+   echo Loaded env from ${bootenvfile};
+   run importbootenv;
+   fi;
+   if test -n $uenvcmd; then
+   echo Running uenvcmd ...;
+   run uenvcmd;
+   fi;
+   fi;
+   fi;
+mmcloados=
+   if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
+   if run loadfdt; then
+   bootz ${loadaddr} - ${fdtaddr};
+   else
+   if test ${boot_fdt} = try; then
+   bootz;
+   else
+   echo WARN: Cannot load the DT;
+   fi;
+   fi;
+   else
+   bootz;
+   fi;
+mmcboot=mmc dev ${mmcdev};
+   devnum=${mmcdev};
+   devtype=mmc;
+   if mmc rescan; then
+   echo SD/MMC found on device ${mmcdev};
+   if run loadimage; then
+   run args_mmc;
+   if test ${boot_fit} -eq 1; then
+   run run_fit;
+   else
+   run mmcloados;
+   fi;
+   fi;
+   fi;
+
+default_device_tree=k3-am625-sk.dtb
+findfdt=
+   setenv name_fdt ${default_device_tree};
+   setenv fdtfile ${name_fdt}
+name_kern=Image
+console=ttyS2,115200n8
+args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x0280
+   ${mtdparts}
+run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
+
+boot=mmc
+mmcdev=1
+bootpart=1:2
+bootdir=/boot
+rd_spec=-
+init_mmc=run args_all args_mmc
+get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
+get_overlay_mmc=
+   fdt address ${fdtaddr};
+   fdt resize 0x10;
+   for overlay in $name_overlays;
+   do;
+   load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} &&
+   fdt apply ${dtboaddr};
+   done;
+get_kern_mmc=load mmc ${bootpart} ${loadaddr}
+   ${bootdir}/${name_kern}
+get_fit_mmc=load mmc ${bootpart} ${addr_fit}
+   ${bootdir}/${name_fit}
+partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
diff --git a/include/configs/am62x_evm.h b/include/configs/am62x_evm.h
index 7fbefdece4..7bf07809b0 100644
--- a/include/configs/am62x_evm.h
+++ b/include/configs/am62x_evm.h
@@ -38,51 +38,8 @@
DISTRO_BOOT_DEV_PXE(func) \
DISTRO_BOOT_DEV_DHCP(func)
 
-#define PARTS_DEFAULT \
-   /* Linux partitions */ \
-   "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
-
-/* U-Boot general configuration */
-#define EXTRA_ENV_AM625_BOARD_SETTINGS \
-   "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0"  \
-   "findfdt="  \
-   "setenv name_fdt ${default_device_tree};"   \
-   "setenv fdtfile ${name_fdt}\0"  \
-   "name_kern=Image\0" \
-   "console=ttyS2,115200n8\0" 

[PATCH v2 0/1] Use .env file for environment variables

2023-01-23 Thread Nikhil M Jain
Add .env file for setting up environment variable
fot AM62x.

Nikhil M Jain (1):
  include: configs: am62x_evm: Add .env file for Am62x

 board/ti/am62x/am62x.env| 103 
 include/configs/am62x_evm.h |  43 ---
 2 files changed, 103 insertions(+), 43 deletions(-)
 create mode 100644 board/ti/am62x/am62x.env

-- 
2.17.1



Re: [PATCH v4 3/4] eficonfig: add vertical scroll support

2023-01-23 Thread Masahisa Kojima
Hi Ilias,

On Tue, 24 Jan 2023 at 00:07, Ilias Apalodimas
 wrote:
>
> On Fri, Jan 20, 2023 at 05:43:57PM +0900, Masahisa Kojima wrote:
> > The current eficonfig menu does not support vertical scroll,
> > so it can not display the menu entries greater than
> > the console row size.
> >
> > This commit add the vertial scroll support.
> > The console size is retrieved by
> > SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then
> > calculates the row size for menu entry by subtracting
> > menu header and description row size from the console row size.
> > "start" and "end" are added in the efimenu structure.
> > "start" keeps the menu entry index at the top, "end" keeps
> > the bottom menu entry index. item_data_print() menu function
> > only draws the menu entry between "start" and "end".
> >
> > Signed-off-by: Masahisa Kojima 
> > ---
> > No update since v3
> >
> > Changes in v3:
> > - modify "reverse" local variable type to bool
> >
> > Changes in v2:
> > - add comment when the user key press is not valid
> > - add const qualifier to eficonfig_change_boot_order_desc
> >
> >  cmd/eficonfig.c  | 79 
> >  include/efi_config.h |  4 +++
> >  include/efi_loader.h |  1 +
> >  3 files changed, 70 insertions(+), 14 deletions(-)
> >
> > diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
> > index 01bd1b05bc..5692b332c7 100644
> > --- a/cmd/eficonfig.c
> > +++ b/cmd/eficonfig.c
> > @@ -30,8 +30,13 @@ static const char *eficonfig_change_boot_order_desc =
> >   "  Press SPACE to activate or deactivate the entry\n"
> >   "  Select [Save] to complete, ESC/CTRL+C to quit";
> >
> > +static struct efi_simple_text_output_protocol *cout;
> > +static int avail_row;
> > +
> >  #define EFICONFIG_DESCRIPTION_MAX 32
> >  #define EFICONFIG_OPTIONAL_DATA_MAX 64
> > +#define EFICONFIG_MENU_HEADER_ROW_NUM 3
> > +#define EFICONFIG_MENU_DESC_ROW_NUM 5
> >
> >  /**
> >   * struct eficonfig_filepath_info - structure to be used to store file path
> > @@ -157,18 +162,16 @@ void eficonfig_print_entry(void *data)
> >   struct eficonfig_entry *entry = data;
> >   bool reverse = (entry->efi_menu->active == entry->num);
> >
> > - /* TODO: support scroll or page for many entries */
> > + if (entry->efi_menu->start > entry->num || entry->efi_menu->end < 
> > entry->num)
> > + return;
> >
> > - /*
> > -  * Move cursor to line where the entry will be drawn (entry->num)
> > -  * First 3 lines(menu header) + 1 empty line
> > -  */
> > - printf(ANSI_CURSOR_POSITION, entry->num + 4, 7);
> > + printf(ANSI_CURSOR_POSITION, (entry->num - entry->efi_menu->start) +
> > +EFICONFIG_MENU_HEADER_ROW_NUM + 1, 7);
> >
> >   if (reverse)
> >   puts(ANSI_COLOR_REVERSE);
> >
> > - printf("%s", entry->title);
> > + printf(ANSI_CLEAR_LINE "%s", entry->title);
> >
> >   if (reverse)
> >   puts(ANSI_COLOR_RESET);
> > @@ -191,8 +194,8 @@ void eficonfig_display_statusline(struct menu *m)
> >  ANSI_CURSOR_POSITION ANSI_CLEAR_LINE ANSI_CURSOR_POSITION
> >  "%s"
> >  ANSI_CLEAR_LINE_TO_END,
> > -1, 1, entry->efi_menu->menu_header, entry->efi_menu->count + 
> > 5, 1,
> > -entry->efi_menu->count + 6, 1, entry->efi_menu->menu_desc);
> > +1, 1, entry->efi_menu->menu_header, avail_row + 4, 1,
> > +avail_row + 5, 1, entry->efi_menu->menu_desc);
> >  }
> >
> >  /**
> > @@ -216,13 +219,23 @@ char *eficonfig_choice_entry(void *data)
> >
> >   switch (key) {
> >   case BKEY_UP:
> > - if (efi_menu->active > 0)
> > + if (efi_menu->active > 0) {
> >   --efi_menu->active;
> > + if (efi_menu->start > efi_menu->active) {
> > + efi_menu->start--;
> > + efi_menu->end--;
> > + }
>
> For all the sequences of this do:
> void efi_menu_adjust(struct efimenu *menu, bool add)  {
> if (add && efi_menu->end < efi_menu->active) {
> menu->start++;
> menu->end++;
> } else if (!add && efi_menu->start > efi_menu->active)
> menu->start--;
> menu->end--;
> }
> }
> #define efi_menu_up(_a) efi_menu_adjust(_a, true)
> #define efi_menu_down(_a) efi_menu_adjust(_a, false)
>
> I think this would look a bit more readable

Yes, it is more readable. Thank you.

Regards,
Masahisa Kojima

>
> > + }
> >   /* no menu key selected, regenerate menu */
> >   return NULL;
> >   case BKEY_DOWN:
> > - if (efi_menu->active < efi_menu->count - 1)
> > + if (efi_menu->active < efi_menu->count - 1) {
> >   ++efi_menu->active;
> > + if (efi_menu->end < efi_menu->active) {
> 

Re: [PATCH 3/5] usb: dwc3-generic: Add dependency on SIMPLE_BUS

2023-01-23 Thread Kunihiko Hayashi

Hi Marek,

On 2023/01/24 0:49, Marek Vasut wrote:

On 1/23/23 06:01, Kunihiko Hayashi wrote:

Hi Marek,


Hello Hayashi-san,

[...]


On the other hand, the PXS2 controller for example is not a bus:

arch/arm/dts/uniphier-pxs2.dtsi:
596 _usb0: usb@65a0 {
597 compatible = "socionext,uniphier-dwc3", "snps,dwc3";
598 status = "disabled";
599 reg = <0x65a0 0xcd00>;
...
610 };


I understand. However, this node isn't used in u-boot.
(see below for details)


Is this needed for socionext dwc3 variant to handle the simple-mfd in
e.g. arch/arm/dts/uniphier-pxs3.dtsi :

614 usb-glue@65b0 {
615 compatible = "socionext,uniphier-pxs3-dwc3-glue",
616  "simple-mfd";

?


In case of U-Boot, the glue driver is probed by:

   /* FIXME: U-Boot own node */
   usb@65b0 {
   compatible = "socionext,uniphier-pxs3-dwc3";

And dwc3-uniphier is also declared as UCLASS_SIMPLE_BUS.
Even if using "simple-mfd", this is included in
drivers/core/simple-bus.c
which is declared as UCLASS_SIMPLE_BUS.


If I understand this correctly, node compatible with
"socionext,uniphier-pxs3-dwc3-glue" is not used at all , right ?


Yes.
Original uniphier devicetree has the following usb nodes.

  usb@65a0 {
  compatible = "snps,dwc3";
  };
  usb-glue@65b0 {
  compatible = "socionext,uniphier-pxs3-dwc3-glue", "simple-mfd";
  };

However, U-Boot dwc3-generic needs to put dwc3 node under the glue node.


Have a look at arch/arm/dts/imx8mq.dtsi which does not use any glue
node, the snps,dwc3 compatible node is directly placed on the soc@0 bus:

1417
1418 usb_dwc3_0: usb@3810 {
1419 compatible = "fsl,imx8mq-dwc3", "snps,dwc3";
1420 reg = <0x3810 0x1>;
1421 clocks = <&clk IMX8MQ_CLK_USB1_CTRL_ROOT>,


Due to this restriction, there is another usb node dedicated to u-boot.

  /* FIXME: U-Boot own node */
  usb@65b0 { /* glue */
  compatible = "socionext,uniphier-pxs3-dwc3";

  dwc3@65a0 {
  compatible = "snps,dwc3";
  };
  };

So instead of "socionext,uniphier-pxs3-dwc3-glue", the glue driver
uses "socionext,uniphier-pxs3-dwc3" in U-Boot.


Can we use the same method as imx8mq.dtsi uses, to avoid this special
node workaround ?


Umm, it's curious. It seems imx8mq doesn't have any glue registers and defines
dwc3 core registers directly.

On the other hand, "fsl,imx8mq-dwc3" is included in dwc3-generic.c, though,
dwc3_glue_bind() calls the driver that the child node shows.

ofnode_for_each_subnode(node, dev_ofnode(parent)) {
...
device_bind_driver_to_node(parent, driver, name,
   node, &dev);
...
}

Maybe the child node expects the driver that "snps,dwc3" indicates.

If we use the same method as imx8mq.dtsi, I think there is no way to probe
the driver for "snps,dwc3" in dwc3-generic.c.

BTW, xchi-dwc3.c can handle "snps,dwc3", but it seems this doesn't use
usb/dwc3/ functions (so I'm confusing it).


The generic driver binds to node compatible with
"socionext,uniphier-dwc3" , right ?


No, the generic driver binds "socionext,uniphier-pxs3-dwc3".


That means, there is nothing which would be a bus, and so the
dwc3-uniphier.c can be switched from UCLASS_SIMPLE_BUS to UCLASS_NOP ,
is that correct ?


There is still the issue of different usb node between Original and
u-boot,
however, the glue driver can be switched to UCLASS_NOP.


Understood, thank you for the clarification.


Thank you,

---
Best Regards
Kunihiko Hayashi


Re: [PATCH] arch/riscv/dts: Fix uart reg-shift on fu540/fu740 SiFive devices

2023-01-23 Thread Alexander von Gluck IV
January 23, 2023 8:08 PM, "Alexander von Gluck IV"  
wrote:
> * Not specifying reg-shift creates a situation where the register
> shift is unknown and can only be decoded via special compat
> cases.
> * The device tree specification states:
> "...reg-shift. If unspecified, the default value is 0."
> https://devicetree-specification.readthedocs.io/en/latest/chapter4-device-bindings.html
> * Since the reg-shift for the SiFive boards is *NOT* 0, it shall
> be defined as 2

Groan, ignore this patch.

I misread somewhere that the sifive,uart0 
was 8250 compatible.  It is not, and doesn't use any kind of shift other than
registers fitting into struct of unions.

I'm herding too many cats.

 -- Alex


[PATCH] arch/riscv/dts: Fix uart reg-shift on fu540/fu740 SiFive devices

2023-01-23 Thread Alexander von Gluck IV
* Not specifying reg-shift creates a situation where the register
  shift is unknown and can only be decoded via special compat
  cases.
* The device tree specification states:
  "...reg-shift.  If unspecified, the default value is 0."
  
https://devicetree-specification.readthedocs.io/en/latest/chapter4-device-bindings.html
* Since the reg-shift for the SiFive boards is *NOT* 0, it shall
  be defined as 2
---
 arch/riscv/dts/fu540-c000.dtsi | 1 +
 arch/riscv/dts/fu740-c000.dtsi | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/arch/riscv/dts/fu540-c000.dtsi b/arch/riscv/dts/fu540-c000.dtsi
index 7db8610534..0bea8cf1e5 100644
--- a/arch/riscv/dts/fu540-c000.dtsi
+++ b/arch/riscv/dts/fu540-c000.dtsi
@@ -161,6 +161,7 @@
uart0: serial@1001 {
compatible = "sifive,fu540-c000-uart", "sifive,uart0";
reg = <0x0 0x1001 0x0 0x1000>;
+   reg-shift = <2>;
interrupt-parent = <&plic0>;
interrupts = <4>;
clocks = <&prci PRCI_CLK_TLCLK>;
diff --git a/arch/riscv/dts/fu740-c000.dtsi b/arch/riscv/dts/fu740-c000.dtsi
index 7b77c13496..19da3709f0 100644
--- a/arch/riscv/dts/fu740-c000.dtsi
+++ b/arch/riscv/dts/fu740-c000.dtsi
@@ -164,6 +164,7 @@
uart0: serial@1001 {
compatible = "sifive,fu740-c000-uart", "sifive,uart0";
reg = <0x0 0x1001 0x0 0x1000>;
+   reg-shift = <2>;
interrupt-parent = <&plic0>;
interrupts = <39>;
clocks = <&prci FU740_PRCI_CLK_PCLK>;
@@ -172,6 +173,7 @@
uart1: serial@10011000 {
compatible = "sifive,fu740-c000-uart", "sifive,uart0";
reg = <0x0 0x10011000 0x0 0x1000>;
+   reg-shift = <2>;
interrupt-parent = <&plic0>;
interrupts = <40>;
clocks = <&prci FU740_PRCI_CLK_PCLK>;
-- 
2.39.1



Re: [PATCH v3 12/70] dm: part: Update test to use mmc2

2023-01-23 Thread Tom Rini
On Tue, Jan 17, 2023 at 10:47:22AM -0700, Simon Glass wrote:

> At present this test sets up a partition table on mmc1. But this is used
> by the bootstd tests, so it is not possible to run those after this test
> has run, without restarting the Python test harness.
> 
> This is inconvenient when running tests repeatedly with 'ut dm'. Move the
> test to use mmc2, which is not used by anything.
> 
> Signed-off-by: Simon Glass 

When I run tests like this:
TEST="not sleep and not event_dump and not bootmgr and not extension"
./tools/buildman/buildman -o /tmp/sandbox -P --board sandbox
./test/py/test.py --bd $ARGS --build-dir /tmp/sandbox -k "$TEST" -ra
I get:
== FAILURES 
===
_ test_ut[ut_dm_dm_test_part] 
_
test/py/tests/test_ut.py:341: in test_ut
assert output.endswith('Failures: 0')
E   assert False
E+  where False = ('Failures: 0')
E+where  = 'Test: 
dm_test_part: part.c\r\r\n** No device specified **\r\r\nCouldn\'t find 
partition mmc \r\r\n** No device ...: 0 == do_test(uts, 2, "1:2", 0): 
Expected 0x0 (0), got 0x1 (1)\r\r\nTest dm_test_part failed 4 
times\r\r\nFailures: 4'.endswith
 Captured stdout call 
-
=> ut dm dm_test_part
Test: dm_test_part: part.c
** No device specified **
Couldn't find partition mmc 
** No device specified **
Couldn't find partition mmc
** No partition table - mmc 0 **
Couldn't find partition mmc 0
Could not find "test1" partition
** Bad device specification mmc #test1 **
** Bad device specification mmc #test1 **
Couldn't find partition mmc #test1
** Bad partition specification mmc 1:0 **
Couldn't find partition mmc 1:0
** Invalid partition 2 **
Couldn't find partition mmc 1:2
test/dm/part.c:20, do_test(): expected == 
part_get_info_by_dev_and_name_or_num("mmc", part_str, &mmc_dev_desc, 
&part_info, whole): Expected 0x2 (2), got 0xfffe (-2)
test/dm/part.c:82, dm_test_part(): 0 == do_test(uts, 2, "1:2", 0): Expected 0x0 
(0), got 0x1 (1)
Test: dm_test_part: part.c (flat tree)
** No device specified **
Couldn't find partition mmc 
** No device specified **
Couldn't find partition mmc
** No partition table - mmc 0 **
Couldn't find partition mmc 0
Could not find "test1" partition
** Bad device specification mmc #test1 **
** Bad device specification mmc #test1 **
Couldn't find partition mmc #test1
** Bad partition specification mmc 1:0 **
Couldn't find partition mmc 1:0
** Invalid partition 2 **
Couldn't find partition mmc 1:2
test/dm/part.c:20, do_test(): expected == 
part_get_info_by_dev_and_name_or_num("mmc", part_str, &mmc_dev_desc, 
&part_info, whole): Expected 0x2 (2), got 0xfffe (-2)
test/dm/part.c:82, dm_test_part(): 0 == do_test(uts, 2, "1:2", 0): Expected 0x0 
(0), got 0x1 (1)
Test dm_test_part failed 4 times
Failures: 4
=>

And further tests down the series also fail / introduce failures, but
this is the first one, and why I thought v2 had more problems.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 00/17] Basic StarFive JH7110 RISC-V SoC support

2023-01-23 Thread Heinrich Schuchardt




On 1/18/23 09:11, Yanhong Wang wrote:

This series of patches base on the latest branch/master, and add support
for the StarFive JH7110 RISC-V SoC and VisionFive V2 board. In order for
this to be achieved, the respective DT nodes have been added,  and the
required defconfigs have been added to the boards' defconfig. What is more,
the basic required DM drivers have been added, such as reset, clock, pinctrl,
uart, ram etc.

Note that the register base address of reset controller is same with the
clock controller. Therefore, there is no device tree node alone for reset
driver. It binds device node in the clock driver.

The u-boot-spl and u-boot has been tested on the VisionFive V2 boards which
equip with JH7110 SoC and works normally.

For more information and support, you can visit RVspace wiki[1].


Hello Yanhong,

Which version of OpenSBI is needed for this series to work?

Could you, please, provide a file in doc/board/starfive/ describing how 
to build and install U-Boot on the board.


Is tool create_sbl from https://github.com/starfive-tech/Tools still 
required? Can the source code for that tool be made available? Ideally 
this would be integrated into binman.


This is what I have in my notes:

cd Tools && \
./create_sbl $(uboot_wrkdir)/spl/u-boot-spl.bin 0x01010101

Best regards

Heinrich



[1] https://wiki.rvspace.org/

Changes in v2:
- Renamed file 'jh7110-regs.h' to 'regs.h'.
- Reworded the clear L2 LIM memory code in C.
- Removed flash init call in 'spl_soc_init' function.
- Reworded the clock driver.
- Rename the macro 'SET_DIV' to 'ASSIGNED_CLOCK_PARENTS' in 'spl.c'.
- Moved the device tree node 'dmc@1570' from 'jh7110-u-boot.dtsi' to
   'starfive_visionfive2-u-boot.dtsi'.

Previous versions:
v1 - 
https://patchwork.ozlabs.org/project/uboot/cover/20221212025020.23778-1-yanhong.w...@starfivetech.com/

Jianlong Huang (1):
   dt-bindings: pinctrl: Add StarFive JH7110 pinctrl definitions

Kuan Lim Lee (1):
   pinctrl: starfive: Add StarFive JH7110 driver

Yanhong Wang (15):
   riscv: cpu: jh7110: Add support for jh7110 SoC
   cache: starfive: Add StarFive JH7110 support
   dt-bindings: reset: Add StarFive JH7110 reset definitions
   reset: starfive: jh7110: Add reset driver for StarFive JH7110 SoC
   dt-bindings: clock: Add StarFive JH7110 clock definitions
   clk: starfive: Add StarFive JH7110 clock driver
   ram: starfive: add ddr driver
   board: starfive: add StarFive VisionFive v2 board support
   riscv: cpu: jh7110: Add Kconfig for StarFive JH7110 SoC
   board: starfive: Add Kconfig for StarFive VisionFive v2 Board
   board: starfive: Add TARGET_STARFIVE_VISIONFIVE2 to Kconfig
   riscv: dts: jh7110: Add initial StarFive JH7110 device tree
   riscv: dts: jh7110: Add initial u-boot device tree
   riscv: dts: jh7110: Add initial StarFive VisionFive v2 board device
 tree
   configs: starfive: add starfive_visionfive2_defconfig

  arch/riscv/Kconfig|5 +
  arch/riscv/cpu/jh7110/Kconfig |   28 +
  arch/riscv/cpu/jh7110/Makefile|   10 +
  arch/riscv/cpu/jh7110/cpu.c   |   23 +
  arch/riscv/cpu/jh7110/dram.c  |   38 +
  arch/riscv/cpu/jh7110/spl.c   |   64 +
  arch/riscv/dts/Makefile   |2 +-
  arch/riscv/dts/jh7110-u-boot.dtsi |   72 +
  arch/riscv/dts/jh7110.dtsi|  497 +
  .../dts/starfive_visionfive2-u-boot.dtsi  |   84 +
  arch/riscv/dts/starfive_visionfive2.dts   |  234 ++
  arch/riscv/include/asm/arch-jh7110/regs.h |   19 +
  arch/riscv/include/asm/arch-jh7110/spl.h  |   12 +
  board/starfive/visionfive2/Kconfig|   53 +
  board/starfive/visionfive2/MAINTAINERS|7 +
  board/starfive/visionfive2/Makefile   |7 +
  board/starfive/visionfive2/spl.c  |  118 +
  .../visionfive2/starfive_visionfive2.c|   38 +
  configs/starfive_visionfive2_defconfig|   72 +
  drivers/cache/cache-sifive-ccache.c   |1 +
  drivers/clk/Kconfig   |1 +
  drivers/clk/Makefile  |1 +
  drivers/clk/starfive/Kconfig  |   17 +
  drivers/clk/starfive/Makefile |4 +
  drivers/clk/starfive/clk-jh7110-pll.c |  293 +++
  drivers/clk/starfive/clk-jh7110.c |  559 +
  drivers/clk/starfive/clk.h|   60 +
  drivers/pinctrl/Kconfig   |1 +
  drivers/pinctrl/Makefile  |1 +
  drivers/pinctrl/starfive/Kconfig  |   16 +
  drivers/pinctrl/starfive/Makefile |6 +
  drivers/pinctrl/starfive/pinctrl-jh7110-aon.c |  113 +
  drivers/pinctrl/starfive/pinctrl-jh7110-sys.c |  399 
  drivers/pinctrl/starfive/pinctrl-starfive.c   |  428 
  drivers/pinctrl/starfive/pinctrl-starfive.h   |   55 +
  drivers/ram/Kconfig   |1 +
  drivers/ram/Makefile   

[PATCH 1/1] efi_loader: fix comment in ESRT code

2023-01-23 Thread Heinrich Schuchardt
There is no variable num_pages in function efi_esrt_allocate_install().

Signed-off-by: Heinrich Schuchardt 
---
 lib/efi_loader/efi_esrt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_esrt.c b/lib/efi_loader/efi_esrt.c
index dcc08a6d3a..7f46d651e6 100644
--- a/lib/efi_loader/efi_esrt.c
+++ b/lib/efi_loader/efi_esrt.c
@@ -115,7 +115,7 @@ efi_status_t efi_esrt_allocate_install(u32 num_entries)
u32 size = efi_esrt_entries_to_size(num_entries);
efi_guid_t esrt_guid = efi_esrt_guid;
 
-   /* Reserve num_pages for ESRT */
+   /* Reserve memory for ESRT */
ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA, size,
(void **)&new_esrt);
 
-- 
2.38.1



Re: [PATCH] tools: mkimage: Allow changing U-Boot image magic

2023-01-23 Thread Hauke Mehrtens

On 1/23/23 19:49, Simon Glass wrote:

Hi,

On Sun, 22 Jan 2023 at 07:20, Hauke Mehrtens  wrote:


Extend mkimage with a new optional option -M to specify a special U-Boot
image magic number. OpenWrt ships images for about 30 different boards
with vendor boot loaders which are expecting the mkimage format, but
with a different image magic.

OpenWrt includes this patch for mkimage more than 10 years.
It was added by Gabor Juhos in this commit:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=f3d2056b81b7a92d28402c22736534d84fe23cfe

Cc: Gabor Juhos 
Signed-off-by: Hauke Mehrtens 
---
  tools/default_image.c |  4 ++--
  tools/imagetool.h |  1 +
  tools/mkimage.c   | 14 --
  3 files changed, 15 insertions(+), 4 deletions(-)


Strange...what is the different magic for?


I do not know really know why some vendors do this. With Openwrt we 
create images which user can install on their devices. We normally do 
not change the vendor bootloader and create an image which is compatible 
with the vendor boot loader.


I assume the vendors want to prevent users from installing "unsupported" 
images, but still want to use something close to the U-Boot image. With 
a different magic their boot loader (often vendor modified U-Boot) can 
prevent the user from installing "wrong" images.


I saw this on many devices sold by NetGear for example these devices:
NETGEAR WNDR4300
NETGEAR WNDR4500
NETGEAR WNR1000
NETGEAR WNR612 v2

I have also seen it from other vendors, probably some ODM or OEM does this.

Hauke


Re: [PATCH v1 1/2] cmd: exit: add continue on key press command

2023-01-23 Thread Heinrich Schuchardt



Am 23. Januar 2023 23:25:41 MEZ schrieb Simon Glass :
>On Mon, 23 Jan 2023 at 13:04, Svyatoslav Ryhel  wrote:
>>
>> This command stops performing script until any
>> key is pressed. It is useful for keeping logs
>> on screen until user decides to continue.
>>
>> Co-developed-by: Jonas Schwöbel 
>> Signed-off-by: Jonas Schwöbel 
>> Signed-off-by: Svyatoslav Ryhel 
>> ---
>>  cmd/exit.c | 17 +
>>  1 file changed, 17 insertions(+)
>>
>
>Please add a file in doc/usage/cmd
>
>Also how about a test?
>
>> diff --git a/cmd/exit.c b/cmd/exit.c
>> index 7bf241ec73..673b4b6be7 100644
>> --- a/cmd/exit.c
>> +++ b/cmd/exit.c
>> @@ -7,6 +7,17 @@
>>  #include 
>>  #include 
>>
>> +static int do_continue(struct cmd_tbl *cmdtp, int flag, int argc,
>> +  char *const argv[])
>> +{
>> +   while (true) {
>> +   if (getchar())
>> +   break;
>> +   }
>> +
>> +   return 0;
>> +}

We already have the sleep command which waits until CTRL+C is pressed or a time 
interval has elapsed.

Why does that command not satisfy the use case?

The command name continue is used in other languages for control structures. We 
should not use it for pausing.

We should not put a new command into an existing C module without good reason.

Best regards

Heinrich 



>> +
>>  static int do_exit(struct cmd_tbl *cmdtp, int flag, int argc,
>>char *const argv[])
>>  {
>> @@ -19,6 +30,12 @@ static int do_exit(struct cmd_tbl *cmdtp, int flag, int 
>> argc,
>> return -r - 2;
>>  }
>>
>> +U_BOOT_CMD(
>> +   continue,   1,  0,  do_continue,
>> +   "continue script on key pressed",
>> +   ""
>> +);
>> +
>>  U_BOOT_CMD(
>> exit,   2,  1,  do_exit,
>> "exit script",
>> --
>> 2.25.1
>>
>
>Regards,
>Simon


[PATCH] usb: host: ehci-generic: Handle DM_RESET=n case

2023-01-23 Thread Marek Vasut
In case CONFIG_DM_RESET=n, reset_get_bulk() returns -ENOTSUPP.
Do not fail in that case either. This is a valid use case, e.g.
in case the reset driver is a no-op and would only waste space
in the build.

Fixes: 81755b8c20f ("usb: host: ehci-generic: Make resets and clocks optional")
Signed-off-by: Marek Vasut 
---
Cc: Andre Przywara 
Cc: Patrice Chotard 
---
 drivers/usb/host/ehci-generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index a765a307a32..83fe701ff67 100644
--- a/drivers/usb/host/ehci-generic.c
+++ b/drivers/usb/host/ehci-generic.c
@@ -81,7 +81,7 @@ static int ehci_usb_probe(struct udevice *dev)
}
 
err = reset_get_bulk(dev, &priv->resets);
-   if (err && err != -ENOENT) {
+   if (err && err != -ENOENT && err != -ENOTSUPP) {
dev_err(dev, "Failed to get resets (err=%d)\n", err);
goto clk_err;
}
-- 
2.39.0



[PATCH 80/88] rmobile: Drop unused ehci-rmobile driver

2023-01-23 Thread Simon Glass
This is not used. Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 .../mach-rmobile/include/mach/ehci-rmobile.h  | 146 --
 drivers/usb/host/Makefile |   1 -
 drivers/usb/host/ehci-rmobile.c   | 129 
 3 files changed, 276 deletions(-)
 delete mode 100644 arch/arm/mach-rmobile/include/mach/ehci-rmobile.h
 delete mode 100644 drivers/usb/host/ehci-rmobile.c

diff --git a/arch/arm/mach-rmobile/include/mach/ehci-rmobile.h 
b/arch/arm/mach-rmobile/include/mach/ehci-rmobile.h
deleted file mode 100644
index ca8c5f37063..000
--- a/arch/arm/mach-rmobile/include/mach/ehci-rmobile.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- *  Copyright (C) 2013,2014 Renesas Electronics Corporation
- *  Copyright (C) 2014 Nobuhiro Iwamatsu 
- */
-
-#ifndef __EHCI_RMOBILE_H__
-#define __EHCI_RMOBILE_H__
-
-/* Register offset */
-#define OHCI_OFFSET0x00
-#define OHCI_SIZE  0x1000
-#define EHCI_OFFSET0x1000
-#define EHCI_SIZE  0x1000
-
-#define EHCI_USBCMD(EHCI_OFFSET + 0x0020)
-
-/* USBCTR */
-#define DIRPD  (1 << 8)
-#define PLL_RST(1 << 2)
-#define PCICLK_MASK(1 << 1)
-#define USBH_RST   (1 << 0)
-
-/* CMND_STS */
-#define SERREN (1 << 8)
-#define PERREN (1 << 6)
-#define MASTEREN   (1 << 2)
-#define MEMEN  (1 << 1)
-
-/* PCIAHB_WIN1_CTR and PCIAHB_WIN2_CTR */
-#define PCIAHB_WIN_PREFETCH((1 << 1)|(1 << 0))
-
-/* AHBPCI_WIN1_CTR */
-#define PCIWIN1_PCICMD ((1 << 3)|(1 << 1))
-#define AHB_CFG_AHBPCI 0x4000
-#define AHB_CFG_HOST   0x8000
-
-/* AHBPCI_WIN2_CTR */
-#define PCIWIN2_PCICMD ((1 << 2)|(1 << 1))
-
-/* PCI_INT_ENABLE */
-#define USBH_PMEEN (1 << 19)
-#define USBH_INTBEN(1 << 17)
-#define USBH_INTAEN(1 << 16)
-
-/* AHB_BUS_CTR */
-#define SMODE_READY_CTR(1 << 17)
-#define SMODE_READ_BURST   (1 << 16)
-#define MMODE_HBUSREQ  (1 << 7)
-#define MMODE_BOUNDARY ((1 << 6)|(1 << 5))
-#define MMODE_BURST_WIDTH  ((1 << 4)|(1 << 3))
-#define MMODE_SINGLE_MODE  ((1 << 4)|(1 << 3))
-#define MMODE_WR_INCR  (1 << 2)
-#define MMODE_BYTE_BURST   (1 << 1)
-#define MMODE_HTRANS   (1 << 0)
-
-/* PCI_ARBITER_CTR */
-#define PCIBUS_PARK_TIMER   0x00FF
-#define PCIBUS_PARK_TIMER_SET   0x0007
-#define PCIBP_MODE (1 << 12)
-#define PCIREQ7 (1 << 7)
-#define PCIREQ6 (1 << 6)
-#define PCIREQ5 (1 << 5)
-#define PCIREQ4 (1 << 4)
-#define PCIREQ3 (1 << 3)
-#define PCIREQ2 (1 << 2)
-#define PCIREQ1 (1 << 1)
-#define PCIREQ0 (1 << 0)
-
-#define SMSTPCR70xE615014C
-#define SMSTPCR703  (1 << 3)
-
-/* Init AHB master and slave functions of the host logic */
-#define AHB_BUS_CTR_INIT \
-   (SMODE_READY_CTR | MMODE_HBUSREQ | MMODE_WR_INCR | \
-MMODE_BYTE_BURST | MMODE_HTRANS)
-
-#define USBCTR_WIN_SIZE_1GB0x800
-
-/* PCI Configuration Registers */
-#define PCI_CONF_OHCI_OFFSET   0x1
-#define PCI_CONF_EHCI_OFFSET   0x10100
-struct ahb_pciconf {
-   u32 vid_did;
-   u32 cmnd_sts;
-   u32 rev;
-   u32 cache_line;
-   u32 basead;
-};
-
-/* PCI Configuration Registers for AHB-PCI Bridge Registers */
-#define PCI_CONF_AHBPCI_OFFSET 0x1
-struct ahbconf_pci_bridge {
-   u32 vid_did;/* 0x00 */
-   u32 cmnd_sts;
-   u32 revid_cc;
-   u32 cls_lt_ht_bist;
-   u32 basead; /* 0x10 */
-   u32 win1_basead;
-   u32 win2_basead;
-   u32 dummy0[5];
-   u32 ssvdi_ssid; /* 0x2C */
-   u32 dummy1[4];
-   u32 intr_line_pin;
-};
-
-/* AHB-PCI Bridge PCI Communication Registers */
-#define AHBPCI_OFFSET  0x10800
-struct ahbcom_pci_bridge {
-   u32 pciahb_win1_ctr;/* 0x00 */
-   u32 pciahb_win2_ctr;
-   u32 pciahb_dct_ctr;
-   u32 dummy0;
-   u32 ahbpci_win1_ctr;/* 0x10 */
-   u32 ahbpci_win2_ctr;
-   u32 dummy1;
-   u32 ahbpci_dct_ctr;
-   u32 pci_int_enable; /* 0x20 */
-   u32 pci_int_status;
-   u32 dummy2[2];
-   u32 ahb_bus_ctr;/* 0x30 */
-   u32 usbctr;
-   u32 dummy3[2];
-   u32 pci_arbiter_ctr;/* 0x40 */
-   u32 dummy4;
-   u32 pci_unit_rev;   /* 0x48 */
-};
-
-struct rmobile_ehci_reg {
-   u32 hciversion; /* hciversion/caplength */
-   u32 hcsparams;  /* hcsparams */
-   u32 hccparams;  /* hccparams */
-   u32 hcsp_portroute; /* hcsp_portroute */
-   u32 usbcmd; /* usbcmd */
-   u32 usbsts; /* usbsts */
-   u32 usbintr;/* usbintr */
-   u32 frindex;/* frindex */
-   u32 ctrldssegment;  /* ctrldssegment */
-   u32 periodiclistbase;   /* periodic

[PATCH 85/88] watchdog: Rename WDT_MPC8xx

2023-01-23 Thread Simon Glass
CONFIG options must not use lower-case letter. Convert this to upper case.

Signed-off-by: Simon Glass 
---

 arch/powerpc/Kconfig  | 2 +-
 drivers/watchdog/Kconfig  | 2 +-
 drivers/watchdog/Makefile | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 71d5ea50f54..980f6e10e28 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -30,7 +30,7 @@ config MPC8xx
bool "MPC8xx"
select BOARD_EARLY_INIT_F
imply CMD_REGINFO
-   imply WDT_MPC8xx
+   imply WDT_MPC8XX
 
 endchoice
 
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 9218de06e22..33845065cf2 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -184,7 +184,7 @@ config WDT_MESON_GXBB
  Select this to enable Meson watchdog timer,
  which can be found on some Amlogic platforms.
 
-config WDT_MPC8xx
+config WDT_MPC8XX
bool "MPC8xx watchdog timer support"
depends on WDT && MPC8xx
select HW_WATCHDOG
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 446d961d7d2..699aff3fb36 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -29,7 +29,7 @@ obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o
 obj-$(CONFIG_WDT_GPIO) += gpio_wdt.o
 obj-$(CONFIG_WDT_MAX6370) += max6370_wdt.o
 obj-$(CONFIG_WDT_MESON_GXBB) += meson_gxbb_wdt.o
-obj-$(CONFIG_WDT_MPC8xx) += mpc8xx_wdt.o
+obj-$(CONFIG_WDT_MPC8XX) += mpc8xx_wdt.o
 obj-$(CONFIG_WDT_MT7620) += mt7620_wdt.o
 obj-$(CONFIG_WDT_MT7621) += mt7621_wdt.o
 obj-$(CONFIG_WDT_MTK) += mtk_wdt.o
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 88/88] fdt: Drop use of non-existent OF_PLATDATA option

2023-01-23 Thread Simon Glass
These are only present in SPL. Drop the references to non-SPL versions.

Signed-off-by: Simon Glass 
---

 dts/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dts/Kconfig b/dts/Kconfig
index bc5f22029ff..44cc6bf1f6f 100644
--- a/dts/Kconfig
+++ b/dts/Kconfig
@@ -21,8 +21,8 @@ menu "Device Tree Control"
 
 config OF_CONTROL
bool "Run-time configuration via Device Tree"
-   select OF_LIBFDT if !OF_PLATDATA
-   select OF_REAL if !OF_PLATDATA
+   select OF_LIBFDT
+   select OF_REAL
help
  This feature provides for run-time configuration of U-Boot
  via a flattened device tree.
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 44/88] imx: Rename CONFIG_MXS to CFG_MXS

2023-01-23 Thread Simon Glass
This is not a Kconfig option so we should not be setting it in the
Makefile. Rename it to use a CFS_ prefix, since this is still used in
mxsimage.c

In general tools should support all the features without reference to
CONFIG options, but this is left to the maintainer to look at.

Signed-off-by: Simon Glass 
---

 tools/Makefile   | 4 ++--
 tools/mxsimage.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index edfa40903d9..2ee43dff542 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -158,9 +158,9 @@ fit_check_sign-objs   := $(dumpimage-mkimage-objs) 
fit_check_sign.o
 file2include-objs := file2include.o
 
 ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_TOOLS_LIBCRYPTO),)
-# Add CONFIG_MXS into host CFLAGS, so we can check whether or not register
+# Add CFG_MXS into host CFLAGS, so we can check whether or not register
 # the mxsimage support within tools/mxsimage.c .
-HOSTCFLAGS_mxsimage.o += -DCONFIG_MXS
+HOSTCFLAGS_mxsimage.o += -DCFG_MXS
 endif
 
 ifdef CONFIG_TOOLS_LIBCRYPTO
diff --git a/tools/mxsimage.c b/tools/mxsimage.c
index fee022aab46..fbe46c47fae 100644
--- a/tools/mxsimage.c
+++ b/tools/mxsimage.c
@@ -5,7 +5,7 @@
  * Copyright (C) 2012-2013 Marek Vasut 
  */
 
-#ifdef CONFIG_MXS
+#ifdef CFG_MXS
 
 #include 
 #include 
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 36/88] m68k: Rename MCF5441x

2023-01-23 Thread Simon Glass
CONFIG options must not use lower-case letter. Convert this to upper case.

Signed-off-by: Simon Glass 
---

 arch/m68k/Kconfig   |  4 ++--
 arch/m68k/Makefile  |  4 ++--
 arch/m68k/cpu/mcf5445x/cpu_init.c   | 12 ++--
 arch/m68k/cpu/mcf5445x/dspi.c   |  4 ++--
 arch/m68k/cpu/mcf5445x/speed.c  |  4 ++--
 arch/m68k/cpu/mcf5445x/start.S  |  8 
 arch/m68k/include/asm/cache.h   |  4 ++--
 arch/m68k/include/asm/global_data.h |  2 +-
 arch/m68k/include/asm/immap_5441x.h |  2 +-
 drivers/mmc/fsl_esdhc_imx.c | 12 ++--
 10 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 6781ba28c7a..4e2a9075b10 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -50,7 +50,7 @@ config MCF537x
 select DM_SERIAL
bool
 
-config MCF5441x
+config MCF5441X
select OF_CONTROL
select DM
 select DM_SERIAL
@@ -108,7 +108,7 @@ config M5373
 
 config M54418
bool
-   select MCF5441x
+   select MCF5441X
 
 # peripherals
 config CF_DSPI
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index cf4562c55f1..b44726242d2 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -16,12 +16,12 @@ cpuflags-$(CONFIG_M5282):= -mcpu=5282
 cpuflags-$(CONFIG_M5307)   := -mcpu=5307
 cpuflags-$(CONFIG_MCF5301X):= -mcpu=53015 -fPIC
 cpuflags-$(CONFIG_MCF532X) := -mcpu=5329 -fPIC
-cpuflags-$(CONFIG_MCF5441x):= -mcpu=54418 -fPIC
+cpuflags-$(CONFIG_MCF5441X):= -mcpu=54418 -fPIC
 
 PLATFORM_CPPFLAGS += $(cpuflags-y)
 
 
-ldflags-$(CONFIG_MCF5441x) := --got=single
+ldflags-$(CONFIG_MCF5441X) := --got=single
 
 ifneq (,$(findstring -linux-,$(shell $(CC) --version)))
 ifneq (,$(findstring GOT,$(shell $(LD) --help)))
diff --git a/arch/m68k/cpu/mcf5445x/cpu_init.c 
b/arch/m68k/cpu/mcf5445x/cpu_init.c
index 1ce244872f1..a70ecfbae73 100644
--- a/arch/m68k/cpu/mcf5445x/cpu_init.c
+++ b/arch/m68k/cpu/mcf5445x/cpu_init.c
@@ -73,7 +73,7 @@ void cfspi_port_conf(void)
 {
gpio_t *gpio = (gpio_t *)MMAP_GPIO;
 
-#ifdef CONFIG_MCF5441x
+#ifdef CONFIG_MCF5441X
pm_t *pm = (pm_t *)MMAP_PM;
 
out_8(&gpio->par_dspi0,
@@ -98,7 +98,7 @@ void cpu_init_f(void)
 {
gpio_t *gpio = (gpio_t *) MMAP_GPIO;
 
-#ifdef CONFIG_MCF5441x
+#ifdef CONFIG_MCF5441X
scm_t *scm = (scm_t *) MMAP_SCM;
pm_t *pm = (pm_t *) MMAP_PM;
 
@@ -203,7 +203,7 @@ void cpu_init_f(void)
out_8(&gpio->par_sdhch, 0xff);
out_8(&gpio->par_sdhcl, 0xff);
 #endif
-#endif /* CONFIG_MCF5441x */
+#endif /* CONFIG_MCF5441X */
 
/* FlexBus Chipselect */
init_fbcs();
@@ -240,13 +240,13 @@ int cpu_init_r(void)
 void uart_port_conf(int port)
 {
gpio_t *gpio = (gpio_t *) MMAP_GPIO;
-#ifdef CONFIG_MCF5441x
+#ifdef CONFIG_MCF5441X
pm_t *pm = (pm_t *) MMAP_PM;
 #endif
 
/* Setup Ports: */
switch (port) {
-#ifdef CONFIG_MCF5441x
+#ifdef CONFIG_MCF5441X
case 0:
/* UART0 */
out_8(&pm->pmcr0, 24);
@@ -340,7 +340,7 @@ int fecpin_setclear(fec_info_t *info, int setclear)
if (fec_get_base_addr(0, &fec0_base))
return -1;
 
-#ifdef CONFIG_MCF5441x
+#ifdef CONFIG_MCF5441X
if (setclear) {
out_8(&gpio->par_fec, 0x03);
out_8(&gpio->srcr_fec, 0x0F);
diff --git a/arch/m68k/cpu/mcf5445x/dspi.c b/arch/m68k/cpu/mcf5445x/dspi.c
index 456af171a4e..628be0c8bbb 100644
--- a/arch/m68k/cpu/mcf5445x/dspi.c
+++ b/arch/m68k/cpu/mcf5445x/dspi.c
@@ -15,7 +15,7 @@ void dspi_chip_select(int cs)
 {
struct gpio *gpio = (struct gpio *)MMAP_GPIO;
 
-#ifdef CONFIG_MCF5441x
+#ifdef CONFIG_MCF5441X
switch (cs) {
case 0:
clrbits_8(&gpio->par_dspi0,
@@ -37,7 +37,7 @@ void dspi_chip_unselect(int cs)
 {
struct gpio *gpio = (struct gpio *)MMAP_GPIO;
 
-#ifdef CONFIG_MCF5441x
+#ifdef CONFIG_MCF5441X
if (cs == 1)
clrbits_8(&gpio->par_dspiow, GPIO_PAR_DSPIOW_DSPI0PSC1);
 #endif
diff --git a/arch/m68k/cpu/mcf5445x/speed.c b/arch/m68k/cpu/mcf5445x/speed.c
index eb73da68c6b..59a6625a4fd 100644
--- a/arch/m68k/cpu/mcf5445x/speed.c
+++ b/arch/m68k/cpu/mcf5445x/speed.c
@@ -63,7 +63,7 @@ void clock_exit_limp(void)
;
 }
 
-#ifdef CONFIG_MCF5441x
+#ifdef CONFIG_MCF5441X
 void setup_5441x_clocks(void)
 {
ccm_t *ccm = (ccm_t *)MMAP_CCM;
@@ -125,7 +125,7 @@ void setup_5441x_clocks(void)
 /* get_clocks() fills in gd->cpu_clock and gd->bus_clk */
 int get_clocks(void)
 {
-#ifdef CONFIG_MCF5441x
+#ifdef CONFIG_MCF5441X
setup_5441x_clocks();
 #endif
 
diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S
index a083c3d45d2..baf39127b29 100644
--- a/arch/m68k/cpu/mcf5445x/start.S
+++ b/arch/m68k/cpu/mcf5445x/start.S
@@ -167,7 +167,7 @@ asm_dram_init:
 #endif
 #endif /* CONFIG_CF_SBF */
 
-#ifdef CONFIG_MCF5441x
+#ifdef CONFIG_

[PATCH 04/88] nand: Drop CONFIG_NAND_SPEAR

2023-01-23 Thread Simon Glass
This is not used anymore. Drop it.

Signed-off-by: Simon Glass 
---

 drivers/mtd/nand/raw/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
index 7320d581e2f..4c59903aa8c 100644
--- a/drivers/mtd/nand/raw/Makefile
+++ b/drivers/mtd/nand/raw/Makefile
@@ -70,7 +70,6 @@ obj-$(CONFIG_NAND_MXS_DT) += mxs_nand_dt.o
 obj-$(CONFIG_NAND_OCTEONTX) += octeontx_nand.o
 obj-$(CONFIG_NAND_OCTEONTX_HW_ECC) += octeontx_bch.o
 obj-$(CONFIG_NAND_PXA3XX) += pxa3xx_nand.o
-obj-$(CONFIG_NAND_SPEAR) += spr_nand.o
 obj-$(CONFIG_TEGRA_NAND) += tegra_nand.o
 obj-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 obj-$(CONFIG_NAND_OMAP_ELM) += omap_elm.o
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 12/88] arm: mvebu: Drop reference to CONFIG_ARMADA_39X

2023-01-23 Thread Simon Glass
This is not defined anywhere. Drop it.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-mvebu/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index 1a9dfc047c9..207ee1b6b89 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -38,7 +38,7 @@ extra-y += kwbimage.cfg
 ifneq ($(CONFIG_ARMADA_3700)$(CONFIG_ARMADA_XP),)
KWB_REPLACE += CPU
KWB_CFG_CPU = SHEEVA
-else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X),)
+else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X),)
KWB_REPLACE += CPU
KWB_CFG_CPU = A9
 endif
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 11/88] arm: mvebu: Correct reference to ARMADA_370

2023-01-23 Thread Simon Glass
Presumably this should be ARMADA_3700. Fix it.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-mvebu/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index a23511b113b..1a9dfc047c9 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -35,7 +35,7 @@ endif
 
 extra-y += kwbimage.cfg
 
-ifneq ($(CONFIG_ARMADA_370)$(CONFIG_ARMADA_XP),)
+ifneq ($(CONFIG_ARMADA_3700)$(CONFIG_ARMADA_XP),)
KWB_REPLACE += CPU
KWB_CFG_CPU = SHEEVA
 else ifneq ($(CONFIG_ARMADA_375)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X),)
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 29/88] i2c: Rename I2C_MUX_PCA954x

2023-01-23 Thread Simon Glass
CONFIG options must not use lower-case letter. Convert this to upper case.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-mvebu/Kconfig| 2 +-
 configs/SBx81LIFKW_defconfig   | 2 +-
 configs/SBx81LIFXCAT_defconfig | 2 +-
 configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig | 2 +-
 configs/cgtqmx8_defconfig  | 2 +-
 configs/ge_bx50v3_defconfig| 2 +-
 configs/imx8qm_mek_defconfig   | 2 +-
 configs/imx8qm_rom7720_a1_4G_defconfig | 2 +-
 configs/imx8qxp_mek_defconfig  | 2 +-
 configs/kmcent2_defconfig  | 2 +-
 configs/kmcoge5ne_defconfig| 2 +-
 configs/kmeter1_defconfig  | 2 +-
 configs/kmopti2_defconfig  | 2 +-
 configs/kmsupx5_defconfig  | 2 +-
 configs/kmtepr2_defconfig  | 2 +-
 configs/ls1028aqds_tfa_SECURE_BOOT_defconfig   | 2 +-
 configs/ls1028aqds_tfa_defconfig   | 2 +-
 configs/ls1028aqds_tfa_lpuart_defconfig| 2 +-
 configs/ls1028ardb_tfa_SECURE_BOOT_defconfig   | 2 +-
 configs/ls1028ardb_tfa_defconfig   | 2 +-
 configs/ls1088aqds_tfa_defconfig   | 2 +-
 configs/ls1088ardb_tfa_SECURE_BOOT_defconfig   | 2 +-
 configs/ls1088ardb_tfa_defconfig   | 2 +-
 configs/ls2088aqds_tfa_defconfig   | 2 +-
 configs/ls2088ardb_tfa_SECURE_BOOT_defconfig   | 2 +-
 configs/ls2088ardb_tfa_defconfig   | 2 +-
 configs/lx2160aqds_tfa_SECURE_BOOT_defconfig   | 2 +-
 configs/lx2160aqds_tfa_defconfig   | 2 +-
 configs/lx2162aqds_tfa_SECURE_BOOT_defconfig   | 2 +-
 configs/lx2162aqds_tfa_defconfig   | 2 +-
 configs/lx2162aqds_tfa_verified_boot_defconfig | 2 +-
 configs/mvebu_puzzle-m801-88f8040_defconfig| 2 +-
 configs/mx53ppd_defconfig  | 2 +-
 configs/octeontx2_96xx_defconfig   | 2 +-
 configs/tuge1_defconfig| 2 +-
 configs/tuxx1_defconfig| 2 +-
 configs/x530_defconfig | 2 +-
 configs/xilinx_versal_net_virt_defconfig   | 2 +-
 configs/xilinx_versal_virt_defconfig   | 2 +-
 configs/xilinx_zynq_virt_defconfig | 2 +-
 configs/xilinx_zynqmp_virt_defconfig   | 2 +-
 drivers/i2c/muxes/Kconfig  | 2 +-
 drivers/i2c/muxes/Makefile | 2 +-
 43 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 594e9a03d90..71676be84b2 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -133,7 +133,7 @@ config TARGET_TURRIS_OMNIA
select BOARD_LATE_INIT
select DM_I2C
select I2C_MUX
-   select I2C_MUX_PCA954x
+   select I2C_MUX_PCA954X
select SPL_DRIVERS_MISC
select SPL_I2C_MUX
select SPL_SYS_MALLOC_SIMPLE
diff --git a/configs/SBx81LIFKW_defconfig b/configs/SBx81LIFKW_defconfig
index e53f2489c5d..a94da5a017a 100644
--- a/configs/SBx81LIFKW_defconfig
+++ b/configs/SBx81LIFKW_defconfig
@@ -47,7 +47,7 @@ CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
 CONFIG_I2C_MUX=y
-CONFIG_I2C_MUX_PCA954x=y
+CONFIG_I2C_MUX_PCA954X=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 # CONFIG_MMC is not set
diff --git a/configs/SBx81LIFXCAT_defconfig b/configs/SBx81LIFXCAT_defconfig
index 80dbbb11c9b..da493c29ffc 100644
--- a/configs/SBx81LIFXCAT_defconfig
+++ b/configs/SBx81LIFXCAT_defconfig
@@ -47,7 +47,7 @@ CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
 CONFIG_I2C_MUX=y
-CONFIG_I2C_MUX_PCA954x=y
+CONFIG_I2C_MUX_PCA954X=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 # CONFIG_MMC is not set
diff --git a/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig 
b/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
index 0a3d710a8b1..0f8978bc02b 100644
--- a/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
+++ b/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
@@ -59,7 +59,7 @@ CONFIG_FPGA_ZYNQMPPL=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_CADENCE=y
 CONFIG_I2C_MUX=y
-CONFIG_I2C_MUX_PCA954x=y
+CONFIG_I2C_MUX_PCA954X=y
 CONFIG_MISC=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_SDHCI=y
diff --git 

[PATCH 15/88] cmd: Add an option to enable the ini command

2023-01-23 Thread Simon Glass
This command has no Kconfig option at present, but seems useful enough to
keep around. Add one.

Signed-off-by: Simon Glass 
---

 cmd/Kconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index b3c1fcaf6e6..8b8619a18f4 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2015,6 +2015,13 @@ config CMD_LED
  with led on/off/togle/blink. Any LED drivers can be controlled with
  this command, e.g. led_gpio.
 
+config CMD_INI
+   bool "ini"
+   help
+ Enable the 'ini' command which allows a .ini file to be parsed and
+ placed into environment variables. Please check the source code for
+ this as there is no documentation.
+
 config CMD_DATE
bool "date"
default y if DM_RTC
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 35/88] m68k: Rename MCF532x

2023-01-23 Thread Simon Glass
CONFIG options must not use lower-case letter. Convert this to upper case.

Signed-off-by: Simon Glass 
---

 arch/m68k/Kconfig |  6 +++---
 arch/m68k/Makefile|  2 +-
 arch/m68k/cpu/mcf532x/cpu.c   |  2 +-
 arch/m68k/cpu/mcf532x/cpu_init.c  |  4 ++--
 arch/m68k/cpu/mcf532x/speed.c | 16 
 arch/m68k/include/asm/cache.h |  2 +-
 arch/m68k/include/asm/coldfire/skha.h |  2 +-
 board/freescale/m5373evb/README   |  2 +-
 env/Kconfig   |  2 +-
 9 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index af5540f14a4..6781ba28c7a 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -38,7 +38,7 @@ config MCF5301X
 select DM_SERIAL
bool
 
-config MCF532x
+config MCF532X
select OF_CONTROL
select DM
 select DM_SERIAL
@@ -99,11 +99,11 @@ config M53015
 
 config M5329
bool
-   select MCF532x
+   select MCF532X
 
 config M5373
bool
-   select MCF532x
+   select MCF532X
select MCF537x
 
 config M54418
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index 21e5337d309..cf4562c55f1 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -15,7 +15,7 @@ cpuflags-$(CONFIG_M5275)  := -mcpu=5275
 cpuflags-$(CONFIG_M5282)   := -mcpu=5282
 cpuflags-$(CONFIG_M5307)   := -mcpu=5307
 cpuflags-$(CONFIG_MCF5301X):= -mcpu=53015 -fPIC
-cpuflags-$(CONFIG_MCF532x) := -mcpu=5329 -fPIC
+cpuflags-$(CONFIG_MCF532X) := -mcpu=5329 -fPIC
 cpuflags-$(CONFIG_MCF5441x):= -mcpu=54418 -fPIC
 
 PLATFORM_CPPFLAGS += $(cpuflags-y)
diff --git a/arch/m68k/cpu/mcf532x/cpu.c b/arch/m68k/cpu/mcf532x/cpu.c
index 96a9a422f3a..108f3cae6df 100644
--- a/arch/m68k/cpu/mcf532x/cpu.c
+++ b/arch/m68k/cpu/mcf532x/cpu.c
@@ -63,7 +63,7 @@ int print_cpuinfo(void)
id = 53013;
break;
 #endif
-#ifdef CONFIG_MCF532x
+#ifdef CONFIG_MCF532X
case 0x54:
id = 5329;
break;
diff --git a/arch/m68k/cpu/mcf532x/cpu_init.c b/arch/m68k/cpu/mcf532x/cpu_init.c
index c12cb310e62..2ddb5b35e23 100644
--- a/arch/m68k/cpu/mcf532x/cpu_init.c
+++ b/arch/m68k/cpu/mcf532x/cpu_init.c
@@ -209,7 +209,7 @@ int fecpin_setclear(fec_info_t *info, int setclear)
 #endif /* CONFIG_CMD_NET */
 #endif /* CONFIG_MCF5301X */
 
-#ifdef CONFIG_MCF532x
+#ifdef CONFIG_MCF532X
 void cpu_init_f(void)
 {
scm1_t *scm1 = (scm1_t *) MMAP_SCM1;
@@ -355,4 +355,4 @@ int fecpin_setclear(fec_info_t *info, int setclear)
return 0;
 }
 #endif
-#endif /* CONFIG_MCF532x */
+#endif /* CONFIG_MCF532X */
diff --git a/arch/m68k/cpu/mcf532x/speed.c b/arch/m68k/cpu/mcf532x/speed.c
index 24b2f937aeb..a326535561d 100644
--- a/arch/m68k/cpu/mcf532x/speed.c
+++ b/arch/m68k/cpu/mcf532x/speed.c
@@ -35,7 +35,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define DEFAULT_LPD(0) /* Divider (not encoded) */
 #endif
 
-#ifdef CONFIG_MCF532x
+#ifdef CONFIG_MCF532X
 #define FREF   16000   /* KHz */
 #define MAX_MFD135 /* Multiplier */
 #define MIN_MFD88  /* Multiplier */
@@ -61,7 +61,7 @@ int get_sys_clock(void)
 #ifdef CONFIG_MCF5301X
return (FREF / (3 * (1 << divider)));
 #endif
-#ifdef CONFIG_MCF532x
+#ifdef CONFIG_MCF532X
return (FREF / (2 << divider));
 #endif
} else {
@@ -72,7 +72,7 @@ int get_sys_clock(void)
 
return (((FREF * pfdr) / refdiv) / busdiv);
 #endif
-#ifdef CONFIG_MCF532x
+#ifdef CONFIG_MCF532X
return (FREF * in_8(&pll->pfdr)) / (BUSDIV * 4);
 #endif
}
@@ -139,7 +139,7 @@ int clock_exit_limp(void)
  */
 int clock_pll(int fsys, int flags)
 {
-#ifdef CONFIG_MCF532x
+#ifdef CONFIG_MCF532X
u32 *sdram_workaround = (u32 *)(MMAP_SDRAM + 0x80);
 #endif
sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
@@ -157,7 +157,7 @@ int clock_pll(int fsys, int flags)
 
return (fref * mfd) / busdiv;
 #endif
-#ifdef CONFIG_MCF532x
+#ifdef CONFIG_MCF532X
mfd = in_8(&pll->pfdr);
 
return (fref * mfd / (BUSDIV * 4));
@@ -184,7 +184,7 @@ int clock_pll(int fsys, int flags)
/* Determine the output frequency for selected values */
fout = ((fref * mfd) / BUSDIV);
 #endif
-#ifdef CONFIG_MCF532x
+#ifdef CONFIG_MCF532X
mfd = (4 * BUSDIV * temp) / 100;
 
/* Determine the output frequency for selected values */
@@ -219,7 +219,7 @@ int clock_pll(int fsys, int flags)
clrbits_be32(&pll->pcr, ~PLL_PCR_FBDIV_UNMASK);
setbits_be32(&pll->pcr, PLL_PCR_FBDIV(mfd - 1));
 #endif
-#ifdef CONFIG_MCF532x
+#ifdef CONFIG_MCF532X
/* Reprogram PLL for desired fsys */
out_8(&pll->podr,
PLL_PODR_CPUDIV(BUSDIV / 3) | PLL_PODR_BUSDIV(BUSDIV));
@@ -234,7 +234,7 @@ int clock_pll(int 

[PATCH 26/88] freescale: Drop unused pixis code

2023-01-23 Thread Simon Glass
Drop this unused code.

Signed-off-by: Simon Glass 
---

 board/freescale/common/Makefile |   1 -
 board/freescale/common/pixis.c  | 470 
 board/freescale/common/pixis.h  |  54 
 3 files changed, 525 deletions(-)
 delete mode 100644 board/freescale/common/pixis.c
 delete mode 100644 board/freescale/common/pixis.h

diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index cc1371867d8..fc51d6d3e18 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -29,7 +29,6 @@ endif
 obj-$(CONFIG_FSL_CADMUS)   += cadmus.o
 obj-$(CONFIG_FSL_VIA)  += cds_via.o
 obj-$(CONFIG_FMAN_ENET)+= fman.o
-obj-$(CONFIG_FSL_PIXIS)+= pixis.o
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_FSL_NGPIXIS)  += ngpixis.o
 endif
diff --git a/board/freescale/common/pixis.c b/board/freescale/common/pixis.c
deleted file mode 100644
index 7096b107e54..000
--- a/board/freescale/common/pixis.c
+++ /dev/null
@@ -1,470 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright 2006,2010 Freescale Semiconductor
- * Jeff Brown
- * Srikanth Srinivasan (srikanth.sriniva...@freescale.com)
- */
-
-#include 
-#include 
-#include 
-
-#define pixis_base (u8 *)PIXIS_BASE
-
-/*
- * Simple board reset.
- */
-void pixis_reset(void)
-{
-   out_8(pixis_base + PIXIS_RST, 0);
-
-   while (1);
-}
-
-/*
- * Per table 27, page 58 of MPC8641HPCN spec.
- */
-static int set_px_sysclk(unsigned long sysclk)
-{
-   u8 sysclk_s, sysclk_r, sysclk_v, vclkh, vclkl, sysclk_aux;
-
-   switch (sysclk) {
-   case 33:
-   sysclk_s = 0x04;
-   sysclk_r = 0x04;
-   sysclk_v = 0x07;
-   sysclk_aux = 0x00;
-   break;
-   case 40:
-   sysclk_s = 0x01;
-   sysclk_r = 0x1F;
-   sysclk_v = 0x20;
-   sysclk_aux = 0x01;
-   break;
-   case 50:
-   sysclk_s = 0x01;
-   sysclk_r = 0x1F;
-   sysclk_v = 0x2A;
-   sysclk_aux = 0x02;
-   break;
-   case 66:
-   sysclk_s = 0x01;
-   sysclk_r = 0x04;
-   sysclk_v = 0x04;
-   sysclk_aux = 0x03;
-   break;
-   case 83:
-   sysclk_s = 0x01;
-   sysclk_r = 0x1F;
-   sysclk_v = 0x4B;
-   sysclk_aux = 0x04;
-   break;
-   case 100:
-   sysclk_s = 0x01;
-   sysclk_r = 0x1F;
-   sysclk_v = 0x5C;
-   sysclk_aux = 0x05;
-   break;
-   case 134:
-   sysclk_s = 0x06;
-   sysclk_r = 0x1F;
-   sysclk_v = 0x3B;
-   sysclk_aux = 0x06;
-   break;
-   case 166:
-   sysclk_s = 0x06;
-   sysclk_r = 0x1F;
-   sysclk_v = 0x4B;
-   sysclk_aux = 0x07;
-   break;
-   default:
-   printf("Unsupported SYSCLK frequency.\n");
-   return 0;
-   }
-
-   vclkh = (sysclk_s << 5) | sysclk_r;
-   vclkl = sysclk_v;
-
-   out_8(pixis_base + PIXIS_VCLKH, vclkh);
-   out_8(pixis_base + PIXIS_VCLKL, vclkl);
-
-   out_8(pixis_base + PIXIS_AUX, sysclk_aux);
-
-   return 1;
-}
-
-/* Set the CFG_SYSPLL bits
- *
- * This only has effect if PX_VCFGEN0[SYSPLL]=1, which is true if
- * read_from_px_regs() is called.
- */
-static int set_px_mpxpll(unsigned long mpxpll)
-{
-   switch (mpxpll) {
-   case 2:
-   case 4:
-   case 6:
-   case 8:
-   case 10:
-   case 12:
-   case 14:
-   case 16:
-   clrsetbits_8(pixis_base + PIXIS_VSPEED1, 0x1F, mpxpll);
-   return 1;
-   }
-
-   printf("Unsupported MPXPLL ratio.\n");
-   return 0;
-}
-
-static int set_px_corepll(unsigned long corepll)
-{
-   u8 val;
-
-   switch (corepll) {
-   case 20:
-   val = 0x08;
-   break;
-   case 25:
-   val = 0x0C;
-   break;
-   case 30:
-   val = 0x10;
-   break;
-   case 35:
-   val = 0x1C;
-   break;
-   case 40:
-   val = 0x14;
-   break;
-   case 45:
-   val = 0x0E;
-   break;
-   default:
-   printf("Unsupported COREPLL ratio.\n");
-   return 0;
-   }
-
-   clrsetbits_8(pixis_base + PIXIS_VSPEED0, 0x1F, val);
-   return 1;
-}
-
-#ifndef CFG_SYS_PIXIS_VCFGEN0_ENABLE
-#define CFG_SYS_PIXIS_VCFGEN0_ENABLE   0x1C
-#endif
-
-/* Tell the PIXIS where to find the COREPLL, MPXPLL, SYSCLK values
- *
- * The PIXIS can be programmed to look at either the on-board dip switches
- * or various other PIXIS registers to determine the values for COREPLL,
- * MPXPLL, and SYSCLK.
- *
- * CFG_SYS_PIXIS_VCFGEN0_ENABLE is the value to write to the PIXI

[PATCH 09/88] sandbox: Drop reference to CONFIG_ARCH_DEVICE_TREE

2023-01-23 Thread Simon Glass
This is not used anywhere. Drop it.

Signed-off-by: Simon Glass 
---

 arch/sandbox/config.mk | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk
index 1284ef390b5..2d184c5f652 100644
--- a/arch/sandbox/config.mk
+++ b/arch/sandbox/config.mk
@@ -44,8 +44,6 @@ cmd_u-boot-spl = (cd $(obj) && $(CC) -o $(SPL_BIN) -Wl,-T 
u-boot-spl.lds \
-Wl,--no-whole-archive \
$(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot-spl.map -Wl,--gc-sections)
 
-CONFIG_ARCH_DEVICE_TREE := sandbox
-
 ifeq ($(HOST_ARCH),$(HOST_ARCH_X86_64))
 EFI_LDS := ${SRCDIR}/../../../arch/x86/lib/elf_x86_64_efi.lds
 EFI_TARGET := --target=efi-app-x86_64
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 07/88] Makefile: Drop CONFIG_AIS_CONFIG_FILE

2023-01-23 Thread Simon Glass
This is not defined anywhere. Drop it.

Signed-off-by: Simon Glass 
---

 Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index eb354c045c0..da395274225 100644
--- a/Makefile
+++ b/Makefile
@@ -1527,8 +1527,7 @@ MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e 
$(CONFIG_TEXT_BASE)
 u-boot.ubl: u-boot-with-spl.bin FORCE
$(call if_changed,mkimage)
 
-MKIMAGEFLAGS_u-boot-spl.ais = -s -n $(if $(CONFIG_AIS_CONFIG_FILE), \
-   $(srctree)/$(CONFIG_AIS_CONFIG_FILE:"%"=%),"/dev/null") \
+MKIMAGEFLAGS_u-boot-spl.ais = -s -n "/dev/null" \
-T aisimage -e $(CONFIG_SPL_TEXT_BASE)
 spl/u-boot-spl.ais: spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 17/88] Correct CONFIG_CONTROLCENTERDC

2023-01-23 Thread Simon Glass
This option does not exist but presumably means to point to
CONFIG_TARGET_CONTROLCENTERDC. Fix it.

Signed-off-by: Simon Glass 
---

 board/gdsys/common/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile
index dd6d5e69de5..553e2ca50ed 100644
--- a/board/gdsys/common/Makefile
+++ b/board/gdsys/common/Makefile
@@ -5,7 +5,7 @@
 
 obj-$(CONFIG_SYS_FPGA_COMMON) += fpga.o
 obj-$(CONFIG_CMD_IOLOOP) += cmd_ioloop.o
-obj-$(CONFIG_CONTROLCENTERD) += dp501.o
+obj-$(CONFIG_TARGET_CONTROLCENTERDC) += dp501.o
 obj-$(CONFIG_TARGET_GAZERBEAM) += osd.o ihs_mdio.o ioep-fpga.o
 
 ifdef CONFIG_OSD
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 14/88] rockchip: Correct a reference to CONFIG_BOOT_MODE_REG

2023-01-23 Thread Simon Glass
This option does not exist and should refer to
CONFIG_ROCKCHIP_BOOT_MODE_REG instead. Fix it.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-rockchip/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index 32138fa723f..e3d4a8b42e4 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -18,7 +18,7 @@ obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
 
 # Always include boot_mode.o, as we bypass it (i.e. turn it off)
-# inside of boot_mode.c when CONFIG_BOOT_MODE_REG is 0.  This way,
+# inside of boot_mode.c when CONFIG_ROCKCHIP_BOOT_MODE_REG is 0.  This way,
 # we can have the preprocessor correctly recognise both 0x0 and 0
 # meaning "turn it off".
 obj-y += boot_mode.o
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 32/88] video: Drop unused lg4573 driver

2023-01-23 Thread Simon Glass
This is not used since this commit:

   3cf02f5ffa4 imx6: remove not longer supported aristainetos boards

Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 drivers/video/Makefile |   1 -
 drivers/video/lg4573.c | 331 -
 2 files changed, 332 deletions(-)
 delete mode 100644 drivers/video/lg4573.c

diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 40a871d638e..12b68cdd068 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -30,7 +30,6 @@ obj-${CONFIG_VIDEO_TEGRA124} += tegra124/
 obj-$(CONFIG_ATMEL_HLCD) += atmel_hlcdfb.o
 obj-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
 obj-$(CONFIG_IHS_VIDEO_OUT) += ihs_video_out.o
-obj-$(CONFIG_LG4573) += lg4573.o
 obj-$(CONFIG_LOGICORE_DP_TX) += logicore_dp_tx.o
 obj-$(CONFIG_NXP_TDA19988) += tda19988.o
 obj-$(CONFIG_OSD) += video_osd-uclass.o
diff --git a/drivers/video/lg4573.c b/drivers/video/lg4573.c
deleted file mode 100644
index dd87fc461b9..000
--- a/drivers/video/lg4573.c
+++ /dev/null
@@ -1,331 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * LCD: LG4573, TFT 4.3", 480x800, RGB24
- * LCD initialization via SPI
- *
- */
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define PWR_ON_DELAY_MSECS  120
-
-static int lb043wv_spi_write_u16(struct spi_slave *slave, u16 val)
-{
-   unsigned short buf16 = htons(val);
-   int ret = 0;
-
-   ret = spi_xfer(slave, 16, &buf16, NULL,
-  SPI_XFER_BEGIN | SPI_XFER_END);
-   if (ret)
-   debug("%s: Failed to send: %d\n", __func__, ret);
-
-   return ret;
-}
-
-static void lb043wv_spi_write_u16_array(struct spi_slave *slave, u16 *buff,
-   int size)
-{
-   int i;
-
-   for (i = 0; i < size; i++)
-   lb043wv_spi_write_u16(slave, buff[i]);
-}
-
-static void lb043wv_display_mode_settings(struct spi_slave *slave)
-{
-   static u16 display_mode_settings[] = {
- 0x703A,
- 0x7270,
- 0x70B1,
- 0x7208,
- 0x723B,
- 0x720F,
- 0x70B2,
- 0x7200,
- 0x72C8,
- 0x70B3,
- 0x7200,
- 0x70B4,
- 0x7200,
- 0x70B5,
- 0x7242,
- 0x7210,
- 0x7210,
- 0x7200,
- 0x7220,
- 0x70B6,
- 0x720B,
- 0x720F,
- 0x723C,
- 0x7213,
- 0x7213,
- 0x72E8,
- 0x70B7,
- 0x7246,
- 0x7206,
- 0x720C,
- 0x7200,
- 0x7200,
-   };
-
-   debug("transfer display mode settings\n");
-   lb043wv_spi_write_u16_array(slave, display_mode_settings,
-   ARRAY_SIZE(display_mode_settings));
-}
-
-static void lb043wv_power_settings(struct spi_slave *slave)
-{
-   static u16 power_settings[] = {
- 0x70C0,
- 0x7201,
- 0x7211,
- 0x70C3,
- 0x7207,
- 0x7203,
- 0x7204,
- 0x7204,
- 0x7204,
- 0x70C4,
- 0x7212,
- 0x7224,
- 0x7218,
- 0x7218,
- 0x7202,
- 0x7249,
- 0x70C5,
- 0x726F,
- 0x70C6,
- 0x7241,
- 0x7263,
-   };
-
-   debug("transfer power settings\n");
-   lb043wv_spi_write_u16_array(slave, power_settings,
-   ARRAY_SIZE(power_settings));
-}
-
-static void lb043wv_gamma_settings(struct spi_slave *slave)
-{
-   static u16 gamma_settings[] = {
- 0x70D0,
- 0x7203,
- 0x7207,
- 0x7273,
- 0x7235,
- 0x7200,
- 0x7201,
- 0x7220,
- 0x7200,
- 0x7203,
- 0x70D1,
- 0x7203,
- 0x7207,
- 0x7273,
- 0x7235,
- 0x7200,
- 0x7201,
- 0x7220,
- 0x7200,
- 0x7203,
- 0x70D2,
- 0x7203,
- 0x7207,
- 0x7273,
- 0x7235,
- 0x7200,
- 0x7201,
- 0x7220,
- 0x7200,
- 0x7203,
- 0x70D3,
- 0x7203,
- 0x7207,
- 0x7273,
- 0x7235,
- 0x7200,
- 0x7201,
- 0x7220,
- 0x7200,
- 0x7203,
- 0x70D4,
- 0x7203,
- 0x7207,
- 0x7273,
- 0x7235,
- 0x7200,
- 0x7201,
- 0x7220,
- 0x7200,
- 0x7203,
- 0x70D5,
- 0x7203,
- 0x7207,
- 0x7273,
- 0x7235,
- 0x7200,
- 0x7201,
- 0x7220,
- 0x7200,
- 0x7203,
-   };
-
-   debug("transfer gamma settings\n");
-   lb043wv_spi_write_u16_array(slave, gamma_settings,
-   ARRAY_SIZE(gamma_settings));
-}
-
-static void lb043wv_display_on(struct spi_slave *slave)
-{
-   static u16 sleep_out = 0x7011;
-   static u16 di

[PATCH 16/88] cmd: Drop mfsl command

2023-01-23 Thread Simon Glass
This is not used anywhere. Drop it.

Signed-off-by: Simon Glass 
---

 cmd/Makefile |   1 -
 cmd/mfsl.c   | 387 ---
 2 files changed, 388 deletions(-)
 delete mode 100644 cmd/mfsl.c

diff --git a/cmd/Makefile b/cmd/Makefile
index 0b6a96c1d91..4adc7530a0a 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -108,7 +108,6 @@ obj-$(CONFIG_ID_EEPROM) += mac.o
 obj-$(CONFIG_CMD_MD5SUM) += md5sum.o
 obj-$(CONFIG_CMD_MEMORY) += mem.o
 obj-$(CONFIG_CMD_IO) += io.o
-obj-$(CONFIG_CMD_MFSL) += mfsl.o
 obj-$(CONFIG_CMD_MII) += mii.o
 obj-$(CONFIG_CMD_MISC) += misc.o
 obj-$(CONFIG_CMD_MDIO) += mdio.o
diff --git a/cmd/mfsl.c b/cmd/mfsl.c
deleted file mode 100644
index 0c78720ec46..000
--- a/cmd/mfsl.c
+++ /dev/null
@@ -1,387 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2007 Michal Simek
- *
- * Michal  SIMEK 
- */
-
-/*
- * Microblaze FSL support
- */
-
-#include 
-#include 
-#include 
-#include 
-
-int do_frd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
-{
-   unsigned int fslnum;
-   unsigned int num;
-   unsigned int blocking;
-
-   if (argc < 2)
-   return CMD_RET_USAGE;
-
-   fslnum = (unsigned int)hextoul(argv[1], NULL);
-   blocking = (unsigned int)hextoul(argv[2], NULL);
-   if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER) {
-   puts ("Bad number of FSL\n");
-   return CMD_RET_USAGE;
-   }
-
-   switch (fslnum) {
-#if (XILINX_FSL_NUMBER > 0)
-   case 0:
-   switch (blocking) {
-   case 0: NGET (num, 0);
-   break;
-   case 1: NCGET (num, 0);
-   break;
-   case 2: GET (num, 0);
-   break;
-   case 3: CGET (num, 0);
-   break;
-   default:
-   return 2;
-   }
-   break;
-#endif
-#if (XILINX_FSL_NUMBER > 1)
-   case 1:
-   switch (blocking) {
-   case 0: NGET (num, 1);
-   break;
-   case 1: NCGET (num, 1);
-   break;
-   case 2: GET (num, 1);
-   break;
-   case 3: CGET (num, 1);
-   break;
-   default:
-   return 2;
-   }
-   break;
-#endif
-#if (XILINX_FSL_NUMBER > 2)
-   case 2:
-   switch (blocking) {
-   case 0: NGET (num, 2);
-   break;
-   case 1: NCGET (num, 2);
-   break;
-   case 2: GET (num, 2);
-   break;
-   case 3: CGET (num, 2);
-   break;
-   default:
-   return 2;
-   }
-   break;
-#endif
-#if (XILINX_FSL_NUMBER > 3)
-   case 3:
-   switch (blocking) {
-   case 0: NGET (num, 3);
-   break;
-   case 1: NCGET (num, 3);
-   break;
-   case 2: GET (num, 3);
-   break;
-   case 3: CGET (num, 3);
-   break;
-   default:
-   return 2;
-   }
-   break;
-#endif
-#if (XILINX_FSL_NUMBER > 4)
-   case 4:
-   switch (blocking) {
-   case 0: NGET (num, 4);
-   break;
-   case 1: NCGET (num, 4);
-   break;
-   case 2: GET (num, 4);
-   break;
-   case 3: CGET (num, 4);
-   break;
-   default:
-   return 2;
-   }
-   break;
-#endif
-#if (XILINX_FSL_NUMBER > 5)
-   case 5:
-   switch (blocking) {
-   case 0: NGET (num, 5);
-   break;
-   case 1: NCGET (num, 5);
-   break;
-   case 2: GET (num, 5);
-   break;
-   case 3: CGET (num, 5);
-   break;
-   default:
-   return 2;
-   }
-   break;
-#endif
-#if (XILINX_FSL_NUMBER > 6)
-   case 6:
-   switch (blocking) {
-   case 0: NGET (num, 6);
-   break;
-   case 1: NCGET (num, 6);
-   break;
-   case 2: GET (num, 6);
-   break;
-   case 3: CGET (num, 6);
-   break;
-   default:
-   return 2;
-   }
-   break;
-#endif
-#if (XILINX_FSL_NUMBER > 7)
-   case 7:
-   switch (blocking) {
-   case 0: NGET (num, 7);
-   break;
-   case 1: NCGET (num, 7);
-   break;
-  

[PATCH 59/88] power: Drop unused muic_max8997 driver

2023-01-23 Thread Simon Glass
This is not used. Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 drivers/power/pmic/Makefile   |  1 -
 drivers/power/pmic/muic_max8997.c | 74 ---
 2 files changed, 75 deletions(-)
 delete mode 100644 drivers/power/pmic/muic_max8997.c

diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
index c3180c58208..0b3b3d62d0e 100644
--- a/drivers/power/pmic/Makefile
+++ b/drivers/power/pmic/Makefile
@@ -37,7 +37,6 @@ obj-$(CONFIG_POWER_TPS65218) += pmic_tps65218.o
 
 ifeq ($(CONFIG_$(SPL_)POWER_LEGACY),y)
 obj-$(CONFIG_POWER_LTC3676) += pmic_ltc3676.o
-obj-$(CONFIG_POWER_MUIC_MAX8997) += muic_max8997.o
 obj-$(CONFIG_POWER_PCA9450) += pmic_pca9450.o
 obj-$(CONFIG_POWER_PFUZE100) += pmic_pfuze100.o
 obj-$(CONFIG_POWER_PFUZE3000) += pmic_pfuze3000.o
diff --git a/drivers/power/pmic/muic_max8997.c 
b/drivers/power/pmic/muic_max8997.c
deleted file mode 100644
index 969ce902395..000
--- a/drivers/power/pmic/muic_max8997.c
+++ /dev/null
@@ -1,74 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- *  Copyright (C) 2012 Samsung Electronics
- *  Lukasz Majewski 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static int power_chrg_get_type(struct pmic *p)
-{
-   unsigned int val;
-   unsigned char charge_type, charger;
-
-   if (pmic_probe(p))
-   return CHARGER_NO;
-
-   pmic_reg_read(p, MAX8997_MUIC_STATUS2, &val);
-   charge_type = val & MAX8997_MUIC_CHG_MASK;
-
-   switch (charge_type) {
-   case MAX8997_MUIC_CHG_NO:
-   charger = CHARGER_NO;
-   break;
-   case MAX8997_MUIC_CHG_USB:
-   case MAX8997_MUIC_CHG_USB_D:
-   charger = CHARGER_USB;
-   break;
-   case MAX8997_MUIC_CHG_TA:
-   case MAX8997_MUIC_CHG_TA_1A:
-   charger = CHARGER_TA;
-   break;
-   case MAX8997_MUIC_CHG_TA_500:
-   charger = CHARGER_TA_500;
-   break;
-   default:
-   charger = CHARGER_UNKNOWN;
-   break;
-   }
-
-   return charger;
-}
-
-static struct power_chrg power_chrg_muic_ops = {
-   .chrg_type = power_chrg_get_type,
-};
-
-int power_muic_init(unsigned int bus)
-{
-   static const char name[] = "MAX8997_MUIC";
-   struct pmic *p = pmic_alloc();
-
-   if (!p) {
-   printf("%s: POWER allocation error!\n", __func__);
-   return -ENOMEM;
-   }
-
-   debug("Board Micro USB Interface Controller init\n");
-
-   p->name = name;
-   p->interface = PMIC_I2C;
-   p->number_of_regs = MUIC_NUM_OF_REGS;
-   p->hw.i2c.addr = MAX8997_MUIC_I2C_ADDR;
-   p->hw.i2c.tx_num = 1;
-   p->bus = bus;
-
-   p->chrg = &power_chrg_muic_ops;
-   return 0;
-}
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 06/88] gpio: Drop adi_gpio2

2023-01-23 Thread Simon Glass
Drop this unused driver.

Signed-off-by: Simon Glass 
---

 drivers/gpio/Makefile|   1 -
 drivers/gpio/adi_gpio2.c | 425 ---
 2 files changed, 426 deletions(-)
 delete mode 100644 drivers/gpio/adi_gpio2.c

diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 7235714fcc0..57603645c1c 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -47,7 +47,6 @@ obj-$(CONFIG_SH_GPIO_PFC) += sh_pfc.o
 obj-$(CONFIG_OMAP_GPIO)+= omap_gpio.o
 obj-$(CONFIG_BCM2835_GPIO) += bcm2835_gpio.o
 obj-$(CONFIG_XILINX_GPIO)  += xilinx_gpio.o
-obj-$(CONFIG_ADI_GPIO2)+= adi_gpio2.o
 obj-$(CONFIG_TCA642X)  += tca642x.o
 obj-$(CONFIG_SUNXI_GPIO)   += sunxi_gpio.o
 obj-$(CONFIG_LPC32XX_GPIO) += lpc32xx_gpio.o
diff --git a/drivers/gpio/adi_gpio2.c b/drivers/gpio/adi_gpio2.c
deleted file mode 100644
index d0849c85c3b..000
--- a/drivers/gpio/adi_gpio2.c
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
- * ADI GPIO2 Abstraction Layer
- * Support BF54x, BF60x and future processors.
- *
- * Copyright 2008-2013 Analog Devices Inc.
- *
- * Licensed under the GPL-2 or later
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define RESOURCE_LABEL_SIZE16
-
-static struct str_ident {
-   char name[RESOURCE_LABEL_SIZE];
-} str_ident[MAX_RESOURCES];
-
-static void gpio_error(unsigned gpio)
-{
-   printf("adi_gpio2: GPIO %d wasn't requested!\n", gpio);
-}
-
-static void set_label(unsigned short ident, const char *label)
-{
-   if (label) {
-   strncpy(str_ident[ident].name, label,
-   RESOURCE_LABEL_SIZE);
-   str_ident[ident].name[RESOURCE_LABEL_SIZE - 1] = 0;
-   }
-}
-
-static char *get_label(unsigned short ident)
-{
-   return *str_ident[ident].name ? str_ident[ident].name : "UNKNOWN";
-}
-
-static int cmp_label(unsigned short ident, const char *label)
-{
-   if (label == NULL)
-   printf("adi_gpio2: please provide none-null label\n");
-
-   if (label)
-   return strcmp(str_ident[ident].name, label);
-   else
-   return -EINVAL;
-}
-
-#define map_entry(m, i)  reserved_##m##_map[gpio_bank(i)]
-#define is_reserved(m, i, e) (map_entry(m, i) & gpio_bit(i))
-#define reserve(m, i)(map_entry(m, i) |= gpio_bit(i))
-#define unreserve(m, i)  (map_entry(m, i) &= ~gpio_bit(i))
-#define DECLARE_RESERVED_MAP(m, c) unsigned short reserved_##m##_map[c]
-
-static DECLARE_RESERVED_MAP(gpio, GPIO_BANK_NUM);
-static DECLARE_RESERVED_MAP(peri, gpio_bank(MAX_RESOURCES));
-
-inline int check_gpio(unsigned gpio)
-{
-#if defined(CONFIG_BF54x)
-   if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 ||
-   gpio == GPIO_PH14 || gpio == GPIO_PH15 ||
-   gpio == GPIO_PJ14 || gpio == GPIO_PJ15)
-   return -EINVAL;
-#endif
-   if (gpio >= MAX_GPIOS)
-   return -EINVAL;
-   return 0;
-}
-
-static void port_setup(unsigned gpio, unsigned short usage)
-{
-#if defined(CONFIG_BF54x)
-   if (usage == GPIO_USAGE)
-   gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
-   else
-   gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio);
-#else
-   if (usage == GPIO_USAGE)
-   gpio_array[gpio_bank(gpio)]->port_fer_clear = gpio_bit(gpio);
-   else
-   gpio_array[gpio_bank(gpio)]->port_fer_set = gpio_bit(gpio);
-#endif
-}
-
-inline void portmux_setup(unsigned short per)
-{
-   u32 pmux;
-   u16 ident = P_IDENT(per);
-   u16 function = P_FUNCT2MUX(per);
-
-   pmux = gpio_array[gpio_bank(ident)]->port_mux;
-
-   pmux &= ~(0x3 << (2 * gpio_sub_n(ident)));
-   pmux |= (function & 0x3) << (2 * gpio_sub_n(ident));
-
-   gpio_array[gpio_bank(ident)]->port_mux = pmux;
-}
-
-inline u16 get_portmux(unsigned short per)
-{
-   u32 pmux;
-   u16 ident = P_IDENT(per);
-
-   pmux = gpio_array[gpio_bank(ident)]->port_mux;
-
-   return pmux >> (2 * gpio_sub_n(ident)) & 0x3;
-}
-
-unsigned short get_gpio_dir(unsigned gpio)
-{
-   return 0x01 &
-   (gpio_array[gpio_bank(gpio)]->dir_clear >> gpio_sub_n(gpio));
-}
-
-/***
-*
-* FUNCTIONS:   Peripheral Resource Allocation
-*  and PortMux Setup
-*
-* INPUTS/OUTPUTS:
-* per  Peripheral Identifier
-* labelString
-*
-* DESCRIPTION: Peripheral Resource Allocation and Setup API
-**/
-
-int peripheral_request(unsigned short per, const char *label)
-{
-   unsigned short ident = P_IDENT(per);
-
-   /*
-* Don't cares are pins with only one dedicated function
-*/
-
-   if (per & P_DONTCARE)
-   return 0;
-
-   if (!(per & P_DEFINED))
-   return -EINVAL;
-
-   BUG_ON(ident >= MAX_RESOURCES);
-
-   /* If a pin can be muxed as either GP

Re: [PATCH 29/88] i2c: Rename I2C_MUX_PCA954x

2023-01-23 Thread Chris Packham
Hi Simon

On 24/01/23 10:59, Simon Glass wrote:
> CONFIG options must not use lower-case letter. Convert this to upper case.
>
> Signed-off-by: Simon Glass 
> ---
>
>   configs/SBx81LIFKW_defconfig   | 2 +-
>   configs/SBx81LIFXCAT_defconfig | 2 +-
>   configs/x530_defconfig | 2 +-

For these boards

Reviewed-by: Chris Packham 


Re: [PATCH] test: bootdev: Do not require USB to compile test

2023-01-23 Thread Simon Glass
On Mon, 23 Jan 2023 at 15:07, Linus Walleij  wrote:
>
> This test will block compilation of the entire test suite
> on platforms without USB support. Make the extern
> "usb_started" conditional on USB host or gadget and
> define a dummy flag if neither is enabled.
>
> Cc: Simon Glass 
> Signed-off-by: Linus Walleij 
> ---
>  test/boot/bootdev.c | 4 
>  1 file changed, 4 insertions(+)

Reviewed-by: Simon Glass 


Re: [PATCH 1/1] doc: rework doc/mkeficapsule.1

2023-01-23 Thread Simon Glass
Hi Heinrich,

On Mon, 23 Jan 2023 at 11:50, Heinrich Schuchardt
 wrote:
>
> On 1/23/23 19:42, Simon Glass wrote:
> > Hi Heinrich,
> >
> > On Mon, 23 Jan 2023 at 04:24, Heinrich Schuchardt
> >  wrote:
> >>
> >> * Indicate the location of the directory for EFI capsules.
> >> * Improve the readability.
> >>
> >> Signed-off-by: Heinrich Schuchardt 
> >> ---
> >>   doc/mkeficapsule.1 | 21 +++--
> >>   1 file changed, 11 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/doc/mkeficapsule.1 b/doc/mkeficapsule.1
> >> index 6fb2dd0810..1ca245a10f 100644
> >> --- a/doc/mkeficapsule.1
> >> +++ b/doc/mkeficapsule.1
> >> @@ -11,22 +11,23 @@ mkeficapsule \- Generate EFI capsule file for U-Boot
> >>   .RI [ options ] " " [ image-blob ] " " capsule-file
> >>
> >>   .SH "DESCRIPTION"
> >> +The
> >>   .B mkeficapsule
> >> -command is used to create an EFI capsule file for use with the U-Boot
> >> -EFI capsule update.
> >> -A capsule file may contain various type of firmware blobs which
> >> -are to be applied to the system and must be placed in the specific
> >> -directory on the UEFI system partition.
> >> -An update will be automatically executed at next reboot.
> >> +command is used to create an EFI capsule file to be used by U-Boot for 
> >> firmware
> >> +updates.
> >> +A capsule file may contain various types of firmware blobs which are to be
> >> +applied to the system.
> >> +If a capsule file is placed in the /EFI/CapusuleUpdate directory of the 
> >> EFI
> >> +system partition, U-Boot will try to execute the update at the next 
> >> reboot.
> >>
> >>   Optionally, a capsule file can be signed with a given private key.
> >>   In this case, the update will be authenticated by verifying the signature
> >>   before applying.
> >>
> >> -Additionally, an empty capsule file can be generated for acceptance or
> >> -rejection of firmware images by a governing component like an Operating
> >> -System. The empty capsules do not require an image-blob input file.
> >> -
> >> +Additionally, an empty capsule file can be generated to indicate the 
> >> acceptance
> >> +or rejection of firmware images by a governing component like an operating
> >> +system.
> >> +Empty capsules do not require an image-blob input file.
> >>
> >>   .B mkeficapsule
> >>   takes any type of image files when generating non empty capsules, 
> >> including:
> >> --
> >> 2.38.1
> >>
> >
> > BTW as someone else mentioned, this functionality should be in binman too.
> >
> > Regards,
> > Simon
>
> This program is distributed by Debian/Ubuntu in package u-boot-tools.
> Please, do not remove it.

What are you wanting not to remove?

>
> Binman is not distributed by Debian.

Would that be helpful?

Regards,
Simon


Re: [PATCH v1 1/2] cmd: exit: add continue on key press command

2023-01-23 Thread Simon Glass
On Mon, 23 Jan 2023 at 13:04, Svyatoslav Ryhel  wrote:
>
> This command stops performing script until any
> key is pressed. It is useful for keeping logs
> on screen until user decides to continue.
>
> Co-developed-by: Jonas Schwöbel 
> Signed-off-by: Jonas Schwöbel 
> Signed-off-by: Svyatoslav Ryhel 
> ---
>  cmd/exit.c | 17 +
>  1 file changed, 17 insertions(+)
>

Please add a file in doc/usage/cmd

Also how about a test?

> diff --git a/cmd/exit.c b/cmd/exit.c
> index 7bf241ec73..673b4b6be7 100644
> --- a/cmd/exit.c
> +++ b/cmd/exit.c
> @@ -7,6 +7,17 @@
>  #include 
>  #include 
>
> +static int do_continue(struct cmd_tbl *cmdtp, int flag, int argc,
> +  char *const argv[])
> +{
> +   while (true) {
> +   if (getchar())
> +   break;
> +   }
> +
> +   return 0;
> +}
> +
>  static int do_exit(struct cmd_tbl *cmdtp, int flag, int argc,
>char *const argv[])
>  {
> @@ -19,6 +30,12 @@ static int do_exit(struct cmd_tbl *cmdtp, int flag, int 
> argc,
> return -r - 2;
>  }
>
> +U_BOOT_CMD(
> +   continue,   1,  0,  do_continue,
> +   "continue script on key pressed",
> +   ""
> +);
> +
>  U_BOOT_CMD(
> exit,   2,  1,  do_exit,
> "exit script",
> --
> 2.25.1
>

Regards,
Simon


Re: [PATCH v3 2/6] tpm: Support boot measurements

2023-01-23 Thread Simon Glass
Hi Ilias,

On Mon, 16 Jan 2023 at 03:51, Ilias Apalodimas
 wrote:
>
> Hi Simon,
>
> [...]
>
> > > >>
> > > > [..]
> > > >
> > > >> +static int tcg2_log_init(struct udevice *dev, struct tcg2_event_log 
> > > >> *elog)
> > > >> +{
> > > >> +   struct tcg_efi_spec_id_event *ev;
> > > > We cannot add EFI things to generic TPM code.
> > >
> > >
> > > Ah, this is NOT an EFI thing even though it is named as such. Please see
> > > https://trustedcomputinggroup.org/wp-content/uploads/TCG_ServerManagDomainFWProfile_r1p00_pub.pdf
> > > section 9 and
> > > https://trustedcomputinggroup.org/wp-content/uploads/TCG_PCClient_Specific_Platform_Profile_for_TPM_2p0_1p04_PUBLIC.pdf
> > > section 9
> > >
> > >
> > > Neither of these documents are specific to EFI.
> >
> > OK, then please drop efi_ from the identifiers. It is terribly confusing.
>
> Why?  The terrible confusing part would be trying to read code not
> named after the spec because you don't like EFI.  When looking at code
> that's documented by a spec it's far easier to keep the naming as
> close as possible, so I'd prefer leaving it as is.

Because this is not an EFI spec, is it? What am I missing?

Regards,
Simon


>
> Regards
> /Ilias
> >
> > >
> > >
> > > >
> > > >> +   struct tcg_pcr_event *log;
> > > >> +   u32 event_size;
> > > >> +   u32 count = 0;
> > > >> +   u32 log_size;
> > > >> +   u32 active;
> > > >> +   u32 mask;
> > > >> +   size_t i;
> > > >> +   u16 len;
> > > >> +   int rc;
> > > >> +
> > > >> +   rc = tcg2_get_active_pcr_banks(dev, &active);
> > > >> +   if (rc)
> > > >> +   return rc;
> > > >> +
> > > >> +   event_size = offsetof(struct tcg_efi_spec_id_event, 
> > > >> digest_sizes);
> > > >> +   for (i = 0; i < ARRAY_SIZE(tcg2algos); ++i) {
> > > >> +   mask = tpm2_algorithm_to_mask(tcg2algos[i]);
> > > >> +
> > > >> +   if (!(active & mask))
> > > >> +   continue;
> > > >> +
> > > >> +   switch (tcg2algos[i]) {
> > > >> +   case TPM2_ALG_SHA1:
> > > >> +   case TPM2_ALG_SHA256:
> > > >> +   case TPM2_ALG_SHA384:
> > > >> +   case TPM2_ALG_SHA512:
> > > >> +   count++;
> > > >> +   break;
> > > >> +   default:
> > > >> +   continue;
> > > >> +   }
> > > >> +   }
> > > >> +
> > > >> +   event_size += 1 +
> > > >> +   (sizeof(struct tcg_efi_spec_id_event_algorithm_size) * 
> > > >> count);
> > > >> +   log_size = offsetof(struct tcg_pcr_event, event) + event_size;
> > > >> +
> > > >> +   if (log_size > elog->log_size) {
> > > >> +   printf("%s: log too large: %u > %u\n", __func__, 
> > > >> log_size,
> > > >> +  elog->log_size);
> > > >> +   return -ENOBUFS;
> > > >> +   }
> > > >> +
> > > >> +   log = (struct tcg_pcr_event *)elog->log;
> > > >> +   put_unaligned_le32(0, &log->pcr_index);
> > > >> +   put_unaligned_le32(EV_NO_ACTION, &log->event_type);
> > > >> +   memset(&log->digest, 0, sizeof(log->digest));
> > > >> +   put_unaligned_le32(event_size, &log->event_size);
> > > >> +
> > > >> +   ev = (struct tcg_efi_spec_id_event *)log->event;
> > > >> +   strlcpy((char *)ev->signature, 
> > > >> TCG_EFI_SPEC_ID_EVENT_SIGNATURE_03,
> > > > Same with all of this.
> > > >
> > > >> +   sizeof(ev->signature));
> > > >> +   put_unaligned_le32(0, &ev->platform_class);
> > > >> +   ev->spec_version_minor = 
> > > >> TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_MINOR_TPM2;
> > > >> +   ev->spec_version_major = 
> > > >> TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_MAJOR_TPM2;
> > > >> +   ev->spec_errata = 
> > > >> TCG_EFI_SPEC_ID_EVENT_SPEC_VERSION_ERRATA_TPM2;
> > > > I'm not quite sure what is going on here...is this log in a format
> > > > defined by the EFI spec? What if we are not using EFI? How would a
> > > > different format be used?
> > > >
> > > > Put another way, people using a TPM should not pull in EFI things just
> > > > to do that.
> > >
> > >
> > > Agreed, however the EFI spec is not involved. These specifications and
> > > structures are general to any boot measurement. I would guess EFI was
> > > the first to do this and therefore defined some structures that the TCG
> > > re-used when writing the specs.
> >
> > Regards,
> > Simon


[PATCH 02/88] treewide: Correct invalid Kconfig syntax and warnings

2023-01-23 Thread Simon Glass
In several places a 'select' is used to select a choice, which is not
supported by Kconfig. In other places, the filename for the 'source'
command is not in quites.

Fix these two problems throughout the tree, so that kconfiglib does not
show any more warnings.

Signed-off-by: Simon Glass 
---

 arch/Kconfig  |  4 ++--
 arch/arc/Kconfig  | 14 +++---
 arch/arm/Kconfig  |  6 +++---
 arch/arm/mach-nexell/Kconfig  |  2 +-
 arch/arm/mach-rmobile/Kconfig.64  |  8 
 arch/arm/mach-rockchip/rv1108/Kconfig |  4 ++--
 arch/arm/mach-rockchip/rv1126/Kconfig |  2 +-
 arch/x86/cpu/apollolake/Kconfig   |  2 +-
 board/efi/Kconfig |  4 ++--
 board/openpiton/riscv64/Kconfig   |  2 +-
 board/siemens/iot2050/Kconfig |  2 +-
 board/ti/am62ax/Kconfig   |  4 ++--
 board/ti/am62x/Kconfig|  4 ++--
 board/ti/am64x/Kconfig|  4 ++--
 board/ti/am65x/Kconfig|  4 ++--
 board/ti/j721e/Kconfig|  8 
 board/ti/j721s2/Kconfig   |  4 ++--
 cmd/Kconfig   |  4 ++--
 drivers/clk/Kconfig   | 10 +-
 drivers/crypto/Kconfig|  8 
 drivers/ddr/imx/imx8ulp/Kconfig   |  2 +-
 drivers/pinctrl/intel/Kconfig |  2 +-
 drivers/usb/host/Kconfig  |  2 +-
 lib/Kconfig   | 18 +-
 24 files changed, 62 insertions(+), 62 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index d30676ae817..3b95fbe9b36 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -53,8 +53,8 @@ config ARC
select SUPPORT_OF_CONTROL
select SYS_CACHE_SHIFT_7
select TIMER
-   select SYS_BIG_ENDIAN if CPU_BIG_ENDIAN
-   select SYS_LITTLE_ENDIAN if !CPU_BIG_ENDIAN
+   # select SYS_BIG_ENDIAN if CPU_BIG_ENDIAN
+   # select SYS_LITTLE_ENDIAN if !CPU_BIG_ENDIAN
 
 config ARM
bool "ARM architecture"
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 6ae66bb163c..8c0d1c8a3ee 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -32,35 +32,35 @@ choice
 config CPU_ARC750D
bool "ARC 750D"
depends on ISA_ARCOMPACT
-   select ARC_MMU_V2
+   # select ARC_MMU_V2
help
  Choose this option to build an U-Boot for ARC750D CPU.
 
 config CPU_ARC770D
bool "ARC 770D"
depends on ISA_ARCOMPACT
-   select ARC_MMU_V3
+   # select ARC_MMU_V3
help
  Choose this option to build an U-Boot for ARC770D CPU.
 
 config CPU_ARCEM6
bool "ARC EM6"
depends on ISA_ARCV2
-   select ARC_MMU_ABSENT
+   # select ARC_MMU_ABSENT
help
  Next Generation ARC Core based on ISA-v2 ISA without MMU.
 
 config CPU_ARCHS36
bool "ARC HS36"
depends on ISA_ARCV2
-   select ARC_MMU_ABSENT
+   # select ARC_MMU_ABSENT
help
  Next Generation ARC Core based on ISA-v2 ISA without MMU.
 
 config CPU_ARCHS38
bool "ARC HS38"
depends on ISA_ARCV2
-   select ARC_MMU_V4
+   # select ARC_MMU_V4
help
  Next Generation ARC Core based on ISA-v2 ISA with MMU.
 
@@ -172,14 +172,14 @@ config TARGET_AXS103
 
 config TARGET_EMSDP
bool "Synopsys EM Software Development Platform"
-   select CPU_ARCEM6
+   # select CPU_ARCEM6
 
 config TARGET_HSDK
bool "Support Synopsys HSDK or HSDK-4xD board"
 
 config TARGET_IOT_DEVKIT
bool "Synopsys Brite IoT Development kit"
-   select CPU_ARCEM6
+   # select CPU_ARCEM6
 
 endchoice
 
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c9a44ebc221..b18af584770 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -598,7 +598,7 @@ config ARCH_MVEBU
select SPL_TIMER if SPL
select TIMER if !ARM64
select OF_CONTROL
-   select OF_SEPARATE
+   # select OF_SEPARATE
select SPI
imply CMD_DM
 
@@ -1038,7 +1038,7 @@ config ARCH_SNAPDRAGON
select GPIO_EXTRA_HEADER
select MSM_SMEM
select OF_CONTROL
-   select OF_SEPARATE
+   # select OF_SEPARATE
select SMEM
select SPMI
imply CMD_DM
@@ -1107,7 +1107,7 @@ config ARCH_SUNXI
select GPIO_EXTRA_HEADER
select OF_BOARD_SETUP
select OF_CONTROL
-   select OF_SEPARATE
+   # select OF_SEPARATE
select PINCTRL
select SPECIFY_CONSOLE_INDEX
select SPL_SEPARATE_BSS if SPL
diff --git a/arch/arm/mach-nexell/Kconfig b/arch/arm/mach-nexell/Kconfig
index 16324e15206..fd6c7774f68 100644
--- a/arch/arm/mach-nexell/Kconfig
+++ b/arch/arm/mach-nexell/Kconfig
@@ -4,7 +4,7 @@ config ARCH_S5P4418
bool "Nexell S5P4418 SoC"
select CPU_V7A
select OF_CONTROL
-   select OF_SEPARATE
+   # select OF_SEPARATE
select NX_GPIO
select DM_SERIAL
select PL01X_SERIAL
diff --git a/arch/

[PATCH 65/88] rmobile: Drop CONFIG_SH73A0 and associated code

2023-01-23 Thread Simon Glass
This option does not exist, so the code attached to it is not used. Drop
it.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-rmobile/Makefile|1 -
 arch/arm/mach-rmobile/cpu_info-sh73a0.c   |   43 -
 arch/arm/mach-rmobile/cpu_info.c  |1 -
 arch/arm/mach-rmobile/include/mach/gpio.h |5 +-
 arch/arm/mach-rmobile/include/mach/rmobile.h  |5 +-
 .../mach-rmobile/include/mach/sh73a0-gpio.h   |  553 
 arch/arm/mach-rmobile/include/mach/sh73a0.h   |  289 --
 arch/arm/mach-rmobile/pfc-sh73a0.c| 2807 -
 drivers/i2c/sh_i2c.c  |5 -
 drivers/serial/serial_sh.h|   10 +-
 10 files changed, 4 insertions(+), 3715 deletions(-)
 delete mode 100644 arch/arm/mach-rmobile/cpu_info-sh73a0.c
 delete mode 100644 arch/arm/mach-rmobile/include/mach/sh73a0-gpio.h
 delete mode 100644 arch/arm/mach-rmobile/include/mach/sh73a0.h
 delete mode 100644 arch/arm/mach-rmobile/pfc-sh73a0.c

diff --git a/arch/arm/mach-rmobile/Makefile b/arch/arm/mach-rmobile/Makefile
index 3f77760e50d..5b86221bc25 100644
--- a/arch/arm/mach-rmobile/Makefile
+++ b/arch/arm/mach-rmobile/Makefile
@@ -8,7 +8,6 @@ obj-y += emac.o
 
 obj-$(CONFIG_DISPLAY_BOARDINFO) += board.o
 obj-$(CONFIG_TMU_TIMER) += ../../sh/lib/time.o
-obj-$(CONFIG_SH73A0) += lowlevel_init.o cpu_info-sh73a0.o pfc-sh73a0.o
 obj-$(CONFIG_R8A7740) += lowlevel_init.o cpu_info-r8a7740.o pfc-r8a7740.o
 obj-$(CONFIG_RCAR_GEN2) += lowlevel_init_ca15.o cpu_info-rcar.o
 obj-$(CONFIG_RCAR_GEN3) += lowlevel_init_gen3.o cpu_info-rcar.o memmap-gen3.o
diff --git a/arch/arm/mach-rmobile/cpu_info-sh73a0.c 
b/arch/arm/mach-rmobile/cpu_info-sh73a0.c
deleted file mode 100644
index 0c7ee8acf5a..000
--- a/arch/arm/mach-rmobile/cpu_info-sh73a0.c
+++ /dev/null
@@ -1,43 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2012 Nobuhiro Iwamatsu 
- * (C) Copyright 2012 Renesas Solutions Corp.
- */
-#include 
-#include 
-
-u32 rmobile_get_cpu_type(void)
-{
-   u32 id;
-   u32 type;
-   struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE;
-
-   id = readl(&hpb->cccr);
-   type = (id >> 8) & 0xFF;
-
-   return type;
-}
-
-u32 rmobile_get_cpu_rev_integer(void)
-{
-   u32 id;
-   u32 rev;
-   struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE;
-
-   id = readl(&hpb->cccr);
-   rev = ((id >> 4) & 0xF) + 1;
-
-   return rev;
-}
-
-u32 rmobile_get_cpu_rev_fraction(void)
-{
-   u32 id;
-   u32 rev;
-   struct sh73a0_hpb *hpb = (struct sh73a0_hpb *)HPB_BASE;
-
-   id = readl(&hpb->cccr);
-   rev = id & 0xF;
-
-   return rev;
-}
diff --git a/arch/arm/mach-rmobile/cpu_info.c b/arch/arm/mach-rmobile/cpu_info.c
index bd9e71707f5..246029ac294 100644
--- a/arch/arm/mach-rmobile/cpu_info.c
+++ b/arch/arm/mach-rmobile/cpu_info.c
@@ -62,7 +62,6 @@ static const struct {
u16 cpu_type;
u8 cpu_name[10];
 } rmobile_cpuinfo[] = {
-   { RMOBILE_CPU_TYPE_SH73A0, "SH73A0" },
{ RMOBILE_CPU_TYPE_R8A7740, "R8A7740" },
{ RMOBILE_CPU_TYPE_R8A7790, "R8A7790" },
{ RMOBILE_CPU_TYPE_R8A7791, "R8A7791" },
diff --git a/arch/arm/mach-rmobile/include/mach/gpio.h 
b/arch/arm/mach-rmobile/include/mach/gpio.h
index 6b5e4ed4eb5..150aa46034d 100644
--- a/arch/arm/mach-rmobile/include/mach/gpio.h
+++ b/arch/arm/mach-rmobile/include/mach/gpio.h
@@ -1,10 +1,7 @@
 #ifndef __ASM_ARCH_GPIO_H
 #define __ASM_ARCH_GPIO_H
 
-#if defined(CONFIG_SH73A0)
-#include "sh73a0-gpio.h"
-void sh73a0_pinmux_init(void);
-#elif defined(CONFIG_R8A7740)
+#if defined(CONFIG_R8A7740)
 #include "r8a7740-gpio.h"
 void r8a7740_pinmux_init(void);
 #endif
diff --git a/arch/arm/mach-rmobile/include/mach/rmobile.h 
b/arch/arm/mach-rmobile/include/mach/rmobile.h
index dc6f87631bc..53f9a80ecfe 100644
--- a/arch/arm/mach-rmobile/include/mach/rmobile.h
+++ b/arch/arm/mach-rmobile/include/mach/rmobile.h
@@ -2,9 +2,7 @@
 #define __ASM_ARCH_RMOBILE_H
 
 #if defined(CONFIG_ARCH_RMOBILE)
-#if defined(CONFIG_SH73A0)
-#include 
-#elif defined(CONFIG_R8A7740)
+#if defined(CONFIG_R8A7740)
 #include 
 #elif defined(CONFIG_R8A7790)
 #include 
@@ -25,7 +23,6 @@
 #endif /* CONFIG_ARCH_RMOBILE */
 
 /* PRR CPU IDs */
-#define RMOBILE_CPU_TYPE_SH73A00x37
 #define RMOBILE_CPU_TYPE_R8A7740   0x40
 #define RMOBILE_CPU_TYPE_R8A7790   0x45
 #define RMOBILE_CPU_TYPE_R8A7791   0x47
diff --git a/arch/arm/mach-rmobile/include/mach/sh73a0-gpio.h 
b/arch/arm/mach-rmobile/include/mach/sh73a0-gpio.h
deleted file mode 100644
index 398e2c10913..000
--- a/arch/arm/mach-rmobile/include/mach/sh73a0-gpio.h
+++ /dev/null
@@ -1,553 +0,0 @@
-#ifndef __ASM_SH73A0_H__
-#define __ASM_SH73A0_H__
-
-/* Pin Function Controller:
- * GPIO_FN_xx - GPIO used to select pin function and MSEL switch
- * GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
- */
-enum {
-   /* Hardware manual Table 25-1 (GPIO) */
-   GPIO_PORT0, GPIO_PORT1, GP

[PATCH 40/88] ppc: Rename MPC83xx

2023-01-23 Thread Simon Glass
CONFIG options must not use lower-case letter. Convert this to upper case.

Signed-off-by: Simon Glass 
---

 api/api_platform-powerpc.c |  2 +-
 arch/Kconfig   |  2 +-
 arch/powerpc/Kconfig   |  8 
 arch/powerpc/cpu/Makefile  |  2 +-
 arch/powerpc/cpu/mpc83xx/Kconfig   |  4 ++--
 arch/powerpc/cpu/mpc83xx/cpu.c |  2 +-
 arch/powerpc/cpu/mpc83xx/start.S   |  2 +-
 arch/powerpc/cpu/mpc8xxx/fsl_lbc.c |  2 +-
 arch/powerpc/include/asm/fsl_dma.h |  4 ++--
 arch/powerpc/include/asm/fsl_lbc.h |  2 +-
 arch/powerpc/include/asm/global_data.h |  6 +++---
 arch/powerpc/include/asm/immap_83xx.h  | 14 +++---
 arch/powerpc/include/asm/ppc.h |  6 +++---
 arch/powerpc/include/asm/processor.h   |  4 ++--
 arch/powerpc/lib/bdinfo.c  |  2 +-
 board/freescale/mpc837xerdb/README |  2 +-
 board/keymile/Kconfig  |  4 ++--
 board/keymile/km83xx/Kconfig   |  2 +-
 configs/MPC837XERDB_defconfig  |  2 +-
 configs/gazerbeam_defconfig|  2 +-
 configs/kmcoge5ne_defconfig|  2 +-
 configs/kmeter1_defconfig  |  2 +-
 configs/kmopti2_defconfig  |  2 +-
 configs/kmsupx5_defconfig  |  2 +-
 configs/kmtepr2_defconfig  |  2 +-
 configs/tuge1_defconfig|  2 +-
 configs/tuxx1_defconfig|  2 +-
 drivers/clk/Kconfig|  4 ++--
 drivers/clk/mpc83xx_clk.c  |  4 ++--
 drivers/clk/mpc83xx_clk.h  | 20 ++--
 drivers/cpu/Kconfig|  6 +++---
 drivers/cpu/mpc83xx_cpu.c  | 14 +++---
 drivers/cpu/mpc83xx_cpu.h  |  8 
 drivers/ddr/fsl/Kconfig|  4 ++--
 drivers/ddr/fsl/main.c |  2 +-
 drivers/dma/fsl_dma.c  | 16 
 drivers/gpio/mpc83xx_gpio.c|  2 +-
 drivers/misc/Kconfig   |  4 ++--
 drivers/misc/mpc83xx_serdes.c  |  4 ++--
 drivers/mtd/nand/raw/fsl_elbc_spl.c|  2 +-
 drivers/ram/Kconfig|  2 +-
 drivers/ram/mpc83xx_sdram.c|  2 +-
 drivers/spi/mpc8xxx_spi.c  |  2 +-
 drivers/sysreset/Kconfig   |  4 ++--
 drivers/timer/Kconfig  |  4 ++--
 drivers/timer/mpc83xx_timer.c  |  2 +-
 env/Kconfig|  2 +-
 include/asm-generic/u-boot.h   |  2 +-
 include/configs/MPC837XERDB.h  |  2 +-
 include/linux/immap_qe.h   |  2 +-
 include/serial.h   |  2 +-
 post/Makefile  |  2 +-
 52 files changed, 103 insertions(+), 103 deletions(-)

diff --git a/api/api_platform-powerpc.c b/api/api_platform-powerpc.c
index 847a4a3015b..8503ba274d6 100644
--- a/api/api_platform-powerpc.c
+++ b/api/api_platform-powerpc.c
@@ -31,7 +31,7 @@ int platform_sys_info(struct sys_info *si)
 
 #if defined(CONFIG_MPC8xx) || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
 #define bi_bar bi_immr_base
-#elif defined(CONFIG_MPC83xx)
+#elif defined(CONFIG_MPC83XX)
 #define bi_bar bi_immrbar
 #endif
 
diff --git a/arch/Kconfig b/arch/Kconfig
index 3b95fbe9b36..1d16b6d4e9a 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -370,7 +370,7 @@ config SYS_IMMR
depends on PPC || FSL_LSCH2 || FSL_LSCH3 || ARCH_LS1021A
default 0xFF00 if MPC8xx
default 0xF000 if ARCH_MPC8313
-   default 0xE000 if MPC83xx && !ARCH_MPC8313
+   default 0xE000 if MPC83XX && !ARCH_MPC8313
default 0x0100 if ARCH_LS1021A || FSL_LSCH2 || FSL_LSCH3
default 0xFFE0 if ARCH_P1010 || ARCH_P1011 || ARCH_P1020 || \
  ARCH_P1021 || ARCH_P1024 || ARCH_P1025 || \
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index e0801c25941..eb39a03e997 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -8,8 +8,8 @@ choice
prompt "CPU select"
optional
 
-config MPC83xx
-   bool "MPC83xx"
+config MPC83XX
+   bool "MPC83XX"
select CREATE_ARCH_SYMLINK
select SYS_FSL_HAS_SEC
select SYS_FSL_SEC_BE
@@ -36,7 +36,7 @@ endchoice
 
 config FSL_LBC
def_bool y
-   depends on (MPC85xx || MPC83xx) && !FSL_IFC
+   depends on (MPC85xx || MPC83XX) && !FSL_IFC
 
 config HIGH_BATS
bool "Enable high BAT registers"
@@ -46,7 +46,7 @@ config HIGH_BATS
 
 config SYS_INIT_RAM_LOCK
bool "Lock some portion of L1 for initial ram stack"
-   depends on MPC83xx || MPC85xx
+   depends on MPC83XX || MPC85xx
 
 config SYS_SRIO
bool "Serial RapidIO support"
diff --git a/arch/powerpc/cpu/Makefile b/arch/powerpc/cpu/Makefile
index e7f64059277..c56f0d78b2d 100644
--- a/arch/powerpc/cpu/Makefile
+++ b/arch/powerpc/cpu/Makefile
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 
-obj-$(CONFIG_MPC83xx) += mpc8xxx/
+obj-$(CONFIG_MPC83XX) += mpc

[PATCH 82/88] usb: Drop unused sl811-hcd driver

2023-01-23 Thread Simon Glass
This is not used. Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 drivers/usb/host/Makefile|   1 -
 drivers/usb/host/sl811-hcd.c | 714 ---
 drivers/usb/host/sl811.h | 104 -
 3 files changed, 819 deletions(-)
 delete mode 100644 drivers/usb/host/sl811-hcd.c
 delete mode 100644 drivers/usb/host/sl811.h

diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 3e5ba2bd0ba..8dad36f9369 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -17,7 +17,6 @@ obj-$(CONFIG_USB_OHCI_NEW) += ohci-hcd.o
 obj-$(CONFIG_USB_ATMEL) += ohci-at91.o
 obj-$(CONFIG_USB_OHCI_DA8XX) += ohci-da8xx.o
 obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
-obj-$(CONFIG_USB_SL811HS) += sl811-hcd.o
 obj-$(CONFIG_USB_OHCI_LPC32XX) += ohci-lpc32xx.o
 obj-$(CONFIG_USB_OHCI_PCI) += ohci-pci.o
 obj-$(CONFIG_USB_OHCI_GENERIC) += ohci-generic.o
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
deleted file mode 100644
index 7c823f241a8..000
--- a/drivers/usb/host/sl811-hcd.c
+++ /dev/null
@@ -1,714 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2004
- * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
- *
- * This code is based on linux driver for sl811hs chip, source at
- * drivers/usb/host/sl811.c:
- *
- * SL811 Host Controller Interface driver for USB.
- *
- * Copyright (c) 2003/06, Courage Co., Ltd.
- *
- * Based on:
- * 1.uhci.c by Linus Torvalds, Johannes Erdfelt, Randy Dunlap,
- *   Georg Acher, Deti Fliegl, Thomas Sailer, Roman Weissgaerber,
- *   Adam Richter, Gregory P. Smith;
- * 2.Original SL811 driver (hc_sl811.o) by Pei Liu 
- * 3.Rewrited as sl811.o by Yin Aihua 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include "sl811.h"
-
-#include "../../../board/kup/common/kup.h"
-
-#ifdef __PPC__
-# define EIEIO __asm__ volatile ("eieio")
-#else
-# define EIEIO /* nothing */
-#endif
-
-#define SL811_ADR (0x5000)
-#define SL811_DAT (0x5001)
-
-#ifdef SL811_DEBUG
-static int debug = 9;
-#endif
-
-static int root_hub_devnum = 0;
-static struct usb_port_status rh_status = { 0 };/* root hub port status */
-
-static int sl811_rh_submit_urb(struct usb_device *usb_dev, unsigned long pipe,
-  void *data, int buf_len, struct devrequest *cmd);
-
-static void sl811_write (__u8 index, __u8 data)
-{
-   *(volatile unsigned char *) (SL811_ADR) = index;
-   EIEIO;
-   *(volatile unsigned char *) (SL811_DAT) = data;
-   EIEIO;
-}
-
-static __u8 sl811_read (__u8 index)
-{
-   __u8 data;
-
-   *(volatile unsigned char *) (SL811_ADR) = index;
-   EIEIO;
-   data = *(volatile unsigned char *) (SL811_DAT);
-   EIEIO;
-   return (data);
-}
-
-/*
- * Read consecutive bytes of data from the SL811H/SL11H buffer
- */
-static void inline sl811_read_buf(__u8 offset, __u8 *buf, __u8 size)
-{
-   *(volatile unsigned char *) (SL811_ADR) = offset;
-   EIEIO;
-   while (size--) {
-   *buf++ = *(volatile unsigned char *) (SL811_DAT);
-   EIEIO;
-   }
-}
-
-/*
- * Write consecutive bytes of data to the SL811H/SL11H buffer
- */
-static void inline sl811_write_buf(__u8 offset, __u8 *buf, __u8 size)
-{
-   *(volatile unsigned char *) (SL811_ADR) = offset;
-   EIEIO;
-   while (size--) {
-   *(volatile unsigned char *) (SL811_DAT) = *buf++;
-   EIEIO;
-   }
-}
-
-int usb_init_kup4x (void)
-{
-   volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
-   volatile memctl8xx_t *memctl = &immap->im_memctl;
-   int i;
-   unsigned char tmp;
-
-   memctl = &immap->im_memctl;
-   memctl->memc_or7 = 0x8726;
-   memctl->memc_br7 = 0x5401;  /* start at 0x5000 */
-   /* BP 14 low = USB ON */
-   immap->im_cpm.cp_pbdat &= ~(BP_USB_VCC);
-   /* PB 14 nomal port */
-   immap->im_cpm.cp_pbpar &= ~(BP_USB_VCC);
-   /* output */
-   immap->im_cpm.cp_pbdir |= (BP_USB_VCC);
-
-   puts ("USB:   ");
-
-   for (i = 0x10; i < 0xff; i++) {
-   sl811_write(i, i);
-   tmp = (sl811_read(i));
-   if (tmp != i) {
-   printf ("SL811 compare error index=0x%02x 
read=0x%02x\n", i, tmp);
-   return (-1);
-   }
-   }
-   printf ("SL811 ready\n");
-   return (0);
-}
-
-/*
- * This function resets SL811HS controller and detects the speed of
- * the connecting device
- *
- * Return: 0 = no device attached; 1 = USB device attached
- */
-static int sl811_hc_reset(void)
-{
-   int status ;
-
-   sl811_write(SL811_CTRL2, SL811_CTL2_HOST | SL811_12M_HI);
-   sl811_write(SL811_CTRL1, SL811_CTRL1_RESET);
-
-   mdelay(20);
-
-   /* Disable hardware SOF generation, clear all irq status. */
-   sl811_write(SL811_CTRL1, 0);
-   mdelay(2);
-   sl811_write(SL

[PATCH 87/88] freescale: Drop unused zm7300 driver

2023-01-23 Thread Simon Glass
This is not used anymore. Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 board/freescale/common/Makefile |   1 -
 board/freescale/common/zm7300.c | 232 
 board/freescale/common/zm7300.h |  21 ---
 3 files changed, 254 deletions(-)
 delete mode 100644 board/freescale/common/zm7300.c
 delete mode 100644 board/freescale/common/zm7300.h

diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index c200cf4d403..b4faf6f9e0a 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -54,7 +54,6 @@ obj-$(CONFIG_TARGET_MPC8548CDS)   += cds_pci_ft.o
 obj-$(CONFIG_TARGET_P3041DS)   += ics307_clk.o
 obj-$(CONFIG_TARGET_P4080DS)   += ics307_clk.o
 obj-$(CONFIG_TARGET_P5040DS)   += ics307_clk.o
-obj-$(CONFIG_ZM7300)   += zm7300.o
 ifeq ($(CONFIG_$(SPL_)POWER_LEGACY),y)
 obj-$(CONFIG_POWER_PFUZE100)   += pfuze.o
 endif
diff --git a/board/freescale/common/zm7300.c b/board/freescale/common/zm7300.c
deleted file mode 100644
index e8c2fc85c84..000
--- a/board/freescale/common/zm7300.c
+++ /dev/null
@@ -1,232 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright 2013 Freescale Semiconductor, Inc.
- */
-
-/* Power-One ZM7300 DPM */
-#include "zm7300.h"
-#include 
-
-#define DPM_WP 0x96
-#define WRP_OPCODE 0x01
-#define WRM_OPCODE 0x02
-#define RRP_OPCODE 0x11
-
-#define DPM_SUCCESS 0x01
-#define DPM_EXEC_FAIL 0x00
-
-static const uint16_t hex_to_1_10mv[] = {
-   5000,
-   5125,
-   5250,
-   5375,
-   5500,
-   5625,
-   5750,
-   5875,
-   6000,
-   6125,
-   6250,
-   6375,
-   6500,
-   6625,
-   6750,
-   6875,
-   7000,
-   7125,
-   7250,
-   7375,
-   7500,
-   7625,
-   7750,
-   7875,
-   8000,
-   8125,
-   8250,
-   8375,
-   8500,
-   8625,
-   8750,
-   8875,
-   9000,
-   9125,
-   9250,
-   9375,
-   9500,  /* 0.95mV */
-   9625,
-   9750,
-   9875,
-   1,  /* 1.0V */
-   10125,
-   10250,
-   10375,
-   10500,
-   10625,
-   10750,
-   10875,
-   11000,
-   11125,
-   11250,
-   11375,
-   11500,
-   11625,
-   11750,
-   11875,
-   12000,
-   12125,
-   12250,
-   12375,
-   0,  /* reserved */
-};
-
-
-/* Read Data d from Register r of POL p */
-u8 dpm_rrp(uchar r)
-{
-   u8 ret[5];
-
-   ret[0] = RRP_OPCODE;
-   /* POL is 0 */
-   ret[1] = 0;
-   ret[2] = r;
-   i2c_read(I2C_DPM_ADDR, 0, -3, ret, 2);
-   if (ret[1] == DPM_SUCCESS) { /* the DPM returned success as status */
-   debug("RRP_OPCODE returned success data is %x\n", ret[0]);
-   return ret[0];
-   } else {
-   return -1;
-   }
-}
-
-/* Write Data d into DPM register r (RAM) */
-int dpm_wrm(u8 r, u8 d)
-{
-   u8 ret[5];
-
-   ret[0] = WRM_OPCODE;
-   ret[1] = r;
-   ret[2] = d;
-   i2c_read(I2C_DPM_ADDR, 0, -3, ret, 1);
-   if (ret[0] == DPM_SUCCESS) { /* the DPM returned success as status */
-   debug("WRM_OPCODE returned success data is %x\n", ret[0]);
-   return ret[0];
-   } else {
-   return -1;
-   }
-}
-
-/* Write Data d into Register r of POL(s) a */
-int dpm_wrp(u8 r, u8 d)
-{
-   u8 ret[7];
-
-   ret[0] = WRP_OPCODE;
-   /* only POL0 is present */
-   ret[1] = 0x01;
-   ret[2] = 0x00;
-   ret[3] = 0x00;
-   ret[4] = 0x00;
-   ret[5] = r;
-   ret[6] = d;
-   i2c_read(I2C_DPM_ADDR, 0, -7, ret, 1);
-   if (ret[0] == DPM_SUCCESS) { /* the DPM returned success as status */
-   debug("WRP_OPCODE returned success data is %x\n", ret[0]);
-   return 0;
-   } else {
-   return -1;
-   }
-}
-
-/* Uses the DPM command RRP */
-u8 zm_read(uchar reg)
-{
-   return dpm_rrp(reg);
-}
-
-/* ZM_write --
-   Steps:
-   a. Write data to the register
-   b. Read data from register and compare to written value
-   c. Return return_code & voltage_read
-*/
-u8 zm_write(u8 reg, u8 data)
-{
-   u8 d;
-
-   /* write data to register */
-   dpm_wrp(reg, data);
-
-   /* read register and compare to written value */
-   d = dpm_rrp(reg);
-   if (d != data) {
-   printf("zm_write : Comparison register data failed\n");
-   return -1;
-   }
-
-   return d;
-}
-
-/* zm_write_out_voltage
- * voltage in 1/10 mV
- */
-int zm_write_voltage(int voltage)
-{
-   u8 reg = 0x7, vid;
-   uint16_t voltage_read;
-   u8 ret;
-
-   vid =  (voltage - 5000) / ZM_STEP;
-
-   ret = zm_write(reg, vid);
-   if (ret != -1) {
-   voltage_read = hex_to_1_10mv[ret];
-   debug("voltage set to %dmV\n", voltage_read/10);
-   return voltage_

[PATCH 20/88] Makefile: Avoid use of invalid CONFIG_ option

2023-01-23 Thread Simon Glass
This appears in a comment but is not a real option. Drop it.

Signed-off-by: Simon Glass 
---

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index da395274225..92a95361982 100644
--- a/Makefile
+++ b/Makefile
@@ -1082,7 +1082,7 @@ expect = $(foreach cfg,$(1),y)
 
 # Show a deprecation message
 # Args:
-# 1: List of CONFIG_DM_... to migrate to (e.g. "CONFIG_DM_MMC CONFIG_BLK")
+# 1: List of options to migrate to (e.g. "CONFIG_DM_MMC CONFIG_BLK")
 # 2: Name of component (e.g . "Ethernet drivers")
 # 3: Release deadline (e.g. "v202.07")
 # 4: Condition to require before checking (e.g. "$(CONFIG_NET)")
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 76/88] ppc: Makefile: Drop unused ppc4xx code

2023-01-23 Thread Simon Glass
CONFIG_UBOOT_PAD_TO is not defined anywhere. Drop this dead code.

Signed-off-by: Simon Glass 
---

 Makefile | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/Makefile b/Makefile
index 5c5b3d2d651..fccc5a9e094 100644
--- a/Makefile
+++ b/Makefile
@@ -1647,17 +1647,6 @@ OBJCOPYFLAGS_u-boot-with-spl-pbl.bin = -I binary -O 
binary --pad-to=$(CONFIG_SPL
 u-boot-with-spl-pbl.bin: spl/u-boot-spl.pbl $(UBOOT_BINLOAD) FORCE
$(call if_changed,pad_cat)
 
-# PPC4xx needs the SPL at the end of the image, since the reset vector
-# is located at 0xfffc. So we can't use the "u-boot-img.bin" target
-# and need to introduce a new build target with the full blown U-Boot
-# at the start padded up to the start of the SPL image. And then concat
-# the SPL image to the end.
-
-OBJCOPYFLAGS_u-boot-img-spl-at-end.bin := -I binary -O binary \
-   --pad-to=$(CONFIG_UBOOT_PAD_TO) --gap-fill=0xff
-u-boot-img-spl-at-end.bin: u-boot.img spl/u-boot-spl.bin FORCE
-   $(call if_changed,pad_cat)
-
 quiet_cmd_u-boot-elf ?= LD  $@
cmd_u-boot-elf ?= $(LD) u-boot-elf.o -o $@ \
$(if $(CONFIG_SYS_BIG_ENDIAN),-EB,-EL) \
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 13/88] ppc: Drop bat_rw

2023-01-23 Thread Simon Glass
Drop this unused driver.

Signed-off-by: Simon Glass 
---

 arch/powerpc/lib/Makefile |   1 -
 arch/powerpc/lib/bat_rw.c | 244 --
 2 files changed, 245 deletions(-)
 delete mode 100644 arch/powerpc/lib/bat_rw.c

diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 066d7f408e0..bb819dcbb6c 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -34,7 +34,6 @@ obj-y += ticks.o
 endif
 obj-y  += reloc.o
 
-obj-$(CONFIG_BAT_RW) += bat_rw.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-y  += cache.o
 obj-y  += extable.o
diff --git a/arch/powerpc/lib/bat_rw.c b/arch/powerpc/lib/bat_rw.c
deleted file mode 100644
index 24dd30615bd..000
--- a/arch/powerpc/lib/bat_rw.c
+++ /dev/null
@@ -1,244 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2002
- * Rich Ireland, Enterasys Networks, rirel...@enterasys.com.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#ifdef CONFIG_ADDR_MAP
-#include 
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int write_bat (ppc_bat_t bat, unsigned long upper, unsigned long lower)
-{
-   __maybe_unused int batn = -1;
-
-   sync();
-
-   switch (bat) {
-   case DBAT0:
-   mtspr (DBAT0L, lower);
-   mtspr (DBAT0U, upper);
-   batn = 0;
-   break;
-   case IBAT0:
-   mtspr (IBAT0L, lower);
-   mtspr (IBAT0U, upper);
-   break;
-   case DBAT1:
-   mtspr (DBAT1L, lower);
-   mtspr (DBAT1U, upper);
-   batn = 1;
-   break;
-   case IBAT1:
-   mtspr (IBAT1L, lower);
-   mtspr (IBAT1U, upper);
-   break;
-   case DBAT2:
-   mtspr (DBAT2L, lower);
-   mtspr (DBAT2U, upper);
-   batn = 2;
-   break;
-   case IBAT2:
-   mtspr (IBAT2L, lower);
-   mtspr (IBAT2U, upper);
-   break;
-   case DBAT3:
-   mtspr (DBAT3L, lower);
-   mtspr (DBAT3U, upper);
-   batn = 3;
-   break;
-   case IBAT3:
-   mtspr (IBAT3L, lower);
-   mtspr (IBAT3U, upper);
-   break;
-#ifdef CONFIG_HIGH_BATS
-   case DBAT4:
-   mtspr (DBAT4L, lower);
-   mtspr (DBAT4U, upper);
-   batn = 4;
-   break;
-   case IBAT4:
-   mtspr (IBAT4L, lower);
-   mtspr (IBAT4U, upper);
-   break;
-   case DBAT5:
-   mtspr (DBAT5L, lower);
-   mtspr (DBAT5U, upper);
-   batn = 5;
-   break;
-   case IBAT5:
-   mtspr (IBAT5L, lower);
-   mtspr (IBAT5U, upper);
-   break;
-   case DBAT6:
-   mtspr (DBAT6L, lower);
-   mtspr (DBAT6U, upper);
-   batn = 6;
-   break;
-   case IBAT6:
-   mtspr (IBAT6L, lower);
-   mtspr (IBAT6U, upper);
-   break;
-   case DBAT7:
-   mtspr (DBAT7L, lower);
-   mtspr (DBAT7U, upper);
-   batn = 7;
-   break;
-   case IBAT7:
-   mtspr (IBAT7L, lower);
-   mtspr (IBAT7U, upper);
-   break;
-#endif
-   default:
-   return (-1);
-   }
-
-#ifdef CONFIG_ADDR_MAP
-   if ((gd->flags & GD_FLG_RELOC) && (batn >= 0)) {
-   phys_size_t size;
-   if (!BATU_VALID(upper))
-   size = 0;
-   else
-   size = BATU_SIZE(upper);
-   addrmap_set_entry(BATU_VADDR(upper), BATL_PADDR(lower),
- size, batn);
-   }
-#endif
-
-   sync();
-   isync();
-
-   return (0);
-}
-
-int read_bat (ppc_bat_t bat, unsigned long *upper, unsigned long *lower)
-{
-   unsigned long register u;
-   unsigned long register l;
-
-   switch (bat) {
-   case DBAT0:
-   l = mfspr (DBAT0L);
-   u = mfspr (DBAT0U);
-   break;
-   case IBAT0:
-   l = mfspr (IBAT0L);
-   u = mfspr (IBAT0U);
-   break;
-   case DBAT1:
-   l = mfspr (DBAT1L);
-   u = mfspr (DBAT1U);
-   break;
-   case IBAT1:
-   l = mfspr (IBAT1L);
-   u = mfspr (IBAT1U);
-   break;
-   case DBAT2:
-   l = mfspr (DBAT2L);
-   u = mfspr (DBAT2U);
-   break;
-   case IBAT2:
-   l = mfspr (IBAT2L);
-   u = mfspr (IBAT2U);
-   break;
-   case DBAT3:
-   l = mfspr (DBAT3L);
-   u = mfspr (DBAT3U);
-   break;
-   case IBAT3:
-   l = mfspr (IBAT3L);
-   u = mfspr (IBAT3U);
-   break;
-#ifdef

[PATCH 75/88] sh4: Drop unused twl6030 driver

2023-01-23 Thread Simon Glass
This is not used. Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 drivers/input/Makefile  |  1 -
 drivers/input/twl6030.c | 47 -
 2 files changed, 48 deletions(-)
 delete mode 100644 drivers/input/twl6030.c

diff --git a/drivers/input/Makefile b/drivers/input/Makefile
index ded76bddb22..11868e7584c 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -13,5 +13,4 @@ obj-$(CONFIG_APPLE_SPI_KEYB) += apple_spi_kbd.o
 obj-$(CONFIG_I8042_KEYB) += i8042.o
 obj-$(CONFIG_TEGRA_KEYBOARD) += input.o tegra-kbc.o
 obj-$(CONFIG_TWL4030_INPUT) += twl4030.o
-obj-$(CONFIG_TWL6030_INPUT) += twl6030.o
 endif
diff --git a/drivers/input/twl6030.c b/drivers/input/twl6030.c
deleted file mode 100644
index 76bd3488fc6..000
--- a/drivers/input/twl6030.c
+++ /dev/null
@@ -1,47 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * TWL6030 input
- *
- * Copyright (C) 2016 Paul Kocialkowski 
- */
-
-#include 
-
-int twl6030_input_power_button(void)
-{
-   u8 value;
-
-   twl6030_i2c_read_u8(TWL6030_CHIP_PM, TWL6030_STS_HW_CONDITIONS, &value);
-
-   /* Power button is active low. */
-   if (value & TWL6030_STS_HW_CONDITIONS_PWRON)
-   return 0;
-
-   return 1;
-}
-
-int twl6030_input_charger(void)
-{
-   u8 value;
-
-   twl6030_i2c_read_u8(TWL6030_CHIP_CHARGER, TWL6030_CONTROLLER_STAT1,
-   &value);
-
-   if (value & TWL6030_CONTROLLER_STAT1_VAC_DET)
-   return 1;
-
-   return 0;
-}
-
-int twl6030_input_usb(void)
-{
-   u8 value;
-
-   twl6030_i2c_read_u8(TWL6030_CHIP_CHARGER, TWL6030_CONTROLLER_STAT1,
-   &value);
-
-   if (value & TWL6030_CONTROLLER_STAT1_VBUS_DET)
-   return 1;
-
-   return 0;
-}
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 25/88] misc: Drop mc9sdz60 driver

2023-01-23 Thread Simon Glass
Drop this unused driver.

Signed-off-by: Simon Glass 
---

 drivers/misc/Makefile   |  1 -
 drivers/misc/mc9sdz60.c | 34 --
 2 files changed, 35 deletions(-)
 delete mode 100644 drivers/misc/mc9sdz60.c

diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 2de510329d8..3b792f2a14c 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -36,7 +36,6 @@ obj-$(CONFIG_DS4510)  += ds4510.o
 obj-$(CONFIG_FSL_DEVICE_DISABLE) += fsl_devdis.o
 obj-$(CONFIG_FSL_IFC) += fsl_ifc.o
 obj-$(CONFIG_FSL_IIM) += fsl_iim.o
-obj-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o
 obj-$(CONFIG_FSL_SEC_MON) += fsl_sec_mon.o
 obj-$(CONFIG_$(SPL_)FS_LOADER) += fs_loader.o
 obj-$(CONFIG_GATEWORKS_SC) += gsc.o
diff --git a/drivers/misc/mc9sdz60.c b/drivers/misc/mc9sdz60.c
deleted file mode 100644
index e68a056a559..000
--- a/drivers/misc/mc9sdz60.c
+++ /dev/null
@@ -1,34 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2010 Stefano Babic 
- */
-
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#ifndef CONFIG_SYS_FSL_MC9SDZ60_I2C_ADDR
-#error "You have to configure I2C address for MC9SDZ60"
-#endif
-
-
-u8 mc9sdz60_reg_read(enum mc9sdz60_reg reg)
-{
-   u8 val;
-
-   if (i2c_read(CONFIG_SYS_FSL_MC9SDZ60_I2C_ADDR, reg, 1, &val, 1)) {
-   puts("Error reading MC9SDZ60 register\n");
-   return -1;
-   }
-
-   return val;
-}
-
-void mc9sdz60_reg_write(enum mc9sdz60_reg reg, u8 val)
-{
-   i2c_write(CONFIG_SYS_FSL_MC9SDZ60_I2C_ADDR, reg, 1, &val, 1);
-}
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 08/88] misc: Drop ali512x

2023-01-23 Thread Simon Glass
Drop this unused driver.

Signed-off-by: Simon Glass 
---

 drivers/misc/Makefile  |   1 -
 drivers/misc/ali512x.c | 401 -
 2 files changed, 402 deletions(-)
 delete mode 100644 drivers/misc/ali512x.c

diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index d494639cd95..2de510329d8 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -29,7 +29,6 @@ ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SANDBOX) += spltest_sandbox.o
 endif
 endif
-obj-$(CONFIG_ALI152X) += ali512x.o
 obj-$(CONFIG_ALTERA_SYSID) += altera_sysid.o
 obj-$(CONFIG_ATSHA204A) += atsha204a-i2c.o
 obj-$(CONFIG_CBMEM_CONSOLE) += cbmem_console.o
diff --git a/drivers/misc/ali512x.c b/drivers/misc/ali512x.c
deleted file mode 100644
index e714e28bdc3..000
--- a/drivers/misc/ali512x.c
+++ /dev/null
@@ -1,401 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB .
- */
-
-/*
- * Based on sc520cdp.c from rolo 1.6:
- *--
- * (C) Copyright 2000
- * Sysgo Real-Time Solutions GmbH
- * Klein-Winternheim, Germany
- *--
- */
-
-#include 
-
-#include 
-#include 
-#include 
-
-
-/* ALI M5123 Logical device numbers:
- * 0 FDC
- * 1 unused?
- * 2 unused?
- * 3 lpt
- * 4 UART1
- * 5 UART2
- * 6 RTC
- * 7 mouse/kbd
- * 8 CIO
- */
-
-/*
- 
- *  Some access primitives for the ALi chip:*
- 
- */
-
-static void ali_write(u8 index, u8 value)
-{
-   /* write an arbirary register */
-   outb(index, ALI_INDEX);
-   outb(value, ALI_DATA);
-}
-
-#if 0
-static int ali_read(u8 index)
-{
-   outb(index, ALI_INDEX);
-   return inb(ALI_DATA);
-}
-#endif
-
-#define ALI_OPEN() \
-   outb(0x51, ALI_INDEX); \
-   outb(0x23, ALI_INDEX)
-
-
-#define ALI_CLOSE() \
-   outb(0xbb, ALI_INDEX)
-
-/* Select a logical device */
-#define ALI_SELDEV(dev)\
-   ali_write(0x07, dev)
-
-
-void ali512x_init(void)
-{
-   ALI_OPEN();
-
-   ali_write(0x02, 0x01);  /* soft reset */
-   ali_write(0x03, 0x03);  /* disable access to CIOs */
-   ali_write(0x22, 0x00);  /* disable direct powerdown */
-   ali_write(0x23, 0x00);  /* disable auto powerdown */
-   ali_write(0x24, 0x00);  /* IR 8 is active hi, pin26 is PDIR */
-
-   ALI_CLOSE();
-}
-
-void ali512x_set_fdc(int enabled, u16 io, u8 irq, u8 dma_channel)
-{
-   ALI_OPEN();
-   ALI_SELDEV(0);
-
-   ali_write(0x30, enabled?1:0);
-   if (enabled) {
-   ali_write(0x60, io >> 8);
-   ali_write(0x61, io & 0xff);
-   ali_write(0x70, irq);
-   ali_write(0x74, dma_channel);
-
-   /* AT mode, no drive swap */
-   ali_write(0xf0, 0x08);
-   ali_write(0xf1, 0x00);
-   ali_write(0xf2, 0xff);
-   ali_write(0xf4, 0x00);
-   }
-   ALI_CLOSE();
-}
-
-
-void ali512x_set_pp(int enabled, u16 io, u8 irq, u8 dma_channel)
-{
-   ALI_OPEN();
-   ALI_SELDEV(3);
-
-   ali_write(0x30, enabled?1:0);
-   if (enabled) {
-   ali_write(0x60, io >> 8);
-   ali_write(0x61, io & 0xff);
-   ali_write(0x70, irq);
-   ali_write(0x74, dma_channel);
-
-   /* mode: EPP 1.9, ECP FIFO threshold = 7, IRQ active low */
-   ali_write(0xf0, 0xbc);
-   /* 12 MHz, Burst DMA in ECP */
-   ali_write(0xf1, 0x05);
-   }
-   ALI_CLOSE();
-
-}
-
-void ali512x_set_uart(int enabled, int index, u16 io, u8 irq)
-{
-   ALI_OPEN();
-   ALI_SELDEV(index?5:4);
-
-   ali_write(0x30, enabled?1:0);
-   if (enabled) {
-   ali_write(0x60, io >> 8);
-   ali_write(0x61, io & 0xff);
-   ali_write(0x70, irq);
-
-   ali_write(0xf0, 0x00);
-   ali_write(0xf1, 0x00);
-
-   /* huh? write 0xf2 twice - a typo in rolo
-* or some secret ali errata? Who knows?
-*/
-   if (index) {
-   ali_write(0xf2, 0x00);
-   }
-   ali_write(0xf2, 0x0c);
-   }
-   ALI_CLOSE();
-
-}
-
-void ali512x_set_uart2_irda(int enabled)
-{
-   ALI_OPEN();
-   ALI_SELDEV(5);
-
-   ali_write(0xf1, enabled?0x48:0x00); /* fullduplex IrDa */
-   ALI_CLOSE();
-
-}
-
-void ali512x_set_rtc(int enabled, u16 io, u8 irq)
-{
-   ALI_OPEN();
-   ALI_SELDEV(6);
-
-   ali_write(0x30, enabled?1:0);
-   if (enabled) {
-   ali_write(0x60, io >> 8);
-   ali_write(0x61, io & 0xff);
-   ali_write(0x70, irq);
-
-   ali_write(0xf0, 0x00);
-   }
-   ALI_CLOSE();
-}
-
-void ali512x_set_kbc(int enabled, u8 kbc_irq,

[PATCH 03/88] power: Drop fg_max77693

2023-01-23 Thread Simon Glass
This is not used in U-Boot. Drop it.

Signed-off-by: Simon Glass 
---

 drivers/power/mfd/Makefile  |   1 -
 drivers/power/mfd/fg_max77693.c | 137 
 2 files changed, 138 deletions(-)
 delete mode 100644 drivers/power/mfd/fg_max77693.c

diff --git a/drivers/power/mfd/Makefile b/drivers/power/mfd/Makefile
index a8eb7f81e72..5dfbdbd1b0f 100644
--- a/drivers/power/mfd/Makefile
+++ b/drivers/power/mfd/Makefile
@@ -5,4 +5,3 @@
 
 obj-$(CONFIG_POWER_PMIC_MAX77693) += pmic_max77693.o
 obj-$(CONFIG_POWER_MUIC_MAX77693) += muic_max77693.o
-obj-$(CONFIG_POWER_FG_MAX77693) += fg_max77693.o
diff --git a/drivers/power/mfd/fg_max77693.c b/drivers/power/mfd/fg_max77693.c
deleted file mode 100644
index 983a6d4a2bd..000
--- a/drivers/power/mfd/fg_max77693.c
+++ /dev/null
@@ -1,137 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2013 Samsung Electronics
- * Piotr Wilczek 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static int max77693_get_vcell(u32 *vcell)
-{
-   u16 value;
-   u8 ret;
-
-   ret = i2c_read(MAX77693_FUEL_I2C_ADDR, MAX77693_VCELL, 1,
-  (u8 *)&value, 2);
-   if (ret)
-   return ret;
-
-   *vcell = (u32)(value >> 3);
-   *vcell = *vcell * 625;
-
-   return 0;
-}
-
-static int max77693_get_soc(u32 *soc)
-{
-   u16 value;
-   u8 ret;
-
-   ret = i2c_read(MAX77693_FUEL_I2C_ADDR, MAX77693_VFSOC, 1,
-  (u8 *)&value, 2);
-   if (ret)
-   return ret;
-
-   *soc = (u32)(value >> 8);
-
-   return 0;
-}
-
-static int power_update_battery(struct pmic *p, struct pmic *bat)
-{
-   struct power_battery *pb = bat->pbat;
-   int ret;
-
-   if (pmic_probe(p)) {
-   puts("Can't find max77693 fuel gauge\n");
-   return -ENODEV;
-   }
-
-   ret = max77693_get_soc(&pb->bat->state_of_chrg);
-   if (ret)
-   return ret;
-
-   max77693_get_vcell(&pb->bat->voltage_uV);
-
-   return 0;
-}
-
-static int power_check_battery(struct pmic *p, struct pmic *bat)
-{
-   struct power_battery *pb = bat->pbat;
-   unsigned int val;
-   int ret = 0;
-
-   if (pmic_probe(p)) {
-   puts("Can't find max77693 fuel gauge\n");
-   return -ENODEV;
-   }
-
-   ret = pmic_reg_read(p, MAX77693_STATUS, &val);
-   if (ret)
-   return ret;
-   debug("fg status: 0x%x\n", val);
-
-   ret = pmic_reg_read(p, MAX77693_VERSION, &pb->bat->version);
-   if (ret)
-   return ret;
-
-   ret = power_update_battery(p, bat);
-   if (ret)
-   return ret;
-   debug("fg ver: 0x%x\n", pb->bat->version);
-   printf("BAT: state_of_charge(SOC):%d%%\n",
-  pb->bat->state_of_chrg);
-
-   printf(" voltage: %d.%6.6d [V] (expected to be %d [mAh])\n",
-  pb->bat->voltage_uV / 100,
-  pb->bat->voltage_uV % 100,
-  pb->bat->capacity);
-
-   if (pb->bat->voltage_uV > 385)
-   pb->bat->state = EXT_SOURCE;
-   else if (pb->bat->voltage_uV < 360 || pb->bat->state_of_chrg < 5)
-   pb->bat->state = CHARGE;
-   else
-   pb->bat->state = NORMAL;
-
-   return 0;
-}
-
-static struct power_fg power_fg_ops = {
-   .fg_battery_check = power_check_battery,
-   .fg_battery_update = power_update_battery,
-};
-
-int power_fg_init(unsigned char bus)
-{
-   static const char name[] = "MAX77693_FG";
-   struct pmic *p = pmic_alloc();
-
-   if (!p) {
-   printf("%s: POWER allocation error!\n", __func__);
-   return -ENOMEM;
-   }
-
-   debug("Board Fuel Gauge init\n");
-
-   p->name = name;
-   p->interface = PMIC_I2C;
-   p->number_of_regs = FG_NUM_OF_REGS;
-   p->hw.i2c.addr = MAX77693_FUEL_I2C_ADDR;
-   p->hw.i2c.tx_num = 2;
-   p->sensor_byte_order = PMIC_SENSOR_BYTE_ORDER_BIG;
-   p->bus = bus;
-
-   p->fg = &power_fg_ops;
-
-   return 0;
-}
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 49/88] mtd: Drop unused nand_plat driver

2023-01-23 Thread Simon Glass
This is not used since this commit:

   936478e797a SPARC: Remove

Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 drivers/mtd/nand/raw/Makefile|  1 -
 drivers/mtd/nand/raw/nand_plat.c | 65 
 2 files changed, 66 deletions(-)
 delete mode 100644 drivers/mtd/nand/raw/nand_plat.c

diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
index c25acb11804..add2b4cf655 100644
--- a/drivers/mtd/nand/raw/Makefile
+++ b/drivers/mtd/nand/raw/Makefile
@@ -70,7 +70,6 @@ obj-$(CONFIG_NAND_PXA3XX) += pxa3xx_nand.o
 obj-$(CONFIG_TEGRA_NAND) += tegra_nand.o
 obj-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 obj-$(CONFIG_NAND_OMAP_ELM) += omap_elm.o
-obj-$(CONFIG_NAND_PLAT) += nand_plat.o
 obj-$(CONFIG_NAND_SUNXI) += sunxi_nand.o
 obj-$(CONFIG_NAND_MXIC) += mxic_nand.o
 obj-$(CONFIG_NAND_ZYNQ) += zynq_nand.o
diff --git a/drivers/mtd/nand/raw/nand_plat.c b/drivers/mtd/nand/raw/nand_plat.c
deleted file mode 100644
index 81e7aa218d5..000
--- a/drivers/mtd/nand/raw/nand_plat.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Genericish driver for memory mapped NAND devices
- *
- * Copyright (c) 2006-2009 Analog Devices Inc.
- * Licensed under the GPL-2 or later.
- */
-
-/* Your board must implement the following macros:
- *  NAND_PLAT_WRITE_CMD(chip, cmd)
- *  NAND_PLAT_WRITE_ADR(chip, cmd)
- *  NAND_PLAT_INIT()
- *
- * It may also implement the following:
- *  NAND_PLAT_DEV_READY(chip)
- */
-
-#include 
-#include 
-#include 
-#ifdef NAND_PLAT_GPIO_DEV_READY
-# include 
-# define NAND_PLAT_DEV_READY(chip) gpio_get_value(NAND_PLAT_GPIO_DEV_READY)
-#endif
-
-#include 
-
-static void plat_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-   struct nand_chip *this = mtd_to_nand(mtd);
-
-   if (cmd == NAND_CMD_NONE)
-   return;
-
-   if (ctrl & NAND_CLE)
-   NAND_PLAT_WRITE_CMD(this, cmd);
-   else
-   NAND_PLAT_WRITE_ADR(this, cmd);
-}
-
-#ifdef NAND_PLAT_DEV_READY
-static int plat_dev_ready(struct mtd_info *mtd)
-{
-   return NAND_PLAT_DEV_READY((struct nand_chip *)mtd_to_nand(mtd));
-}
-#else
-# define plat_dev_ready NULL
-#endif
-
-int board_nand_init(struct nand_chip *nand)
-{
-#ifdef NAND_PLAT_GPIO_DEV_READY
-   gpio_request(NAND_PLAT_GPIO_DEV_READY, "nand-plat");
-   gpio_direction_input(NAND_PLAT_GPIO_DEV_READY);
-#endif
-
-#ifdef NAND_PLAT_INIT
-   NAND_PLAT_INIT();
-#endif
-
-   nand->cmd_ctrl = plat_cmd_ctrl;
-   nand->dev_ready = plat_dev_ready;
-   nand->ecc.mode = NAND_ECC_SOFT;
-
-   return 0;
-}
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 10/88] Rename ARCH_NPCM7xx

2023-01-23 Thread Simon Glass
CONFIG options must not use lower-case letter. Convert this to upper case.

Signed-off-by: Simon Glass 
---

 arch/arm/dts/Makefile  | 2 +-
 arch/arm/mach-npcm/Kconfig | 4 ++--
 arch/arm/mach-npcm/Makefile| 2 +-
 arch/arm/mach-npcm/npcm7xx/Kconfig | 2 +-
 drivers/clk/nuvoton/Makefile   | 2 +-
 drivers/misc/npcm_otp.c| 2 +-
 drivers/pinctrl/nuvoton/Kconfig| 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 44256d9fa94..c184c802b45 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1286,7 +1286,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt8516-pumpkin.dtb \
mt8518-ap1-emmc.dtb
 
-dtb-$(CONFIG_ARCH_NPCM7xx) += nuvoton-npcm750-evb.dtb
+dtb-$(CONFIG_ARCH_NPCM7XX) += nuvoton-npcm750-evb.dtb
 dtb-$(CONFIG_ARCH_NPCM8XX) += nuvoton-npcm845-evb.dtb
 dtb-$(CONFIG_XEN) += xenguest-arm64.dtb
 
diff --git a/arch/arm/mach-npcm/Kconfig b/arch/arm/mach-npcm/Kconfig
index 24bd2ad423f..a709e1f2402 100644
--- a/arch/arm/mach-npcm/Kconfig
+++ b/arch/arm/mach-npcm/Kconfig
@@ -8,9 +8,9 @@ config TEXT_BASE
 
 choice
prompt "Nuvoton SoC select"
-   default ARCH_NPCM7xx
+   default ARCH_NPCM7XX
 
-config ARCH_NPCM7xx
+config ARCH_NPCM7XX
bool "Support Nuvoton NPCM7xx SoC"
select CPU_V7A
select OF_CONTROL
diff --git a/arch/arm/mach-npcm/Makefile b/arch/arm/mach-npcm/Makefile
index b448329dea7..4c15fbb8fe5 100644
--- a/arch/arm/mach-npcm/Makefile
+++ b/arch/arm/mach-npcm/Makefile
@@ -1,2 +1,2 @@
-obj-$(CONFIG_ARCH_NPCM7xx) += npcm7xx/
+obj-$(CONFIG_ARCH_NPCM7XX) += npcm7xx/
 obj-$(CONFIG_ARCH_NPCM8XX) += npcm8xx/
diff --git a/arch/arm/mach-npcm/npcm7xx/Kconfig 
b/arch/arm/mach-npcm/npcm7xx/Kconfig
index 237e7ba7e50..17d0a37e97c 100644
--- a/arch/arm/mach-npcm/npcm7xx/Kconfig
+++ b/arch/arm/mach-npcm/npcm7xx/Kconfig
@@ -1,4 +1,4 @@
-if ARCH_NPCM7xx
+if ARCH_NPCM7XX
 
 config SYS_CPU
 default "armv7"
diff --git a/drivers/clk/nuvoton/Makefile b/drivers/clk/nuvoton/Makefile
index b55dc80de20..1c210a997d4 100644
--- a/drivers/clk/nuvoton/Makefile
+++ b/drivers/clk/nuvoton/Makefile
@@ -1,3 +1,3 @@
 obj-$(CONFIG_ARCH_NPCM) += clk_npcm.o
-obj-$(CONFIG_ARCH_NPCM7xx) += clk_npcm7xx.o
+obj-$(CONFIG_ARCH_NPCM7XX) += clk_npcm7xx.o
 obj-$(CONFIG_ARCH_NPCM8XX) += clk_npcm8xx.o
diff --git a/drivers/misc/npcm_otp.c b/drivers/misc/npcm_otp.c
index 304910888bb..15d016f606b 100644
--- a/drivers/misc/npcm_otp.c
+++ b/drivers/misc/npcm_otp.c
@@ -484,7 +484,7 @@ static int npcm_otp_bind(struct udevice *dev)
}
otp_priv->regs[0] = regs;
 
-   if (IS_ENABLED(CONFIG_ARCH_NPCM7xx)) {
+   if (IS_ENABLED(CONFIG_ARCH_NPCM7XX)) {
regs = dev_remap_addr_index(dev, 1);
if (!regs) {
printf("Cannot find reg address (arr #1), binding 
failed\n");
diff --git a/drivers/pinctrl/nuvoton/Kconfig b/drivers/pinctrl/nuvoton/Kconfig
index e55a0261adb..748d18d40ff 100644
--- a/drivers/pinctrl/nuvoton/Kconfig
+++ b/drivers/pinctrl/nuvoton/Kconfig
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config PINCTRL_NPCM7XX
bool "Pinctrl and GPIO driver for Nuvoton NPCM7XX"
-   depends on DM && PINCTRL_GENERIC && ARCH_NPCM7xx
+   depends on DM && PINCTRL_GENERIC && ARCH_NPCM7XX
help
  Say Y here to enable pin controller and GPIO support
  for Nuvoton NPCM750/730/715/705 SoCs.
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH] test: bootdev: Do not require USB to compile test

2023-01-23 Thread Linus Walleij
This test will block compilation of the entire test suite
on platforms without USB support. Make the extern
"usb_started" conditional on USB host or gadget and
define a dummy flag if neither is enabled.

Cc: Simon Glass 
Signed-off-by: Linus Walleij 
---
 test/boot/bootdev.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 1c2a79fb1084..fa466b708184 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -18,7 +18,11 @@
 #include "bootstd_common.h"
 
 /* Allow reseting the USB-started flag */
+#if defined(CONFIG_USB_HOST) || defined(CONFIG_USB_GADGET)
 extern char usb_started;
+#else
+char usb_started;
+#endif
 
 /* Check 'bootdev list' command */
 static int bootdev_test_cmd_list(struct unit_test_state *uts)
-- 
2.39.0



[PATCH 70/88] sysreset: at91: Correct Makefile rule for SYSRESET_AT91

2023-01-23 Thread Simon Glass
The SPL_TPL part is in the wrong place. Fix it.

Signed-off-by: Simon Glass 
Fixes: 71d4393f846 ("sysreset: Add Atmel/Microchip sysreset driver")
---

 drivers/sysreset/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
index 0ed3bbf356a..40c876764af 100644
--- a/drivers/sysreset/Makefile
+++ b/drivers/sysreset/Makefile
@@ -20,6 +20,6 @@ obj-$(CONFIG_SYSRESET_TI_SCI) += sysreset-ti-sci.o
 obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
 obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
 obj-$(CONFIG_SYSRESET_RESETCTL) += sysreset_resetctl.o
-obj-$(CONFIG_SYSRESET_$(SPL_TPL_)AT91) += sysreset_at91.o
+obj-$(CONFIG_$(SPL_TPL_)SYSRESET_AT91) += sysreset_at91.o
 obj-$(CONFIG_$(SPL_TPL_)SYSRESET_X86) += sysreset_x86.o
 obj-$(CONFIG_TARGET_XTFPGA) += sysreset_xtfpga.o
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 74/88] freescale: Drop CONFIG_TARGET_MPC8536DS et al

2023-01-23 Thread Simon Glass
This option as well as CONFIG_TARGET_P1022DS and CONFIG_TARGET_P5020DS
are not defined anywhere. Drop them.

Signed-off-by: Simon Glass 
---

 board/freescale/common/Makefile | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index bd035d60a58..5f0503faf8d 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -51,8 +51,6 @@ endif
 
 obj-$(CONFIG_TARGET_MPC8548CDS)+= cds_pci_ft.o
 
-obj-$(CONFIG_TARGET_MPC8536DS) += ics307_clk.o
-obj-$(CONFIG_TARGET_P1022DS)   += ics307_clk.o
 obj-$(CONFIG_TARGET_P3041DS)   += ics307_clk.o
 obj-$(CONFIG_TARGET_P4080DS)   += ics307_clk.o
 obj-$(CONFIG_TARGET_P5040DS)   += ics307_clk.o
@@ -75,7 +73,6 @@ obj-$(CONFIG_EMC2305)  += emc2305.o
 obj-$(CONFIG_TARGET_P2041RDB)  += p_corenet/
 obj-$(CONFIG_TARGET_P3041DS)   += p_corenet/
 obj-$(CONFIG_TARGET_P4080DS)   += p_corenet/
-obj-$(CONFIG_TARGET_P5020DS)   += p_corenet/
 obj-$(CONFIG_TARGET_P5040DS)   += p_corenet/
 
 obj-$(CONFIG_LAYERSCAPE_NS_ACCESS) += ns_access.o
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 60/88] freescale: Drop unused pq-mds-pib driver

2023-01-23 Thread Simon Glass
This is not used. Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 board/freescale/common/Makefile |  1 -
 board/freescale/common/pq-mds-pib.c | 60 -
 board/freescale/common/pq-mds-pib.h |  9 -
 3 files changed, 70 deletions(-)
 delete mode 100644 board/freescale/common/pq-mds-pib.c
 delete mode 100644 board/freescale/common/pq-mds-pib.h

diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index 9d5f38bb225..bd035d60a58 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -36,7 +36,6 @@ obj-$(I2C_COMMON) += i2c_common.o
 obj-$(CONFIG_FSL_USE_PCA9547_MUX)  += i2c_mux.o
 obj-$(CONFIG_$(SPL_)VID)   += vid.o
 obj-$(CONFIG_FSL_QIXIS)+= qixis.o
-obj-$(CONFIG_PQ_MDS_PIB)   += pq-mds-pib.o
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_ID_EEPROM)+= sys_eeprom.o
 endif
diff --git a/board/freescale/common/pq-mds-pib.c 
b/board/freescale/common/pq-mds-pib.c
deleted file mode 100644
index 162c8a954f0..000
--- a/board/freescale/common/pq-mds-pib.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2007 Freescale Semiconductor, Inc.
- *
- * Tony Li 
- *
- * 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 
-#include 
-#include 
-
-#include "pq-mds-pib.h"
-
-int pib_init(void)
-{
-   u8 val8;
-   u8 orig_i2c_bus;
-
-   /* Switch temporarily to I2C bus #2 */
-   orig_i2c_bus = i2c_get_bus_num();
-   i2c_set_bus_num(1);
-
-   val8 = 0;
-#if defined(CONFIG_PCI) && !defined(CONFIG_PCISLAVE)
-   /* Assign PIB PMC slot to desired PCI bus */
-   i2c_write(0x23, 0x6, 1, &val8, 1);
-   i2c_write(0x23, 0x7, 1, &val8, 1);
-   val8 = 0xff;
-   i2c_write(0x23, 0x2, 1, &val8, 1);
-   i2c_write(0x23, 0x3, 1, &val8, 1);
-
-   val8 = 0;
-   i2c_write(0x26, 0x6, 1, &val8, 1);
-   val8 = 0x34;
-   i2c_write(0x26, 0x7, 1, &val8, 1);
-   val8 = 0xf3;/* PMC1, PMC2, PMC3 slot to PCI bus */
-   i2c_write(0x26, 0x2, 1, &val8, 1);
-   val8 = 0xff;
-   i2c_write(0x26, 0x3, 1, &val8, 1);
-
-   val8 = 0;
-   i2c_write(0x27, 0x6, 1, &val8, 1);
-   i2c_write(0x27, 0x7, 1, &val8, 1);
-   val8 = 0xff;
-   i2c_write(0x27, 0x2, 1, &val8, 1);
-   val8 = 0xef;
-   i2c_write(0x27, 0x3, 1, &val8, 1);
-
-   eieio();
-
-   printf("PCI 32bit bus on PMC1 & PMC2 &PMC3\n");
-#endif
-
-   /* Reset to original I2C bus */
-   i2c_set_bus_num(orig_i2c_bus);
-   return 0;
-}
diff --git a/board/freescale/common/pq-mds-pib.h 
b/board/freescale/common/pq-mds-pib.h
deleted file mode 100644
index 67066fd118d..000
--- a/board/freescale/common/pq-mds-pib.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Copyright (C) 2007 Freescale Semiconductor, Inc.
- *
- * 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;
- */
-
-extern int pib_init(void);
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 79/88] usb: Drop unused fotg210 gadget

2023-01-23 Thread Simon Glass
This is not used and appears to be associated with the faraday board which
has been removed. Drop the driver and Kconfig options.

Signed-off-by: Simon Glass 
---

 drivers/usb/gadget/Makefile   |   3 +-
 drivers/usb/gadget/fotg210.c  | 964 --
 drivers/usb/gadget/gadget_chips.h |   8 -
 include/usb/fotg210.h | 362 ---
 4 files changed, 1 insertion(+), 1336 deletions(-)
 delete mode 100644 drivers/usb/gadget/fotg210.c
 delete mode 100644 include/usb/fotg210.h

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 9c04403da30..b04b6bcd779 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -19,8 +19,7 @@ obj-$(CONFIG_USB_GADGET_ATMEL_USBA) += atmel_usba_udc.o
 obj-$(CONFIG_USB_GADGET_BCM_UDC_OTG_PHY) += bcm_udc_otg_phy.o
 obj-$(CONFIG_USB_GADGET_DWC2_OTG) += dwc2_udc_otg.o
 obj-$(CONFIG_USB_GADGET_DWC2_OTG_PHY) += dwc2_udc_otg_phy.o
-obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
-obj-$(CONFIG_USB_GADGET_MAX3420) += max3420_udc.o
+0obj-$(CONFIG_USB_GADGET_MAX3420) += max3420_udc.o
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
 obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
diff --git a/drivers/usb/gadget/fotg210.c b/drivers/usb/gadget/fotg210.c
deleted file mode 100644
index af43433d88d..000
--- a/drivers/usb/gadget/fotg210.c
+++ /dev/null
@@ -1,964 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Faraday USB 2.0 OTG Controller
- *
- * (C) Copyright 2010 Faraday Technology
- * Dante Su 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#define CFG_NUM_ENDPOINTS  4
-#define CFG_EP0_MAX_PACKET_SIZE64
-#define CFG_EPX_MAX_PACKET_SIZE512
-
-#define CFG_CMD_TIMEOUT (CONFIG_SYS_HZ >> 2) /* 250 ms */
-
-struct fotg210_chip;
-
-struct fotg210_ep {
-   struct usb_ep ep;
-
-   uint maxpacket;
-   uint id;
-   uint stopped;
-
-   struct list_head  queue;
-   struct fotg210_chip  *chip;
-   const struct usb_endpoint_descriptor *desc;
-};
-
-struct fotg210_request {
-   struct usb_request req;
-   struct list_head   queue;
-   struct fotg210_ep *ep;
-};
-
-struct fotg210_chip {
-   struct usb_gadget gadget;
-   struct usb_gadget_driver *driver;
-   struct fotg210_regs  *regs;
-   uint8_t   irq;
-   uint16_t  addr;
-   int   pullup;
-   enum usb_device_state state;
-   struct fotg210_ep ep[1 + CFG_NUM_ENDPOINTS];
-};
-
-static struct usb_endpoint_descriptor ep0_desc = {
-   .bLength = sizeof(struct usb_endpoint_descriptor),
-   .bDescriptorType = USB_DT_ENDPOINT,
-   .bEndpointAddress = USB_DIR_IN,
-   .bmAttributes = USB_ENDPOINT_XFER_CONTROL,
-};
-
-static inline int fifo_to_ep(struct fotg210_chip *chip, int id, int in)
-{
-   return (id < 0) ? 0 : ((id & 0x03) + 1);
-}
-
-static inline int ep_to_fifo(struct fotg210_chip *chip, int id)
-{
-   return (id <= 0) ? -1 : ((id - 1) & 0x03);
-}
-
-static inline int ep_reset(struct fotg210_chip *chip, uint8_t ep_addr)
-{
-   int ep = ep_addr & USB_ENDPOINT_NUMBER_MASK;
-   struct fotg210_regs *regs = chip->regs;
-
-   if (ep_addr & USB_DIR_IN) {
-   /* reset endpoint */
-   setbits_le32(®s->iep[ep - 1], IEP_RESET);
-   mdelay(1);
-   clrbits_le32(®s->iep[ep - 1], IEP_RESET);
-   /* clear endpoint stall */
-   clrbits_le32(®s->iep[ep - 1], IEP_STALL);
-   } else {
-   /* reset endpoint */
-   setbits_le32(®s->oep[ep - 1], OEP_RESET);
-   mdelay(1);
-   clrbits_le32(®s->oep[ep - 1], OEP_RESET);
-   /* clear endpoint stall */
-   clrbits_le32(®s->oep[ep - 1], OEP_STALL);
-   }
-
-   return 0;
-}
-
-static int fotg210_reset(struct fotg210_chip *chip)
-{
-   struct fotg210_regs *regs = chip->regs;
-   uint32_t i;
-
-   chip->state = USB_STATE_POWERED;
-
-   /* chip enable */
-   writel(DEVCTRL_EN, ®s->dev_ctrl);
-
-   /* device address reset */
-   chip->addr = 0;
-   writel(0, ®s->dev_addr);
-
-   /* set idle counter to 7ms */
-   writel(7, ®s->idle);
-
-   /* disable all interrupts */
-   writel(IMR_MASK, ®s->imr);
-   writel(GIMR_MASK, ®s->gimr);
-   writel(GIMR0_MASK, ®s->gimr0);
-   writel(GIMR1_MASK, ®s->gimr1);
-   writel(GIMR2_MASK, ®s->gimr2);
-
-   /* clear interrupts */
-   writel(ISR_MASK, ®s->isr);
-   writel(0, ®s->gisr);
-   writel(0, ®s->gisr0);
-   writel(0, ®s->gisr1);
-   writel(0, ®s->gisr2);
-
-   /* chip reset */
-   setbits_le32(®s->dev_ctrl, DEVCTRL_RESET);
-   mdelay(10);
-   if (readl(®s->dev_ctrl) & DEVCTRL_

[PATCH 77/88] armada: usb: net: Drop unused USB drivers

2023-01-23 Thread Simon Glass
These are not used. Drop the drivers and Kconfig option. Also drop an
old declaration in the netdev.h header.

Signed-off-by: Simon Glass 
---

 drivers/usb/host/Makefile |  1 -
 drivers/usb/host/ehci-armada100.c | 48 ---
 drivers/usb/host/utmi-armada100.c | 80 ---
 include/netdev.h  |  1 -
 4 files changed, 130 deletions(-)
 delete mode 100644 drivers/usb/host/ehci-armada100.c
 delete mode 100644 drivers/usb/host/utmi-armada100.c

diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index ddc36632069..1f59e910d3b 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -25,7 +25,6 @@ obj-$(CONFIG_USB_OHCI_NPCM) += ohci-npcm.o
 
 # echi
 obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
-obj-$(CONFIG_USB_EHCI_ARMADA100) += ehci-armada100.o utmi-armada100.o
 obj-$(CONFIG_USB_EHCI_ATMEL) += ehci-atmel.o
 obj-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
 obj-$(CONFIG_USB_EHCI_FARADAY) += ehci-faraday.o
diff --git a/drivers/usb/host/ehci-armada100.c 
b/drivers/usb/host/ehci-armada100.c
deleted file mode 100644
index 2ce9f27b862..000
--- a/drivers/usb/host/ehci-armada100.c
+++ /dev/null
@@ -1,48 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2012
- * eInfochips Ltd. 
- * Written-by: Ajay Bhargav 
- *
- * This driver is based on Kirkwood echi driver
- * (C) Copyright 2009
- * Marvell Semiconductor 
- * Written-by: Prafulla Wadaskar 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include "ehci.h"
-#include 
-#include 
-#include 
-
-/*
- * EHCI host controller init
- */
-int ehci_hcd_init(int index, enum usb_init_type init,
-   struct ehci_hccr **hccr, struct ehci_hcor **hcor)
-{
-   if (utmi_init() < 0)
-   return -1;
-
-   *hccr = (struct ehci_hccr *)(ARMD1_USB_HOST_BASE + 0x100);
-   *hcor = (struct ehci_hcor *)((uint32_t) *hccr
-   + HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
-
-   debug("armada100-ehci: init hccr %x and hcor %x hc_length %d\n",
-   (uint32_t)*hccr, (uint32_t)*hcor,
-   (uint32_t)HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
-
-   return 0;
-}
-
-/*
- * EHCI host controller stop
- */
-int ehci_hcd_stop(int index)
-{
-   return 0;
-}
diff --git a/drivers/usb/host/utmi-armada100.c 
b/drivers/usb/host/utmi-armada100.c
deleted file mode 100644
index 5d66e5881f3..000
--- a/drivers/usb/host/utmi-armada100.c
+++ /dev/null
@@ -1,80 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2012
- * eInfochips Ltd. 
- * Written-by: Ajay Bhargav 
- *
- * (C) Copyright 2009
- * Marvell Semiconductor 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static int utmi_phy_init(void)
-{
-   struct armd1usb_phy_reg *phy_regs =
-   (struct armd1usb_phy_reg *)UTMI_PHY_BASE;
-   int timeout;
-
-   setbits_le32(&phy_regs->utmi_ctrl, INPKT_DELAY_SOF | PLL_PWR_UP);
-   udelay(1000);
-   setbits_le32(&phy_regs->utmi_ctrl, PHY_PWR_UP);
-
-   clrbits_le32(&phy_regs->utmi_pll, PLL_FBDIV_MASK | PLL_REFDIV_MASK);
-   setbits_le32(&phy_regs->utmi_pll, N_DIVIDER << PLL_FBDIV | M_DIVIDER);
-
-   setbits_le32(&phy_regs->utmi_tx, PHSEL_VAL << CK60_PHSEL);
-
-   /* Calibrate pll */
-   timeout = 1;
-   while (--timeout && ((readl(&phy_regs->utmi_pll) & PLL_READY) == 0))
-   ;
-   if (!timeout)
-   return -1;
-
-   udelay(200);
-   setbits_le32(&phy_regs->utmi_pll, VCOCAL_START);
-   udelay(400);
-   clrbits_le32(&phy_regs->utmi_pll, VCOCAL_START);
-
-   udelay(200);
-   setbits_le32(&phy_regs->utmi_tx, RCAL_START);
-   udelay(400);
-   clrbits_le32(&phy_regs->utmi_tx, RCAL_START);
-
-   timeout = 1;
-   while (--timeout && ((readl(&phy_regs->utmi_pll) & PLL_READY) == 0))
-   ;
-   if (!timeout)
-   return -1;
-
-   return 0;
-}
-
-/*
- * Initialize USB host controller's UTMI Physical interface
- */
-int utmi_init(void)
-{
-   struct armd1mpmu_registers *mpmu_regs =
-   (struct armd1mpmu_registers *)ARMD1_MPMU_BASE;
-
-   struct armd1apmu_registers *apmu_regs =
-   (struct armd1apmu_registers *)ARMD1_APMU_BASE;
-
-   /* Turn on 26Mhz ref clock for UTMI PLL */
-   setbits_le32(&mpmu_regs->acgr, APB2_26M_EN | AP_26M);
-
-   /* USB Clock reset */
-   writel(USB_SPH_AXICLK_EN, &apmu_regs->usbcrc);
-   writel(USB_SPH_AXICLK_EN | USB_SPH_AXI_RST, &apmu_regs->usbcrc);
-
-   /* Initialize UTMI transceiver */
-   return utmi_phy_init();
-}
diff --git a/include/netdev.h b/include/netdev.h
index 2b4e474ed08..2a7f40e5040 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -71,7 +71,6 @@ int skge_initialize(struct bd_info *bis);
 int smc9_initialize(u8 dev_num, phys_addr_t base_addr);
 int smc911x_initialize(u8 dev_num, phys_addr_t base_addr);
 int uli

[PATCH 71/88] gdsys: Drop unused fpga file

2023-01-23 Thread Simon Glass
This is not used since CONFIG_SYS_FPGA_COMMON is not defined anywhere.
Drop the code and the Makefile rule.

Signed-off-by: Simon Glass 
---

 board/gdsys/common/Makefile |  1 -
 board/gdsys/common/fpga.c   | 28 
 2 files changed, 29 deletions(-)
 delete mode 100644 board/gdsys/common/fpga.c

diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile
index 553e2ca50ed..94cbf3c5cc1 100644
--- a/board/gdsys/common/Makefile
+++ b/board/gdsys/common/Makefile
@@ -3,7 +3,6 @@
 # (C) Copyright 2007
 # Stefan Roese, DENX Software Engineering, s...@denx.de.
 
-obj-$(CONFIG_SYS_FPGA_COMMON) += fpga.o
 obj-$(CONFIG_CMD_IOLOOP) += cmd_ioloop.o
 obj-$(CONFIG_TARGET_CONTROLCENTERDC) += dp501.o
 obj-$(CONFIG_TARGET_GAZERBEAM) += osd.o ihs_mdio.o ioep-fpga.o
diff --git a/board/gdsys/common/fpga.c b/board/gdsys/common/fpga.c
deleted file mode 100644
index 5ba6613ed56..000
--- a/board/gdsys/common/fpga.c
+++ /dev/null
@@ -1,28 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2013
- * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
- */
-
-#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
-
-#include 
-#include 
-
-#include 
-
-int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data)
-{
-   out_le16(reg, data);
-
-   return 0;
-}
-
-int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data)
-{
-   *data = in_le16(reg);
-
-   return 0;
-}
-
-#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 73/88] compulab: Drop CONFIG_TARGET_MCM_IMX8M_MINI

2023-01-23 Thread Simon Glass
This option is not defined anywhere. Drop it.

Signed-off-by: Simon Glass 
---

 board/compulab/imx8mm-cl-iot-gate/ddr/Makefile | 4 
 1 file changed, 4 deletions(-)

diff --git a/board/compulab/imx8mm-cl-iot-gate/ddr/Makefile 
b/board/compulab/imx8mm-cl-iot-gate/ddr/Makefile
index 5914796628d..f73f35cd664 100644
--- a/board/compulab/imx8mm-cl-iot-gate/ddr/Makefile
+++ b/board/compulab/imx8mm-cl-iot-gate/ddr/Makefile
@@ -1,8 +1,4 @@
 obj-y += ddr.o
 obj-y += lpddr4_timing_ff020008.o
 obj-y += lpddr4_timing_ff000110.o
-ifdef CONFIG_TARGET_MCM_IMX8M_MINI
-obj-y += lpddr4_timing_01061010.o
-else
 obj-y += lpddr4_timing_01061010.1_2.o
-endif
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 68/88] arm: Rename STM32MP13x

2023-01-23 Thread Simon Glass
CONFIG options must not use lower-case letter. Convert this and related
ones to upper case.

Signed-off-by: Simon Glass 
---

 arch/arm/dts/Makefile  |  2 +-
 arch/arm/mach-stm32mp/Kconfig  |  4 ++--
 arch/arm/mach-stm32mp/Kconfig.13x  |  4 ++--
 arch/arm/mach-stm32mp/Makefile |  2 +-
 arch/arm/mach-stm32mp/cmd_stm32key.c   | 10 +-
 arch/arm/mach-stm32mp/fdt.c|  4 ++--
 arch/arm/mach-stm32mp/include/mach/stm32.h |  6 +++---
 board/st/common/Kconfig|  2 +-
 board/st/stm32mp1/Kconfig  |  2 +-
 configs/stm32mp13_defconfig|  4 ++--
 drivers/clk/stm32/Kconfig  |  2 +-
 11 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index c184c802b45..dc8dcdff218 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1215,7 +1215,7 @@ dtb-$(CONFIG_ASPEED_AST2600) += ast2600-evb.dtb
 
 dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
 
-dtb-$(CONFIG_STM32MP13x) += \
+dtb-$(CONFIG_STM32MP13X) += \
stm32mp135f-dk.dtb
 
 dtb-$(CONFIG_STM32MP15x) += \
diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index db47baba6d1..cf3196b3b3a 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -37,7 +37,7 @@ choice
prompt "Select STMicroelectronics STM32MPxxx Soc"
default STM32MP15x
 
-config STM32MP13x
+config STM32MP13X
bool "Support STMicroelectronics STM32MP13x Soc"
select ARM_SMCCC
select CPU_V7A
@@ -103,7 +103,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
 
 config STM32_ETZPC
bool "STM32 Extended TrustZone Protection"
-   depends on STM32MP15x || STM32MP13x
+   depends on STM32MP15x || STM32MP13X
default y
imply BOOTP_SERVERIP
help
diff --git a/arch/arm/mach-stm32mp/Kconfig.13x 
b/arch/arm/mach-stm32mp/Kconfig.13x
index acc02a5a187..4d74b35055b 100644
--- a/arch/arm/mach-stm32mp/Kconfig.13x
+++ b/arch/arm/mach-stm32mp/Kconfig.13x
@@ -1,10 +1,10 @@
-if STM32MP13x
+if STM32MP13X
 
 choice
prompt "STM32MP13x board select"
optional
 
-config TARGET_ST_STM32MP13x
+config TARGET_ST_STM32MP13X
bool "STMicroelectronics STM32MP13x boards"
imply BOOTSTAGE
imply CMD_BOOTSTAGE
diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile
index a19b2797c8b..90c7c121ec4 100644
--- a/arch/arm/mach-stm32mp/Makefile
+++ b/arch/arm/mach-stm32mp/Makefile
@@ -8,7 +8,7 @@ obj-y += dram_init.o
 obj-y += syscon.o
 obj-y += bsec.o
 
-obj-$(CONFIG_STM32MP13x) += stm32mp13x.o
+obj-$(CONFIG_STM32MP13X) += stm32mp13x.o
 obj-$(CONFIG_STM32MP15x) += stm32mp15x.o
 
 obj-$(CONFIG_STM32_ECDSA_VERIFY) += ecdsa_romapi.o
diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c 
b/arch/arm/mach-stm32mp/cmd_stm32key.c
index 85be8e23bdb..96407cd9b18 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32key.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32key.c
@@ -18,7 +18,7 @@
  * STM32MP13x: 0b11 = 0x3F for OTP_SECURED closed device
  */
 #define STM32_OTP_CLOSE_ID 0
-#define STM32_OTP_STM32MP13x_CLOSE_MASK0x3F
+#define STM32_OTP_STM32MP13X_CLOSE_MASK0x3F
 #define STM32_OTP_STM32MP15x_CLOSE_MASKBIT(6)
 
 /* PKH is the first element of the key list */
@@ -60,7 +60,7 @@ static u8 stm32key_index;
 
 static u8 get_key_nb(void)
 {
-   if (IS_ENABLED(CONFIG_STM32MP13x))
+   if (IS_ENABLED(CONFIG_STM32MP13X))
return ARRAY_SIZE(stm32mp13_list);
 
if (IS_ENABLED(CONFIG_STM32MP15x))
@@ -69,7 +69,7 @@ static u8 get_key_nb(void)
 
 static const struct stm32key *get_key(u8 index)
 {
-   if (IS_ENABLED(CONFIG_STM32MP13x))
+   if (IS_ENABLED(CONFIG_STM32MP13X))
return &stm32mp13_list[index];
 
if (IS_ENABLED(CONFIG_STM32MP15x))
@@ -78,8 +78,8 @@ static const struct stm32key *get_key(u8 index)
 
 static u32 get_otp_close_mask(void)
 {
-   if (IS_ENABLED(CONFIG_STM32MP13x))
-   return STM32_OTP_STM32MP13x_CLOSE_MASK;
+   if (IS_ENABLED(CONFIG_STM32MP13X))
+   return STM32_OTP_STM32MP13X_CLOSE_MASK;
 
if (IS_ENABLED(CONFIG_STM32MP15x))
return STM32_OTP_STM32MP15x_CLOSE_MASK;
diff --git a/arch/arm/mach-stm32mp/fdt.c b/arch/arm/mach-stm32mp/fdt.c
index 3b4c05d7451..6b69542ecfc 100644
--- a/arch/arm/mach-stm32mp/fdt.c
+++ b/arch/arm/mach-stm32mp/fdt.c
@@ -270,7 +270,7 @@ static int stm32_fdt_fixup_etzpc(void *fdt, int soc_node)
int offset, shift;
u32 addr, status, decprot[ETZPC_DECPROT_NB];
 
-   if (IS_ENABLED(CONFIG_STM32MP13x)) {
+   if (IS_ENABLED(CONFIG_STM32MP13X)) {
array = stm32mp13_ip_addr;
array_size = ARRAY_SIZE(stm32mp13_ip_addr);
}
@@ -491,7 +491,7 @@ int ft_system_setup(void *blob, struct bd_info *bd)
cpu = get_cpu_type();
get_soc_name(name);
 
-   if 

[PATCH 69/88] arm: Rename STM32MP15x

2023-01-23 Thread Simon Glass
CONFIG options must not use lower-case letter. Convert this and related
ones to upper case.

Signed-off-by: Simon Glass 
---

 arch/arm/dts/Makefile  |  2 +-
 arch/arm/dts/stm32mp15-u-boot.dtsi |  2 +-
 arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi   |  4 ++--
 arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi   |  4 ++--
 arch/arm/mach-stm32mp/Kconfig  |  6 +++---
 arch/arm/mach-stm32mp/Kconfig.15x  |  6 +++---
 arch/arm/mach-stm32mp/Makefile |  2 +-
 arch/arm/mach-stm32mp/cmd_stm32key.c   | 10 +-
 .../mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c |  2 +-
 .../arm/mach-stm32mp/cmd_stm32prog/stm32prog.c |  4 ++--
 .../arm/mach-stm32mp/cmd_stm32prog/stm32prog.h |  6 +++---
 arch/arm/mach-stm32mp/fdt.c|  8 
 arch/arm/mach-stm32mp/include/mach/stm32.h | 10 +-
 arch/arm/mach-stm32mp/include/mach/stm32prog.h |  2 +-
 board/st/common/Kconfig| 14 +++---
 board/st/common/stm32mp_mtdparts.c | 18 +-
 board/st/stm32mp1/Kconfig  |  2 +-
 board/st/stm32mp1/stm32mp1.c   |  6 +++---
 configs/stm32mp15_basic_defconfig  |  2 +-
 configs/stm32mp15_defconfig|  2 +-
 configs/stm32mp15_trusted_defconfig|  4 ++--
 drivers/clk/stm32/Kconfig  |  2 +-
 22 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index dc8dcdff218..3c3efa6d6a3 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1218,7 +1218,7 @@ dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
 dtb-$(CONFIG_STM32MP13X) += \
stm32mp135f-dk.dtb
 
-dtb-$(CONFIG_STM32MP15x) += \
+dtb-$(CONFIG_STM32MP15X) += \
stm32mp157a-dk1.dtb \
stm32mp157a-dk1-scmi.dtb \
stm32mp157a-icore-stm32mp1-ctouch2.dtb \
diff --git a/arch/arm/dts/stm32mp15-u-boot.dtsi 
b/arch/arm/dts/stm32mp15-u-boot.dtsi
index d5c87d29d88..955598b1c0b 100644
--- a/arch/arm/dts/stm32mp15-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp15-u-boot.dtsi
@@ -206,7 +206,7 @@
resets = <&rcc UART8_R>;
 };
 
-#if defined(CONFIG_STM32MP15x_STM32IMAGE)
+#if defined(CONFIG_STM32MP15X_STM32IMAGE)
 &binman {
u-boot-stm32 {
filename = "u-boot.stm32";
diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi 
b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
index 15a04ae927e..11062951923 100644
--- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi
@@ -21,13 +21,13 @@
st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | 
GPIO_PULL_UP)>;
};
 
-#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
+#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
config {
u-boot,mmc-env-partition = "ssbl";
};
 #endif
 
-#ifdef CONFIG_STM32MP15x_STM32IMAGE
+#ifdef CONFIG_STM32MP15X_STM32IMAGE
/* only needed for boot with TF-A, witout FIP support */
firmware {
optee {
diff --git a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi 
b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
index 408abaf52fa..cea661bce68 100644
--- a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi
@@ -20,13 +20,13 @@
st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | 
GPIO_PULL_UP)>;
};
 
-#if defined(CONFIG_STM32MP15x_STM32IMAGE) || defined(CONFIG_SPL)
+#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL)
config {
u-boot,mmc-env-partition = "ssbl";
};
 #endif
 
-#ifdef CONFIG_STM32MP15x_STM32IMAGE
+#ifdef CONFIG_STM32MP15X_STM32IMAGE
/* only needed for boot with TF-A, witout FIP support */
firmware {
optee {
diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index cf3196b3b3a..f88b7dbffbd 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -35,7 +35,7 @@ config ENV_SIZE
 
 choice
prompt "Select STMicroelectronics STM32MPxxx Soc"
-   default STM32MP15x
+   default STM32MP15X
 
 config STM32MP13X
bool "Support STMicroelectronics STM32MP13x Soc"
@@ -55,7 +55,7 @@ config STM32MP13X
support of STMicroelectronics SOC STM32MP13x family
STMicroelectronics MPU with core ARMv7
 
-config STM32MP15x
+config STM32MP15X
bool "Support STMicroelectronics STM32MP15x Soc"
select ARCH_SUPPORT_PSCI
select BINMAN
@@ -103,7 +103,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
 
 config STM32_ETZPC
bool "STM32 Extended TrustZone Protection"
-   depends on STM32MP15x || STM32MP13X
+   depends on STM32MP15X || STM32MP13X
default y
imply BOOTP_SERVERIP
help
diff --git a/arch/arm/mach-stm32mp/Kconfig.15x 
b/arch/arm/mach-stm32mp/Kconfig.15x
index 1d32f8bf339..71c14eb4

[PATCH 67/88] Drop ubsha1 tool

2023-01-23 Thread Simon Glass
This seems to have been used by ppc4xx which was removed a while back.
The Kconfig does not exist so it is never built. Drop it.

Signed-off-by: Simon Glass 
---

 Makefile |  3 --
 tools/.gitignore |  1 -
 tools/Makefile   |  6 
 tools/ubsha1.c   | 83 
 4 files changed, 93 deletions(-)
 delete mode 100644 tools/ubsha1.c

diff --git a/Makefile b/Makefile
index 59b5b108168..5c5b3d2d651 100644
--- a/Makefile
+++ b/Makefile
@@ -1449,9 +1449,6 @@ u-boot-with-spl.kwb: u-boot.bin spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
$(BOARD_SIZE_CHECK)
 
-u-boot.sha1:   u-boot.bin
-   tools/ubsha1 u-boot.bin
-
 u-boot.dis:u-boot
$(OBJDUMP) -d $< > $@
 
diff --git a/tools/.gitignore b/tools/.gitignore
index 28e8ce2a07a..788ea260a07 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -33,7 +33,6 @@
 /relocate-rela
 /spl_size_limit
 /sunxi-spl-image-builder
-/ubsha1
 /update_octeon_header
 /version.h
 /xway-swap-bytes
diff --git a/tools/Makefile b/tools/Makefile
index 2ee43dff542..0eadd8154a7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -29,7 +29,6 @@ CONFIG_CMD_LOADS = y
 CONFIG_CMD_NET = y
 CONFIG_XWAY_SWAP_BYTES = y
 CONFIG_NETCONSOLE = y
-CONFIG_SHA1_CHECK_UB_IMG = y
 CONFIG_ARCH_SUNXI = y
 endif
 
@@ -217,11 +216,6 @@ hostprogs-$(CONFIG_ARCH_SUNXI) += sunxi-spl-image-builder
 sunxi-spl-image-builder-objs := sunxi-spl-image-builder.o lib/bch.o
 
 hostprogs-$(CONFIG_NETCONSOLE) += ncb
-hostprogs-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1
-
-ubsha1-objs := os_support.o ubsha1.o lib/sha1.o
-
-HOSTCFLAGS_ubsha1.o := -pedantic
 
 hostprogs-$(CONFIG_ARCH_KIRKWOOD) += kwboot
 hostprogs-$(CONFIG_ARCH_MVEBU) += kwboot
diff --git a/tools/ubsha1.c b/tools/ubsha1.c
deleted file mode 100644
index 90a6f3f59d2..000
--- a/tools/ubsha1.c
+++ /dev/null
@@ -1,83 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2007
- * Heiko Schocher, DENX Software Engineering, 
- */
-
-#include "os_support.h"
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-int main (int argc, char **argv)
-{
-   unsigned char output[20];
-   int i, len;
-
-   char*imagefile;
-   char*cmdname = *argv;
-   unsigned char   *ptr;
-   unsigned char   *data;
-   struct stat sbuf;
-   unsigned char   *ptroff;
-   int ifd;
-   int off;
-
-   if (argc > 1) {
-   imagefile = argv[1];
-   ifd = open (imagefile, O_RDWR|O_BINARY);
-   if (ifd < 0) {
-   fprintf (stderr, "%s: Can't open %s: %s\n",
-   cmdname, imagefile, strerror(errno));
-   exit (EXIT_FAILURE);
-   }
-   if (fstat (ifd, &sbuf) < 0) {
-   fprintf (stderr, "%s: Can't stat %s: %s\n",
-   cmdname, imagefile, strerror(errno));
-   exit (EXIT_FAILURE);
-   }
-   len = sbuf.st_size;
-   ptr = (unsigned char *)mmap(0, len,
-   PROT_READ, MAP_SHARED, ifd, 0);
-   if (ptr == (unsigned char *)MAP_FAILED) {
-   fprintf (stderr, "%s: Can't read %s: %s\n",
-   cmdname, imagefile, strerror(errno));
-   exit (EXIT_FAILURE);
-   }
-
-   /* create a copy, so we can blank out the sha1 sum */
-   data = malloc (len);
-   memcpy (data, ptr, len);
-   off = SHA1_SUM_POS;
-   ptroff = &data[len +  off];
-   for (i = 0; i < SHA1_SUM_LEN; i++) {
-   ptroff[i] = 0;
-   }
-
-   sha1_csum ((unsigned char *) data, len, (unsigned char 
*)output);
-
-   printf ("U-Boot sum:\n");
-   for (i = 0; i < 20 ; i++) {
-   printf ("%02X ", output[i]);
-   }
-   printf ("\n");
-   /* overwrite the sum in the bin file, with the actual */
-   lseek (ifd, SHA1_SUM_POS, SEEK_END);
-   if (write (ifd, output, SHA1_SUM_LEN) != SHA1_SUM_LEN) {
-   fprintf (stderr, "%s: Can't write %s: %s\n",
-   cmdname, imagefile, strerror(errno));
-   exit (EXIT_FAILURE);
-   }
-
-   free (data);
-   (void) munmap((void *)ptr, len);
-   (void) close (ifd);
-   }
-
-   return EXIT_SUCCESS;
-}
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 62/88] rtc: Drop old and unused drivers

2023-01-23 Thread Simon Glass
These drivers are not used and have not been converted to driver model.
Drop them and references to the non-existent CONFIG options they use.

Signed-off-by: Simon Glass 
---

 drivers/rtc/Makefile   |  14 --
 drivers/rtc/at91sam9_rtt.c |  78 ---
 drivers/rtc/ds1302.c   | 329 
 drivers/rtc/ds1306.c   | 438 -
 drivers/rtc/ftrtc010.c | 122 ---
 drivers/rtc/imxdi.c| 223 ---
 drivers/rtc/max6900.c  | 105 -
 drivers/rtc/mk48t59.c  | 175 ---
 drivers/rtc/mx27rtc.c  |  64 --
 drivers/rtc/rs5c372.c  | 256 --
 drivers/rtc/s3c24x0_rtc.c  | 149 -
 drivers/rtc/x1205.c| 161 --
 12 files changed, 2114 deletions(-)
 delete mode 100644 drivers/rtc/at91sam9_rtt.c
 delete mode 100644 drivers/rtc/ds1302.c
 delete mode 100644 drivers/rtc/ds1306.c
 delete mode 100644 drivers/rtc/ftrtc010.c
 delete mode 100644 drivers/rtc/imxdi.c
 delete mode 100644 drivers/rtc/max6900.c
 delete mode 100644 drivers/rtc/mk48t59.c
 delete mode 100644 drivers/rtc/mx27rtc.c
 delete mode 100644 drivers/rtc/rs5c372.c
 delete mode 100644 drivers/rtc/s3c24x0_rtc.c
 delete mode 100644 drivers/rtc/x1205.c

diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index acfd130bbc9..447551e15aa 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -6,49 +6,35 @@
 
 obj-$(CONFIG_$(SPL_TPL_)DM_RTC) += rtc-uclass.o
 
-obj-$(CONFIG_RTC_AT91SAM9_RTT) += at91sam9_rtt.o
 obj-$(CONFIG_RTC_ARMADA38X) += armada38x.o
 obj-$(CONFIG_RTC_DAVINCI) += davinci.o
-obj-$(CONFIG_RTC_DS1302) += ds1302.o
-obj-$(CONFIG_RTC_DS1306) += ds1306.o
 obj-$(CONFIG_RTC_DS1307) += ds1307.o
 obj-$(CONFIG_RTC_DS1338) += ds1307.o
-obj-$(CONFIG_RTC_DS1339) += ds1307.o
 obj-$(CONFIG_RTC_DS1337) += ds1337.o
 obj-$(CONFIG_RTC_DS1374) += ds1374.o
-obj-$(CONFIG_RTC_DS1388) += ds1337.o
 obj-$(CONFIG_RTC_DS3231) += ds3231.o
 obj-$(CONFIG_RTC_DS3232) += ds3232.o
 obj-$(CONFIG_RTC_EMULATION) += emul_rtc.o
-obj-$(CONFIG_RTC_FTRTC010) += ftrtc010.o
 obj-$(CONFIG_RTC_HT1380) += ht1380.o
 obj-$(CONFIG_SANDBOX) += i2c_rtc_emul.o
-obj-$(CONFIG_RTC_IMXDI) += imxdi.o
 obj-$(CONFIG_RTC_ISL1208) += isl1208.o
 obj-$(CONFIG_RTC_M41T62) += m41t62.o
-obj-$(CONFIG_RTC_MAX6900) += max6900.o
 obj-$(CONFIG_RTC_MC13XXX) += mc13xxx-rtc.o
 obj-$(CONFIG_RTC_MC146818) += mc146818.o
-obj-$(CONFIG_RTC_MCP79411) += ds1307.o
 obj-$(CONFIG_MCFRTC) += mcfrtc.o
-obj-$(CONFIG_RTC_MK48T59) += mk48t59.o
 obj-$(CONFIG_RTC_MV) += mvrtc.o
-obj-$(CONFIG_RTC_MX27) += mx27rtc.o
 obj-$(CONFIG_RTC_MXS) += mxsrtc.o
 obj-$(CONFIG_RTC_PCF8563) += pcf8563.o
 obj-$(CONFIG_RTC_PCF2127) += pcf2127.o
 obj-$(CONFIG_RTC_PL031) += pl031.o
 obj-$(CONFIG_RTC_PT7C4338) += pt7c4338.o
-obj-$(CONFIG_RTC_RS5C372A) += rs5c372.o
 obj-$(CONFIG_RTC_RV3028) += rv3028.o
 obj-$(CONFIG_RTC_RV3029) += rv3029.o
 obj-$(CONFIG_RTC_RV8803) += rv8803.o
 obj-$(CONFIG_RTC_RX8025) += rx8025.o
 obj-$(CONFIG_RTC_RX8010SJ) += rx8010sj.o
-obj-$(CONFIG_RTC_S3C24X0) += s3c24x0_rtc.o
 obj-$(CONFIG_RTC_S35392A) += s35392a.o
 obj-$(CONFIG_RTC_STM32) += stm32_rtc.o
 obj-$(CONFIG_SANDBOX) += sandbox_rtc.o
-obj-$(CONFIG_RTC_X1205) += x1205.o
 obj-$(CONFIG_RTC_ABX80X) += abx80x.o
 obj-$(CONFIG_RTC_ZYNQMP) += zynqmp_rtc.o
diff --git a/drivers/rtc/at91sam9_rtt.c b/drivers/rtc/at91sam9_rtt.c
deleted file mode 100644
index 6f92660ef1d..000
--- a/drivers/rtc/at91sam9_rtt.c
+++ /dev/null
@@ -1,78 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2010
- * Reinhard Meyer, reinhard.me...@emk-elektronik.de
- */
-
-/*
- * Date & Time support for the internal Real-time Timer
- * of AT91SAM9260 and compatibles.
- * Compatible with the LinuX rtc driver workaround:
- * The RTT cannot be written to, but only reset.
- * The actual time is the sum of RTT and one of
- * the four GPBR registers.
- *
- * The at91sam9260 has 4 GPBR (0-3).
- * For their typical use see at91_gpbr.h !
- *
- * make sure u-boot and kernel use the same GPBR !
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-int rtc_get (struct rtc_time *tmp)
-{
-   at91_rtt_t *rtt = (at91_rtt_t *) ATMEL_BASE_RTT;
-   at91_gpbr_t *gpbr = (at91_gpbr_t *) ATMEL_BASE_GPBR;
-   ulong tim;
-   ulong tim2;
-   ulong off;
-
-   do {
-   tim = readl(&rtt->vr);
-   tim2 = readl(&rtt->vr);
-   } while (tim!=tim2);
-   off = readl(&gpbr->reg[AT91_GPBR_INDEX_TIMEOFF]);
-   /* off==0 means time is invalid, but we ignore that */
-   rtc_to_tm(tim+off, tmp);
-   return 0;
-}
-
-int rtc_set (struct rtc_time *tmp)
-{
-   at91_rtt_t *rtt = (at91_rtt_t *) ATMEL_BASE_RTT;
-   at91_gpbr_t *gpbr = (at91_gpbr_t *) ATMEL_BASE_GPBR;
-   ulong tim;
-
-   tim = rtc_mktime(tmp);
-
-   /* clear alarm, set prescaler to 32768, clear counter */
-   writel(32768+AT91_RTT_RTTRST, &rtt->mr);
-   writel(

[PATCH 66/88] sh4: Drop unused pci_sh7780 driver

2023-01-23 Thread Simon Glass
This is not used. Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 arch/sh/include/asm/pci.h |  2 -
 drivers/pci/Makefile  |  1 -
 drivers/pci/pci_sh7780.c  | 92 ---
 3 files changed, 95 deletions(-)
 delete mode 100644 drivers/pci/pci_sh7780.c

diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index 5d79d0ec58e..18b95ff5cfb 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -13,8 +13,6 @@
 #include 
 #if defined(CONFIG_SH7751_PCI)
 int pci_sh7751_init(struct pci_controller *hose);
-#elif defined(CONFIG_SH7780_PCI)
-int pci_sh7780_init(struct pci_controller *hose);
 #else
 #error "Not support PCI."
 #endif
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index dd1ad91cede..fdad33697e8 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -21,7 +21,6 @@ obj-$(CONFIG_PCI_MVEBU) += pci_mvebu.o
 obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o
 obj-$(CONFIG_PCI_RCAR_GEN3) += pci-rcar-gen3.o
 obj-$(CONFIG_SH7751_PCI) +=pci_sh7751.o
-obj-$(CONFIG_SH7780_PCI) +=pci_sh7780.o
 obj-$(CONFIG_PCI_TEGRA) += pci_tegra.o
 obj-$(CONFIG_PCIE_IPROC) += pcie_iproc.o
 obj-$(CONFIG_PCI_AARDVARK) += pci-aardvark.o
diff --git a/drivers/pci/pci_sh7780.c b/drivers/pci/pci_sh7780.c
deleted file mode 100644
index 7533286c015..000
--- a/drivers/pci/pci_sh7780.c
+++ /dev/null
@@ -1,92 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * SH7780 PCI Controller (PCIC) for U-Boot.
- * (C) Dustin McIntire (dus...@sensoria.com)
- * (C) 2007,2008 Nobuhiro Iwamatsu 
- * (C) 2008 Yusuke Goda 
- */
-
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-
-#define SH7780_VENDOR_ID   0x1912
-#define SH7780_DEVICE_ID   0x0002
-#define SH7780_PCICR_PREFIX0xA500
-#define SH7780_PCICR_PFCS  0x0800
-#define SH7780_PCICR_FTO   0x0400
-#define SH7780_PCICR_PFE   0x0200
-#define SH7780_PCICR_TBS   0x0100
-#define SH7780_PCICR_ARBM  0x0040
-#define SH7780_PCICR_IOCS  0x0004
-#define SH7780_PCICR_PRST  0x0002
-#define SH7780_PCICR_CFIN  0x0001
-
-#define p4_in(addr)(*(vu_long *)addr)
-#define p4_out(data, addr) (*(vu_long *)addr) = (data)
-#define p4_inw(addr)   (*(vu_short *)addr)
-#define p4_outw(data, addr)(*(vu_short *)addr) = (data)
-
-int pci_sh4_read_config_dword(struct pci_controller *hose,
-   pci_dev_t dev, int offset, u32 *value)
-{
-   u32 par_data = PCI_CONF1_ADDRESS(PCI_BUS(dev), PCI_DEV(dev), 
PCI_FUNC(dev), offset);
-
-   p4_out(par_data, SH7780_PCIPAR);
-   *value = p4_in(SH7780_PCIPDR);
-
-   return 0;
-}
-
-int pci_sh4_write_config_dword(struct pci_controller *hose,
-pci_dev_t dev, int offset, u32 value)
-{
-   u32 par_data = PCI_CONF1_ADDRESS(PCI_BUS(dev), PCI_DEV(dev), 
PCI_FUNC(dev), offset);
-
-   p4_out(par_data, SH7780_PCIPAR);
-   p4_out(value, SH7780_PCIPDR);
-   return 0;
-}
-
-int pci_sh7780_init(struct pci_controller *hose)
-{
-   p4_out(0x01, SH7780_PCIECR);
-
-   if (p4_inw(SH7780_PCIVID) != SH7780_VENDOR_ID
-   && p4_inw(SH7780_PCIDID) != SH7780_DEVICE_ID) {
-   printf("PCI: Unknown PCI host bridge.\n");
-   return -1;
-   }
-   printf("PCI: SH7780 PCI host bridge found.\n");
-
-   /* Toggle PCI reset pin */
-   p4_out((SH7780_PCICR_PREFIX | SH7780_PCICR_PRST), SH7780_PCICR);
-   udelay(10);
-   p4_out(SH7780_PCICR_PREFIX, SH7780_PCICR);
-   p4_outw(0x0047, SH7780_PCICMD);
-
-   p4_out(CONFIG_SH7780_PCI_LSR, SH7780_PCILSR0);
-   p4_out(CONFIG_SH7780_PCI_LAR, SH7780_PCILAR0);
-   p4_out(0x, SH7780_PCILSR1);
-   p4_out(0, SH7780_PCILAR1);
-   p4_out(CONFIG_SH7780_PCI_BAR, SH7780_PCIMBAR0);
-   p4_out(0x, SH7780_PCIMBAR1);
-
-   p4_out(0xFD00, SH7780_PCIMBR0);
-   p4_out(0x00FC, SH7780_PCIMBMR0);
-
-   /* if use Operand Cache then enable PCICSCR Soonp bits. */
-   p4_out(0x0800, SH7780_PCICSAR0);
-   p4_out(0x001B, SH7780_PCICSCR0);/* Snoop bit :On */
-
-   p4_out((SH7780_PCICR_PREFIX | SH7780_PCICR_CFIN | SH7780_PCICR_ARBM
- | SH7780_PCICR_FTO | SH7780_PCICR_PFCS | SH7780_PCICR_PFE),
-SH7780_PCICR);
-
-   pci_sh4_init(hose);
-   return 0;
-}
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 64/88] mtd: Drop unused scf0403_lcd driver

2023-01-23 Thread Simon Glass
This is not used since this commit:

   76386d6195a arm: Remove cm_t35 board

Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 drivers/video/Makefile  |   1 -
 drivers/video/scf0403_lcd.c | 297 
 include/scf0403_lcd.h   |  10 --
 3 files changed, 308 deletions(-)
 delete mode 100644 drivers/video/scf0403_lcd.c
 delete mode 100644 include/scf0403_lcd.h

diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 12b68cdd068..ce2d61d56bc 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -34,7 +34,6 @@ obj-$(CONFIG_LOGICORE_DP_TX) += logicore_dp_tx.o
 obj-$(CONFIG_NXP_TDA19988) += tda19988.o
 obj-$(CONFIG_OSD) += video_osd-uclass.o
 obj-$(CONFIG_SANDBOX_OSD) += sandbox_osd.o
-obj-$(CONFIG_SCF0403_LCD) += scf0403_lcd.o
 obj-$(CONFIG_VIDEO_ARM_MALIDP) += mali_dp.o
 obj-$(CONFIG_VIDEO_BCM2835) += bcm2835.o
 obj-$(CONFIG_VIDEO_BROADWELL_IGD) += broadwell_igd.o
diff --git a/drivers/video/scf0403_lcd.c b/drivers/video/scf0403_lcd.c
deleted file mode 100644
index 54f0f88b4c9..000
--- a/drivers/video/scf0403_lcd.c
+++ /dev/null
@@ -1,297 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * scf0403.c -- support for DataImage SCF0403 LCD
- *
- * Copyright (c) 2013 Adapted from Linux driver:
- * Copyright (c) 2012 Anders Electronics plc. All Rights Reserved.
- * Copyright (c) 2012 CompuLab, Ltd
- *   Dmitry Lifshitz 
- *   Ilya Ledvich 
- * Inspired by Alberto Panizzo  &
- * Marek Vasut work in l4f00242t03.c
- *
- * U-Boot port: Nikita Kiryanov 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-struct scf0403_cmd {
-   u16 cmd;
-   u16 *params;
-   int count;
-};
-
-struct scf0403_initseq_entry {
-   struct scf0403_cmd cmd;
-   int delay_ms;
-};
-
-struct scf0403_priv {
-   struct spi_slave *spi;
-   unsigned int reset_gpio;
-   u32 rddid;
-   struct scf0403_initseq_entry *init_seq;
-   int seq_size;
-};
-
-struct scf0403_priv priv;
-
-#define SCF0403852GGU04_ID 0x80
-
-/* SCF0403526GGU20 model commands parameters */
-static u16 extcmd_params_sn20[]= {0xff, 0x98, 0x06};
-static u16 spiinttype_params_sn20[]= {0x60};
-static u16 bc_params_sn20[]= {
-   0x01, 0x10, 0x61, 0x74, 0x01, 0x01, 0x1B,
-   0x12, 0x71, 0x00, 0x00, 0x00, 0x01, 0x01,
-   0x05, 0x00, 0xFF, 0xF2, 0x01, 0x00, 0x40,
-};
-static u16 bd_params_sn20[] = {0x01, 0x23, 0x45, 0x67, 0x01, 0x23, 0x45, 0x67};
-static u16 be_params_sn20[] = {
-   0x01, 0x22, 0x22, 0xBA, 0xDC, 0x26, 0x28, 0x22, 0x22,
-};
-static u16 vcom_params_sn20[]  = {0x74};
-static u16 vmesur_params_sn20[]= {0x7F, 0x0F, 0x00};
-static u16 powerctl_params_sn20[]  = {0x03, 0x0b, 0x00};
-static u16 lvglvolt_params_sn20[]  = {0x08};
-static u16 engsetting_params_sn20[]= {0x00, 0x00, 0x00, 0x00, 0x00, 0x20};
-static u16 dispfunc_params_sn20[]  = {0xa0};
-static u16 dvddvolt_params_sn20[]  = {0x74};
-static u16 dispinv_params_sn20[]   = {0x00, 0x00, 0x00};
-static u16 panelres_params_sn20[]  = {0x82};
-static u16 framerate_params_sn20[] = {0x00, 0x13, 0x13};
-static u16 timing_params_sn20[]= {0x80, 0x05, 0x40, 0x28};
-static u16 powerctl2_params_sn20[] = {0x17, 0x75, 0x79, 0x20};
-static u16 memaccess_params_sn20[] = {0x00};
-static u16 pixfmt_params_sn20[]= {0x66};
-static u16 pgamma_params_sn20[]= {
-   0x00, 0x03, 0x0b, 0x0c, 0x0e, 0x08, 0xc5, 0x04,
-   0x08, 0x0c, 0x13, 0x11, 0x11, 0x14, 0x0c, 0x10,
-};
-static u16 ngamma_params_sn20[] = {
-   0x00, 0x0d, 0x11, 0x0c, 0x0c, 0x04, 0x76, 0x03,
-   0x08, 0x0b, 0x16, 0x10, 0x0d, 0x16, 0x0a, 0x00,
-};
-static u16 tearing_params_sn20[] = {0x00};
-
-/* SCF0403852GGU04 model commands parameters */
-static u16 memaccess_params_sn04[] = {0x08};
-static u16 pixfmt_params_sn04[]= {0x66};
-static u16 modectl_params_sn04[]   = {0x01};
-static u16 dispfunc_params_sn04[]  = {0x22, 0xe2, 0xFF, 0x04};
-static u16 vcom_params_sn04[]  = {0x00, 0x6A};
-static u16 pgamma_params_sn04[]= {
-   0x00, 0x07, 0x0d, 0x10, 0x13, 0x19, 0x0f, 0x0c,
-   0x05, 0x08, 0x06, 0x13, 0x0f, 0x30, 0x20, 0x1f,
-};
-static u16 ngamma_params_sn04[]= {
-   0x1F, 0x20, 0x30, 0x0F, 0x13, 0x06, 0x08, 0x05,
-   0x0C, 0x0F, 0x19, 0x13, 0x10, 0x0D, 0x07, 0x00,
-};
-static u16 dispinv_params_sn04[]   = {0x02};
-
-/* Common commands */
-static struct scf0403_cmd scf0403_cmd_slpout   = {0x11, NULL, 0};
-static struct scf0403_cmd scf0403_cmd_dison= {0x29, NULL, 0};
-
-/* SCF0403852GGU04 init sequence */
-static struct scf0403_initseq_entry scf0403_initseq_sn04[] = {
-   {{0x36, memaccess_params_sn04,  ARRAY_SIZE(memaccess_params_sn04)}, 0},
-   {{0x3A, pixfmt_pa

[PATCH 56/88] power: Drop unused bat_trats driver and battery code

2023-01-23 Thread Simon Glass
This driver and bat_trats2 are not used. Drop them and the entire battery
directory, since there is nothing left.

Signed-off-by: Simon Glass 
---

 drivers/power/Makefile |  1 -
 drivers/power/battery/Makefile |  7 ---
 drivers/power/battery/bat_trats.c  | 91 --
 drivers/power/battery/bat_trats2.c | 65 -
 4 files changed, 164 deletions(-)
 delete mode 100644 drivers/power/battery/Makefile
 delete mode 100644 drivers/power/battery/bat_trats.c
 delete mode 100644 drivers/power/battery/bat_trats2.c

diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 34a84808a9c..efdae3655ac 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -4,7 +4,6 @@
 # Tom Rix 
 
 obj-$(CONFIG_$(SPL_TPL_)ACPI_PMC) += acpi_pmc/
-obj-y += battery/
 obj-$(CONFIG_$(SPL_TPL_)POWER_DOMAIN) += domain/
 obj-y += fuel_gauge/
 obj-y += mfd/
diff --git a/drivers/power/battery/Makefile b/drivers/power/battery/Makefile
deleted file mode 100644
index 370923a6ed9..000
--- a/drivers/power/battery/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# Copyright (C) 2012 Samsung Electronics
-# Lukasz Majewski 
-
-obj-$(CONFIG_POWER_BATTERY_TRATS) += bat_trats.o
-obj-$(CONFIG_POWER_BATTERY_TRATS2) += bat_trats2.o
diff --git a/drivers/power/battery/bat_trats.c 
b/drivers/power/battery/bat_trats.c
deleted file mode 100644
index 54b2bf91e5c..000
--- a/drivers/power/battery/bat_trats.c
+++ /dev/null
@@ -1,91 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- *  Copyright (C) 2012 Samsung Electronics
- *  Lukasz Majewski 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static struct battery battery_trats;
-
-static int power_battery_charge(struct pmic *bat)
-{
-   struct power_battery *p_bat = bat->pbat;
-   struct battery *battery = p_bat->bat;
-   int k;
-
-   if (bat->chrg->chrg_state(p_bat->chrg, PMIC_CHARGER_ENABLE, 450))
-   return -1;
-
-   for (k = 0; bat->chrg->chrg_bat_present(p_bat->chrg) &&
-bat->chrg->chrg_type(p_bat->muic) &&
-battery->state_of_chrg < 100; k++) {
-   udelay(200);
-   if (!(k % 5))
-   puts(".");
-   bat->fg->fg_battery_update(p_bat->fg, bat);
-
-   if (k == 200) {
-   debug(" %d [V]", battery->voltage_uV);
-   puts("\n");
-   k = 0;
-   }
-
-   if (ctrlc()) {
-   printf("\nCharging disabled on request.\n");
-   goto exit;
-   }
-   }
- exit:
-   bat->chrg->chrg_state(p_bat->chrg, PMIC_CHARGER_DISABLE, 0);
-
-   return 0;
-}
-
-static int power_battery_init_trats(struct pmic *bat_,
-   struct pmic *fg_,
-   struct pmic *chrg_,
-   struct pmic *muic_)
-{
-   bat_->pbat->fg = fg_;
-   bat_->pbat->chrg = chrg_;
-   bat_->pbat->muic = muic_;
-
-   bat_->fg = fg_->fg;
-   bat_->chrg = chrg_->chrg;
-   bat_->chrg->chrg_type = muic_->chrg->chrg_type;
-   return 0;
-}
-
-static struct power_battery power_bat_trats = {
-   .bat = &battery_trats,
-   .battery_init = power_battery_init_trats,
-   .battery_charge = power_battery_charge,
-};
-
-int power_bat_init(unsigned char bus)
-{
-   static const char name[] = "BAT_TRATS";
-   struct pmic *p = pmic_alloc();
-
-   if (!p) {
-   printf("%s: POWER allocation error!\n", __func__);
-   return -ENOMEM;
-   }
-
-   debug("Board BAT init\n");
-
-   p->interface = PMIC_NONE;
-   p->name = name;
-   p->bus = bus;
-
-   p->pbat = &power_bat_trats;
-   return 0;
-}
diff --git a/drivers/power/battery/bat_trats2.c 
b/drivers/power/battery/bat_trats2.c
deleted file mode 100644
index 1172970d1e0..000
--- a/drivers/power/battery/bat_trats2.c
+++ /dev/null
@@ -1,65 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- *  Copyright (C) 2013 Samsung Electronics
- *  Piotr Wilczek 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static struct battery battery_trats;
-
-static int power_battery_charge(struct pmic *bat)
-{
-   struct power_battery *p_bat = bat->pbat;
-
-   if (bat->chrg->chrg_state(p_bat->chrg, PMIC_CHARGER_ENABLE, 450))
-   return -EINVAL;
-
-   return 0;
-}
-
-static int power_battery_init_trats2(struct pmic *bat_,
-   struct pmic *fg_,
-   struct pmic *chrg_,
-   struct pmic *muic_)
-{
-   bat_->pbat->fg = fg_;
-   bat_->pbat->chrg = chrg_;
-   bat_->pbat->muic = muic_;
-
-   bat_->fg = fg_->fg;
-   bat_->chrg = chrg_->chrg;
-   bat_->chrg->chrg_typ

[PATCH 63/88] mtd: Drop unused CONFIG_S32V234

2023-01-23 Thread Simon Glass
This option does not exist, so the Makefile rule does nothing. Drop it.

Signed-off-by: Simon Glass 
---

 arch/arm/cpu/armv8/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile
index 2e4bf9e038c..bba4f570dbb 100644
--- a/arch/arm/cpu/armv8/Makefile
+++ b/arch/arm/cpu/armv8/Makefile
@@ -39,7 +39,6 @@ obj-$(CONFIG_SPL_RECOVER_DATA_SECTION) += spl_data.o
 endif
 
 obj-$(CONFIG_FSL_LAYERSCAPE) += fsl-layerscape/
-obj-$(CONFIG_S32V234) += s32v234/
 obj-$(CONFIG_TARGET_HIKEY) += hisilicon/
 obj-$(CONFIG_ARMV8_PSCI) += psci.o
 obj-$(CONFIG_TARGET_BCMNS3) += bcmns3/
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 78/88] usb: Drop unused ehci-faraday driver

2023-01-23 Thread Simon Glass
This is not used. Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 common/usb_hub.c|  18 
 drivers/usb/host/Makefile   |   1 -
 drivers/usb/host/ehci-faraday.c | 144 
 drivers/usb/host/ehci-hcd.c |   5 --
 include/usb/fusbh200.h  |  59 -
 5 files changed, 227 deletions(-)
 delete mode 100644 drivers/usb/host/ehci-faraday.c
 delete mode 100644 include/usb/fusbh200.h

diff --git a/common/usb_hub.c b/common/usb_hub.c
index f7fd12c0450..a36350f846c 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -506,24 +506,6 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
if (portchange & USB_PORT_STAT_C_ENABLE) {
debug("port %d enable change, status %x\n", i + 1, portstatus);
usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_ENABLE);
-   /*
-* The following hack causes a ghost device problem
-* to Faraday EHCI
-*/
-#ifndef CONFIG_USB_EHCI_FARADAY
-   /*
-* EM interference sometimes causes bad shielded USB
-* devices to be shutdown by the hub, this hack enables
-* them again. Works at least with mouse driver
-*/
-   if (!(portstatus & USB_PORT_STAT_ENABLE) &&
-   (portstatus & USB_PORT_STAT_CONNECTION) &&
-   usb_device_has_child_on_port(dev, i)) {
-   debug("already running port %i disabled by hub (EMI?), 
re-enabling...\n",
- i + 1);
-   usb_hub_port_connect_change(dev, i);
-   }
-#endif
}
 
if (portstatus & USB_PORT_STAT_SUSPEND) {
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 1f59e910d3b..cce78846d98 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -27,7 +27,6 @@ obj-$(CONFIG_USB_OHCI_NPCM) += ohci-npcm.o
 obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
 obj-$(CONFIG_USB_EHCI_ATMEL) += ehci-atmel.o
 obj-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
-obj-$(CONFIG_USB_EHCI_FARADAY) += ehci-faraday.o
 obj-$(CONFIG_USB_EHCI_GENERIC) += ehci-generic.o
 obj-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o
 obj-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o
diff --git a/drivers/usb/host/ehci-faraday.c b/drivers/usb/host/ehci-faraday.c
deleted file mode 100644
index 85a35269601..000
--- a/drivers/usb/host/ehci-faraday.c
+++ /dev/null
@@ -1,144 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Faraday USB 2.0 EHCI Controller
- *
- * (C) Copyright 2010 Faraday Technology
- * Dante Su 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "ehci.h"
-
-#ifndef CFG_USB_EHCI_BASE_LIST
-#define CFG_USB_EHCI_BASE_LIST { CONFIG_USB_EHCI_BASE }
-#endif
-
-union ehci_faraday_regs {
-   struct fusbh200_regs usb;
-   struct fotg210_regs  otg;
-};
-
-static inline int ehci_is_fotg2xx(union ehci_faraday_regs *regs)
-{
-   return !readl(®s->usb.easstr);
-}
-
-void faraday_ehci_set_usbmode(struct ehci_ctrl *ctrl)
-{
-   /* nothing needs to be done */
-}
-
-int faraday_ehci_get_port_speed(struct ehci_ctrl *ctrl, uint32_t reg)
-{
-   int spd, ret = PORTSC_PSPD_HS;
-   union ehci_faraday_regs *regs;
-
-   ret = (void __iomem *)((ulong)ctrl->hcor - 0x10);
-   if (ehci_is_fotg2xx(regs))
-   spd = OTGCSR_SPD(readl(®s->otg.otgcsr));
-   else
-   spd = BMCSR_SPD(readl(®s->usb.bmcsr));
-
-   switch (spd) {
-   case 0:/* full speed */
-   ret = PORTSC_PSPD_FS;
-   break;
-   case 1:/* low  speed */
-   ret = PORTSC_PSPD_LS;
-   break;
-   case 2:/* high speed */
-   ret = PORTSC_PSPD_HS;
-   break;
-   default:
-   printf("ehci-faraday: invalid device speed\n");
-   break;
-   }
-
-   return ret;
-}
-
-uint32_t *faraday_ehci_get_portsc_register(struct ehci_ctrl *ctrl, int port)
-{
-   /* Faraday EHCI has one and only one portsc register */
-   if (port) {
-   /* Printing the message would cause a scan failure! */
-   debug("The request port(%d) is not configured\n", port);
-   return NULL;
-   }
-
-   /* Faraday EHCI PORTSC register offset is 0x20 from hcor */
-   return (uint32_t *)((uint8_t *)ctrl->hcor + 0x20);
-}
-
-static const struct ehci_ops faraday_ehci_ops = {
-   .set_usb_mode   = faraday_ehci_set_usbmode,
-   .get_port_speed = faraday_ehci_get_port_speed,
-   .get_portsc_register= faraday_ehci_get_portsc_register,
-};
-
-/*
- * Create the appropriate control structures to manage
- * a new EHCI host controller.
- */
-int ehci_hcd_init(int index, enum usb_init_type init,
-   struct ehci_hccr **ret_hccr, struct ehci_hcor **ret_hcor)
-{
-   struct eh

[PATCH 81/88] usb: Drop unused ehci-vct driver

2023-01-23 Thread Simon Glass
This is not used. Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 drivers/usb/host/Makefile   |  1 -
 drivers/usb/host/ehci-vct.c | 44 -
 2 files changed, 45 deletions(-)
 delete mode 100644 drivers/usb/host/ehci-vct.c

diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 3d3dd5f279f..3e5ba2bd0ba 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -39,7 +39,6 @@ obj-$(CONFIG_USB_EHCI_MARVELL) += ehci-marvell.o
 obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o
 obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
 obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o
-obj-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o
 obj-$(CONFIG_USB_EHCI_VF) += ehci-vf.o
 obj-$(CONFIG_USB_EHCI_ZYNQ) += ehci-zynq.o
 
diff --git a/drivers/usb/host/ehci-vct.c b/drivers/usb/host/ehci-vct.c
deleted file mode 100644
index 7167f82b481..000
--- a/drivers/usb/host/ehci-vct.c
+++ /dev/null
@@ -1,44 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2009 Stefan Roese , DENX Software Engineering
- */
-
-#include 
-#include 
-
-#include "ehci.h"
-
-int vct_ehci_hcd_init(u32 *hccr, u32 *hcor);
-
-/*
- * Create the appropriate control structures to manage
- * a new EHCI host controller.
- */
-int ehci_hcd_init(int index, enum usb_init_type init,
-   struct ehci_hccr **hccr, struct ehci_hcor **hcor)
-{
-   int ret;
-   u32 vct_hccr;
-   u32 vct_hcor;
-
-   /*
-* Init VCT specific stuff
-*/
-   ret = vct_ehci_hcd_init(&vct_hccr, &vct_hcor);
-   if (ret)
-   return ret;
-
-   *hccr = (struct ehci_hccr *)vct_hccr;
-   *hcor = (struct ehci_hcor *)vct_hcor;
-
-   return 0;
-}
-
-/*
- * Destroy the appropriate control structures corresponding
- * the the EHCI host controller.
- */
-int ehci_hcd_stop(int index)
-{
-   return 0;
-}
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 61/88] rmobile: Drop CONFIG_RMOBILE

2023-01-23 Thread Simon Glass
This has been renamed to CONFIG_ARCH_RMOBILE but this one was left behind.
It doesn't point to a directory that exists, so just drop it.

Signed-off-by: Simon Glass 
---

 arch/arm/cpu/armv7/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 7d7907601ec..653eef8ad79 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -37,7 +37,6 @@ obj-$(if $(filter bcm281xx,$(SOC)),y) += bcm281xx/
 obj-$(if $(filter bcmcygnus,$(SOC)),y) += bcmcygnus/
 obj-$(if $(filter bcmnsp,$(SOC)),y) += bcmnsp/
 obj-$(if $(filter ls102xa,$(SOC)),y) += ls102xa/
-obj-$(CONFIG_RMOBILE) += rmobile/
 obj-$(if $(filter stv0991,$(SOC)),y) += stv0991/
 obj-$(CONFIG_ARCH_SUNXI) += sunxi/
 obj-$(CONFIG_VF610) += vf610/
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 57/88] power: Drop unused fg_max17042 driver and fuel gauge code

2023-01-23 Thread Simon Glass
This driver is not used. Drop it and the entire fuel_gauge directory,
since there is nothing left.

Signed-off-by: Simon Glass 
---

 drivers/power/Makefile |   1 -
 drivers/power/fuel_gauge/Makefile  |   6 -
 drivers/power/fuel_gauge/fg_max17042.c | 287 -
 include/power/fg_battery_cell_params.h |  73 ---
 4 files changed, 367 deletions(-)
 delete mode 100644 drivers/power/fuel_gauge/Makefile
 delete mode 100644 drivers/power/fuel_gauge/fg_max17042.c
 delete mode 100644 include/power/fg_battery_cell_params.h

diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index efdae3655ac..93003e97e01 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -5,7 +5,6 @@
 
 obj-$(CONFIG_$(SPL_TPL_)ACPI_PMC) += acpi_pmc/
 obj-$(CONFIG_$(SPL_TPL_)POWER_DOMAIN) += domain/
-obj-y += fuel_gauge/
 obj-y += mfd/
 obj-y += pmic/
 obj-y += regulator/
diff --git a/drivers/power/fuel_gauge/Makefile 
b/drivers/power/fuel_gauge/Makefile
deleted file mode 100644
index ca2df947585..000
--- a/drivers/power/fuel_gauge/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# Copyright (C) 2012 Samsung Electronics
-# Lukasz Majewski 
-
-obj-$(CONFIG_POWER_FG_MAX17042) += fg_max17042.o
diff --git a/drivers/power/fuel_gauge/fg_max17042.c 
b/drivers/power/fuel_gauge/fg_max17042.c
deleted file mode 100644
index a395d587a86..000
--- a/drivers/power/fuel_gauge/fg_max17042.c
+++ /dev/null
@@ -1,287 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- *  Copyright (C) 2012 Samsung Electronics
- *  Lukasz Majewski 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static int fg_write_regs(struct pmic *p, u8 addr, u16 *data, int num)
-{
-   int ret = 0;
-   int i;
-
-   for (i = 0; i < num; i++, addr++) {
-   ret = pmic_reg_write(p, addr, *(data + i));
-   if (ret)
-   return ret;
-   }
-
-   return 0;
-}
-
-static int fg_read_regs(struct pmic *p, u8 addr, u16 *data, int num)
-{
-   unsigned int dat;
-   int ret = 0;
-   int i;
-
-   for (i = 0; i < num; i++, addr++) {
-   ret = pmic_reg_read(p, addr, &dat);
-   if (ret)
-   return ret;
-
-   *(data + i) = (u16)dat;
-   }
-
-   return 0;
-}
-
-static int fg_write_and_verify(struct pmic *p, u8 addr, u16 data)
-{
-   unsigned int val = data;
-   int ret = 0;
-
-   ret |= pmic_reg_write(p, addr, val);
-   ret |= pmic_reg_read(p, addr, &val);
-
-   if (ret)
-   return ret;
-
-   if (((u16) val) == data)
-   return 0;
-
-   return -1;
-}
-
-static void por_fuelgauge_init(struct pmic *p)
-{
-   u16 r_data0[16], r_data1[16], r_data2[16];
-   u32 rewrite_count = 5;
-   u32 check_count;
-   u32 lock_count;
-   u32 i = 0;
-   u32 val;
-   s32 ret = 0;
-   char *status_msg;
-
-   /* Delay 500 ms */
-   mdelay(500);
-   /* Initilize Configuration */
-   pmic_reg_write(p, MAX17042_CONFIG, 0x2310);
-
-rewrite_model:
-   check_count = 5;
-   lock_count = 5;
-
-   if (!rewrite_count--) {
-   status_msg = "init failed!";
-   goto error;
-   }
-
-   /* Unlock Model Access */
-   pmic_reg_write(p, MAX17042_MLOCKReg1, MODEL_UNLOCK1);
-   pmic_reg_write(p, MAX17042_MLOCKReg2, MODEL_UNLOCK2);
-
-   /* Write/Read/Verify the Custom Model */
-   ret = fg_write_regs(p, MAX17042_MODEL1, cell_character0,
-ARRAY_SIZE(cell_character0));
-   if (ret)
-   goto rewrite_model;
-
-   ret = fg_write_regs(p, MAX17042_MODEL2, cell_character1,
-ARRAY_SIZE(cell_character1));
-   if (ret)
-   goto rewrite_model;
-
-   ret = fg_write_regs(p, MAX17042_MODEL3, cell_character2,
-ARRAY_SIZE(cell_character2));
-   if (ret)
-   goto rewrite_model;
-
-check_model:
-   if (!check_count--) {
-   if (rewrite_count)
-   goto rewrite_model;
-   else
-   status_msg = "check failed!";
-
-   goto error;
-   }
-
-   ret = fg_read_regs(p, MAX17042_MODEL1, r_data0, ARRAY_SIZE(r_data0));
-   if (ret)
-   goto check_model;
-
-   ret = fg_read_regs(p, MAX17042_MODEL2, r_data1, ARRAY_SIZE(r_data1));
-   if (ret)
-   goto check_model;
-
-   ret = fg_read_regs(p, MAX17042_MODEL3, r_data2, ARRAY_SIZE(r_data2));
-   if (ret)
-   goto check_model;
-
-   for (i = 0; i < 16; i++) {
-   if ((cell_character0[i] != r_data0[i])
-   || (cell_character1[i] != r_data1[i])
-   || (cell_character2[i] != r_data2[i]))
-   goto rewrite_model;
- 

[PATCH 58/88] power: Drop unused muic_max77693 driver and mfd code

2023-01-23 Thread Simon Glass
This driver is not used and has lain unconverted since:

   fc47cf9d054 arm: exynos: i2c: Convert exynos boards to use DM_I2C

Drop it and the entire mfd directory, since there is nothing left.

Signed-off-by: Simon Glass 
---

 drivers/power/Makefile|  1 -
 drivers/power/mfd/Makefile|  6 ---
 drivers/power/mfd/muic_max77693.c | 77 ---
 3 files changed, 84 deletions(-)
 delete mode 100644 drivers/power/mfd/Makefile
 delete mode 100644 drivers/power/mfd/muic_max77693.c

diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 93003e97e01..ba64b2c5938 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -5,7 +5,6 @@
 
 obj-$(CONFIG_$(SPL_TPL_)ACPI_PMC) += acpi_pmc/
 obj-$(CONFIG_$(SPL_TPL_)POWER_DOMAIN) += domain/
-obj-y += mfd/
 obj-y += pmic/
 obj-y += regulator/
 
diff --git a/drivers/power/mfd/Makefile b/drivers/power/mfd/Makefile
deleted file mode 100644
index b5ec8f00bb0..000
--- a/drivers/power/mfd/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# Copyright (C) 2013 Samsung Electronics
-# Piotr Wilczek 
-
-obj-$(CONFIG_POWER_MUIC_MAX77693) += muic_max77693.o
diff --git a/drivers/power/mfd/muic_max77693.c 
b/drivers/power/mfd/muic_max77693.c
deleted file mode 100644
index 36ee44b9a2c..000
--- a/drivers/power/mfd/muic_max77693.c
+++ /dev/null
@@ -1,77 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2013 Samsung Electronics
- * Piotr Wilczek 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static int power_chrg_get_type(struct pmic *p)
-{
-   unsigned int val;
-   unsigned int charge_type, charger;
-
-   /* if probe failed, return cable none */
-   if (pmic_probe(p))
-   return CHARGER_NO;
-
-   pmic_reg_read(p, MAX77693_MUIC_STATUS2, &val);
-
-   charge_type = val & MAX77693_MUIC_CHG_MASK;
-
-   switch (charge_type) {
-   case MAX77693_MUIC_CHG_NO:
-   charger = CHARGER_NO;
-   break;
-   case MAX77693_MUIC_CHG_USB:
-   case MAX77693_MUIC_CHG_USB_D:
-   charger = CHARGER_USB;
-   break;
-   case MAX77693_MUIC_CHG_TA:
-   case MAX77693_MUIC_CHG_TA_1A:
-   charger = CHARGER_TA;
-   break;
-   case MAX77693_MUIC_CHG_TA_500:
-   charger = CHARGER_TA_500;
-   break;
-   default:
-   charger = CHARGER_UNKNOWN;
-   break;
-   }
-
-   return charger;
-}
-
-static struct power_chrg power_chrg_muic_ops = {
-   .chrg_type = power_chrg_get_type,
-};
-
-int power_muic_init(unsigned int bus)
-{
-   static const char name[] = "MAX77693_MUIC";
-   struct pmic *p = pmic_alloc();
-
-   if (!p) {
-   printf("%s: POWER allocation error!\n", __func__);
-   return -ENOMEM;
-   }
-
-   debug("Board Micro USB Interface Controller init\n");
-
-   p->name = name;
-   p->interface = PMIC_I2C;
-   p->number_of_regs = MUIC_NUM_OF_REGS;
-   p->hw.i2c.addr = MAX77693_MUIC_I2C_ADDR;
-   p->hw.i2c.tx_num = 1;
-   p->bus = bus;
-
-   p->chrg = &power_chrg_muic_ops;
-
-   return 0;
-}
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 54/88] gpio: Drop unused pca9698 driver

2023-01-23 Thread Simon Glass
This is not used. Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 arch/mips/mach-octeon/octeon_fdt.c |  43 +-
 board/gdsys/a38x/hre.c |   1 -
 drivers/gpio/Makefile  |   1 -
 drivers/gpio/pca9698.c | 127 -
 include/pca9698.h  |  17 
 5 files changed, 1 insertion(+), 188 deletions(-)
 delete mode 100644 drivers/gpio/pca9698.c
 delete mode 100644 include/pca9698.h

diff --git a/arch/mips/mach-octeon/octeon_fdt.c 
b/arch/mips/mach-octeon/octeon_fdt.c
index 0ccfe149dcc..c74fe9d9fb8 100644
--- a/arch/mips/mach-octeon/octeon_fdt.c
+++ b/arch/mips/mach-octeon/octeon_fdt.c
@@ -30,9 +30,6 @@
 #ifdef CONFIG_PCF857X
 #include 
 #endif
-#ifdef CONFIG_PCA9698
-#include 
-#endif
 #ifdef CONFIG_PCA9554
 #include 
 #endif
@@ -59,13 +56,6 @@ static const char * const pca9555_gpio_list[] = {
 };
 #endif
 
-#ifdef CONFIG_PCA9698
-/** List of compatible strings supported by pca9698 driver */
-static const char * const pca9698_gpio_list[] = {
-   "nxp,pca9505", "pca9505", "nxp,pca9698", "pca9698", NULL,
-};
-#endif
-
 #ifdef CONFIG_PCA953X
 /** List of compatible strings supported by pca953x driver */
 static const char * const pca953x_gpio_list[] = {
@@ -807,19 +797,6 @@ int octeon_fdt_read_gpio(const void *fdt, int phandle, int 
pin)
}
value = (value >> pin) & 1;
break;
-#endif
-#ifdef CONFIG_PCA9698
-   case CVMX_GPIO_PIN_PCA9698:
-   node = fdt_node_offset_by_phandle(fdt, phandle);
-   if (octeon_fdt_get_i2c_bus_addr(fdt, node, &bus, &addr)) {
-   printf("%s: Could not get gpio bus and/or address\n", 
__func__);
-   return -1;
-   }
-   old_bus = i2c_get_bus_num();
-   i2c_set_bus_num(bus);
-   value = pca9698_get_value(addr, pin);
-   i2c_set_bus_num(old_bus);
-   break;
 #endif
case CVMX_GPIO_PIN_OCTEON:
value = gpio_get_value(pin);
@@ -880,18 +857,6 @@ int octeon_fdt_set_gpio(const void *fdt, int phandle, int 
pin, int val)
return -1;
}
return pcf957x_set_val(bus, addr, 1 << pin, val << pin);
-#endif
-#ifdef CONFIG_PCA9698
-   case CVMX_GPIO_PIN_PCA9698:
-   if (octeon_fdt_get_i2c_bus_addr(fdt, node, &bus, &addr)) {
-   printf("%s: Could not get gpio bus and/or address\n", 
__func__);
-   return -1;
-   }
-   old_bus = i2c_get_bus_num();
-   i2c_set_bus_num(bus);
-   rc = pca9698_set_value(addr, pin, val);
-   i2c_set_bus_num(old_bus);
-   return rc;
 #endif
case CVMX_GPIO_PIN_OCTEON:
return gpio_set_value(pin, val);
@@ -951,13 +916,7 @@ int octeon_fdt_get_gpio_info(int fdt_node, enum 
octeon_gpio_type *type,
*type = GPIO_TYPE_PCA953X;
}
 #endif
-#ifdef CONFIG_PCA9698
-   if (!octeon_fdt_node_check_compatible(fdt, fdt_node, 
pca9698_gpio_list)) {
-   debug("%s: Found PCA9698 compatible GPIO", __func__);
-   *type = GPIO_TYPE_PCA9698;
-   }
-#endif
-#if defined(CONFIG_PCA953X) || defined(CONFIG_PCA9698) || \
+#if defined(CONFIG_PCA953X) || \
defined(CONFIG_PCA9555) || defined(CONFIG_PCA9554)
if (!i2c_addr || !i2c_bus) {
printf("%s: Error: i2c_addr or i2c_bus is NULL\n", __func__);
diff --git a/board/gdsys/a38x/hre.c b/board/gdsys/a38x/hre.c
index 2f16a4d3e11..d16233ed78e 100644
--- a/board/gdsys/a38x/hre.c
+++ b/board/gdsys/a38x/hre.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "hre.h"
 
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 889a88dc885..fcd136367ac 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -28,7 +28,6 @@ obj-$(CONFIG_MXC_GPIO)+= mxc_gpio.o
 obj-$(CONFIG_MXS_GPIO) += mxs_gpio.o
 obj-$(CONFIG_NPCM_GPIO)+= npcm_gpio.o
 obj-$(CONFIG_PCA953X)  += pca953x.o
-obj-$(CONFIG_PCA9698)  += pca9698.o
 obj-$(CONFIG_ROCKCHIP_GPIO)+= rk_gpio.o
 obj-$(CONFIG_RCAR_GPIO)+= gpio-rcar.o
 obj-$(CONFIG_RZA1_GPIO)+= gpio-rza1.o
diff --git a/drivers/gpio/pca9698.c b/drivers/gpio/pca9698.c
deleted file mode 100644
index 11274c78101..000
--- a/drivers/gpio/pca9698.c
+++ /dev/null
@@ -1,127 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2011
- * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
- */
-
-/*
- * Driver for NXP's pca9698 40 bit I2C gpio expander
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-/*
- * The pca9698 registers
- */
-
-#define PCA9698_REG_INPUT  0x00
-#define PCA9698_REG_OUTPUT 0x08
-#define PCA9698_REG_POLARITY   0x10
-#define PCA9698_REG_CONFIG 0x18
-
-#define PC

[PATCH 55/88] samsung: Rename PINCTRL_EXYNOS78x0

2023-01-23 Thread Simon Glass
CONFIG options must not use lower-case letter. Convert this to upper case.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-exynos/Kconfig| 6 +++---
 drivers/pinctrl/exynos/Kconfig  | 2 +-
 drivers/pinctrl/exynos/Makefile | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 8f3aee052c8..1a1fd7261b1 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -204,7 +204,7 @@ config  TARGET_A5Y17LTE
select CLK_EXYNOS
select OF_CONTROL
select PINCTRL
-   select PINCTRL_EXYNOS78x0
+   select PINCTRL_EXYNOS78X0
select SUPPORT_SPL
 
 config  TARGET_A7Y17LTE
@@ -213,7 +213,7 @@ config  TARGET_A7Y17LTE
select CLK_EXYNOS
select OF_CONTROL
select PINCTRL
-   select PINCTRL_EXYNOS78x0
+   select PINCTRL_EXYNOS78X0
select SUPPORT_SPL
 
 config  TARGET_A3Y17LTE
@@ -222,7 +222,7 @@ config  TARGET_A3Y17LTE
select CLK_EXYNOS
select OF_CONTROL
select PINCTRL
-   select PINCTRL_EXYNOS78x0
+   select PINCTRL_EXYNOS78X0
select SUPPORT_SPL
 
 endchoice
diff --git a/drivers/pinctrl/exynos/Kconfig b/drivers/pinctrl/exynos/Kconfig
index a60f49869b4..821bdd14072 100644
--- a/drivers/pinctrl/exynos/Kconfig
+++ b/drivers/pinctrl/exynos/Kconfig
@@ -9,7 +9,7 @@ config PINCTRL_EXYNOS7420
  Support pin multiplexing and pin configuration control on
  Samsung's Exynos7420 SoC.
 
-config PINCTRL_EXYNOS78x0
+config PINCTRL_EXYNOS78X0
bool "Samsung Exynos78x0 pinctrl driver"
depends on ARCH_EXYNOS && PINCTRL_FULL
select PINCTRL_EXYNOS
diff --git a/drivers/pinctrl/exynos/Makefile b/drivers/pinctrl/exynos/Makefile
index 07db970ca94..445c8e17aea 100644
--- a/drivers/pinctrl/exynos/Makefile
+++ b/drivers/pinctrl/exynos/Makefile
@@ -5,4 +5,4 @@
 
 obj-$(CONFIG_PINCTRL_EXYNOS)   += pinctrl-exynos.o
 obj-$(CONFIG_PINCTRL_EXYNOS7420)   += pinctrl-exynos7420.o
-obj-$(CONFIG_PINCTRL_EXYNOS78x0)   += pinctrl-exynos78x0.o
+obj-$(CONFIG_PINCTRL_EXYNOS78X0)   += pinctrl-exynos78x0.o
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 53/88] ppc: Drop unused CONFIG_P2020DS

2023-01-23 Thread Simon Glass
This option does not exist, so the Makefile rule does nothing. Drop it.

Signed-off-by: Simon Glass 
---

 board/freescale/common/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index fc51d6d3e18..9d5f38bb225 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -54,7 +54,6 @@ obj-$(CONFIG_TARGET_MPC8548CDS)   += cds_pci_ft.o
 
 obj-$(CONFIG_TARGET_MPC8536DS) += ics307_clk.o
 obj-$(CONFIG_TARGET_P1022DS)   += ics307_clk.o
-obj-$(CONFIG_P2020DS)  += ics307_clk.o
 obj-$(CONFIG_TARGET_P3041DS)   += ics307_clk.o
 obj-$(CONFIG_TARGET_P4080DS)   += ics307_clk.o
 obj-$(CONFIG_TARGET_P5040DS)   += ics307_clk.o
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 47/88] mtd: Drop unused fsmc_nand driver

2023-01-23 Thread Simon Glass
This is not used since this commit:

   570c3dcfc15 arm: Remove spear600 boards and the rest of SPEAr support

Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 drivers/mtd/nand/raw/Makefile|   1 -
 drivers/mtd/nand/raw/fsmc_nand.c | 470 ---
 include/linux/mtd/fsmc_nand.h|  84 --
 3 files changed, 555 deletions(-)
 delete mode 100644 drivers/mtd/nand/raw/fsmc_nand.c
 delete mode 100644 include/linux/mtd/fsmc_nand.h

diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
index e8764cf358b..f004eb39f3b 100644
--- a/drivers/mtd/nand/raw/Makefile
+++ b/drivers/mtd/nand/raw/Makefile
@@ -56,7 +56,6 @@ obj-$(CONFIG_NAND_DENALI) += denali.o
 obj-$(CONFIG_NAND_DENALI_DT) += denali_dt.o
 obj-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o
-obj-$(CONFIG_NAND_FSMC) += fsmc_nand.o
 obj-$(CONFIG_NAND_KB9202) += kb9202_nand.o
 obj-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
 obj-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o
diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
deleted file mode 100644
index d795864949c..000
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ /dev/null
@@ -1,470 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2010
- * Vipin Kumar, STMicroelectronics, vipin.ku...@st.com.
- *
- * (C) Copyright 2012
- * Amit Virdi, STMicroelectronics, amit.vi...@st.com.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static u32 fsmc_version;
-static struct fsmc_regs *const fsmc_regs_p = (struct fsmc_regs *)
-   CONFIG_SYS_FSMC_BASE;
-
-/*
- * ECC4 and ECC1 have 13 bytes and 3 bytes of ecc respectively for 512 bytes of
- * data. ECC4 can correct up to 8 bits in 512 bytes of data while ECC1 can
- * correct 1 bit in 512 bytes
- */
-
-static struct nand_ecclayout fsmc_ecc4_lp_layout = {
-   .eccbytes = 104,
-   .eccpos = {  2,   3,   4,   5,   6,   7,   8,
-   9,  10,  11,  12,  13,  14,
-   18,  19,  20,  21,  22,  23,  24,
-   25,  26,  27,  28,  29,  30,
-   34,  35,  36,  37,  38,  39,  40,
-   41,  42,  43,  44,  45,  46,
-   50,  51,  52,  53,  54,  55,  56,
-   57,  58,  59,  60,  61,  62,
-   66,  67,  68,  69,  70,  71,  72,
-   73,  74,  75,  76,  77,  78,
-   82,  83,  84,  85,  86,  87,  88,
-   89,  90,  91,  92,  93,  94,
-   98,  99, 100, 101, 102, 103, 104,
-   105, 106, 107, 108, 109, 110,
-   114, 115, 116, 117, 118, 119, 120,
-   121, 122, 123, 124, 125, 126
-   },
-   .oobfree = {
-   {.offset = 15, .length = 3},
-   {.offset = 31, .length = 3},
-   {.offset = 47, .length = 3},
-   {.offset = 63, .length = 3},
-   {.offset = 79, .length = 3},
-   {.offset = 95, .length = 3},
-   {.offset = 111, .length = 3},
-   {.offset = 127, .length = 1}
-   }
-};
-
-/*
- * ECC4 layout for NAND of pagesize 4096 bytes & OOBsize 224 bytes. 13*8 bytes
- * of OOB size is reserved for ECC, Byte no. 0 & 1 reserved for bad block & 118
- * bytes are free for use.
- */
-static struct nand_ecclayout fsmc_ecc4_224_layout = {
-   .eccbytes = 104,
-   .eccpos = {  2,   3,   4,   5,   6,   7,   8,
-   9,  10,  11,  12,  13,  14,
-   18,  19,  20,  21,  22,  23,  24,
-   25,  26,  27,  28,  29,  30,
-   34,  35,  36,  37,  38,  39,  40,
-   41,  42,  43,  44,  45,  46,
-   50,  51,  52,  53,  54,  55,  56,
-   57,  58,  59,  60,  61,  62,
-   66,  67,  68,  69,  70,  71,  72,
-   73,  74,  75,  76,  77,  78,
-   82,  83,  84,  85,  86,  87,  88,
-   89,  90,  91,  92,  93,  94,
-   98,  99, 100, 101, 102, 103, 104,
-   105, 106, 107, 108, 109, 110,
-   114, 115, 116, 117, 118, 119, 120,
-   121, 122, 123, 124, 125, 126
-   },
-   .oobfree = {
-   {.offset = 15, .length = 3},
-   {.offset = 31, .length = 3},
-   {.offset = 47, .length = 3},
-   {.offset = 63, .length = 3},
-   {.offset = 79, .length = 3},
-   {.offset = 95, .length = 3},
-   {.offset = 111, .length = 3},
-   {.offset = 127, .length = 97}
-   }
-};
-
-/*
- * ECC placement definitions in oobfree type format
- * There are 13 bytes of ecc for every 512 byte block and it has to be read
- * consecutively and immediately after the 512 byte data block for hardware to
- * generate the error bit offsets in 512 byte data
- * Managing the ecc bytes in the following way makes it easier for software to
- * read ecc bytes consecutive to data bytes. This way is simila

[PATCH 52/88] mtd: Drop unused CONFIG_ONENAND_U_BOOT

2023-01-23 Thread Simon Glass
This option does not exist, so the Makefile rule does nothing. Drop it.

Signed-off-by: Simon Glass 
---

 Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Makefile b/Makefile
index 59377362f75..59b5b108168 100644
--- a/Makefile
+++ b/Makefile
@@ -956,7 +956,6 @@ endif
 # Always append INPUTS so that arch config.mk's can add custom ones
 INPUTS-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check
 
-INPUTS-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
 ifeq ($(CONFIG_SPL_FSL_PBL),y)
 INPUTS-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin
 else
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 50/88] Makefile: Drop CONFIG_OF_EARLY_FLATTREE

2023-01-23 Thread Simon Glass
This option does not exist, so drop the dead code.

Signed-off-by: Simon Glass 
---

 Makefile | 4 
 1 file changed, 4 deletions(-)

diff --git a/Makefile b/Makefile
index 92a95361982..59377362f75 100644
--- a/Makefile
+++ b/Makefile
@@ -2003,10 +2003,6 @@ dtbs: prepare3 scripts_dtc
 dtbs_install:
$(Q)$(MAKE) $(dtbinst)=$(dtstree)
 
-ifdef CONFIG_OF_EARLY_FLATTREE
-all: dtbs
-endif
-
 endif
 
 # Check dtc and pylibfdt, if DTC is provided, else build them
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 48/88] mtd: Drop unused kb9202_nand driver

2023-01-23 Thread Simon Glass
This is not used since time out of mind.

Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 drivers/mtd/nand/raw/Makefile  |   1 -
 drivers/mtd/nand/raw/kb9202_nand.c | 134 -
 2 files changed, 135 deletions(-)
 delete mode 100644 drivers/mtd/nand/raw/kb9202_nand.c

diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
index f004eb39f3b..c25acb11804 100644
--- a/drivers/mtd/nand/raw/Makefile
+++ b/drivers/mtd/nand/raw/Makefile
@@ -56,7 +56,6 @@ obj-$(CONFIG_NAND_DENALI) += denali.o
 obj-$(CONFIG_NAND_DENALI_DT) += denali_dt.o
 obj-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o
-obj-$(CONFIG_NAND_KB9202) += kb9202_nand.o
 obj-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
 obj-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o
 obj-$(CONFIG_NAND_LPC32XX_MLC) += lpc32xx_nand_mlc.o
diff --git a/drivers/mtd/nand/raw/kb9202_nand.c 
b/drivers/mtd/nand/raw/kb9202_nand.c
deleted file mode 100644
index 9d26532c780..000
--- a/drivers/mtd/nand/raw/kb9202_nand.c
+++ /dev/null
@@ -1,134 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2006
- * KwikByte 
- *
- * (C) Copyright 2009
- * Matthias Kaehlcke 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-/*
- *  hardware specific access to control-lines
- */
-
-#define MASK_ALE(1 << 22)   /* our ALE is A22 */
-#define MASK_CLE(1 << 21)   /* our CLE is A21 */
-
-#define KB9202_NAND_NCE (1 << 28) /* EN* on D28 */
-#define KB9202_NAND_BUSY (1 << 29) /* RB* on D29 */
-
-#define KB9202_SMC2_NWS (1 << 2)
-#define KB9202_SMC2_TDF (1 << 8)
-#define KB9202_SMC2_RWSETUP (1 << 24)
-#define KB9202_SMC2_RWHOLD (1 << 29)
-
-/*
- * Board-specific function to access device control signals
- */
-static void kb9202_nand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int 
ctrl)
-{
-   struct nand_chip *this = mtd_to_nand(mtd);
-
-   if (ctrl & NAND_CTRL_CHANGE) {
-   ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
-
-   /* clear ALE and CLE bits */
-   IO_ADDR_W &= ~(MASK_ALE | MASK_CLE);
-
-   if (ctrl & NAND_CLE)
-   IO_ADDR_W |= MASK_CLE;
-
-   if (ctrl & NAND_ALE)
-   IO_ADDR_W |= MASK_ALE;
-
-   this->IO_ADDR_W = (void *) IO_ADDR_W;
-
-   if (ctrl & NAND_NCE)
-   writel(KB9202_NAND_NCE, AT91C_PIOC_CODR);
-   else
-   writel(KB9202_NAND_NCE, AT91C_PIOC_SODR);
-   }
-
-   if (cmd != NAND_CMD_NONE)
-   writeb(cmd, this->IO_ADDR_W);
-}
-
-
-/*
- * Board-specific function to access the device ready signal.
- */
-static int kb9202_nand_ready(struct mtd_info *mtd)
-{
-   return readl(AT91C_PIOC_PDSR) & KB9202_NAND_BUSY;
-}
-
-
-/*
- * Board-specific NAND init.  Copied from include/linux/mtd/nand.h for 
reference.
- *
- * struct nand_chip - NAND Private Flash Chip Data
- * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the 
flash device
- * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the 
flash device
- * @hwcontrol: [BOARDSPECIFIC] hardwarespecific function for accesing 
control-lines
- * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing 
device ready/busy line
- * If set to NULL no access to ready/busy is available and 
the ready/busy information
- * is read from the chip status register
- * @enable_hwecc:  [BOARDSPECIFIC] function to enable (reset) hardware ecc 
generator. Must only
- * be provided if a hardware ECC is available
- * @eccmode:   [BOARDSPECIFIC] mode of ecc, see defines
- * @chip_delay:[BOARDSPECIFIC] chip dependent delay for 
transfering data from array to read regs (tR)
- * @options:   [BOARDSPECIFIC] various chip options. They can partly 
be set to inform nand_scan about
- * special functionality. See the defines for further 
explanation
-*/
-/*
- * This routine initializes controller and GPIOs.
- */
-int board_nand_init(struct nand_chip *nand)
-{
-   unsigned int value;
-
-   nand->ecc.mode = NAND_ECC_SOFT;
-   nand->cmd_ctrl = kb9202_nand_hwcontrol;
-   nand->dev_ready = kb9202_nand_ready;
-
-   /* in case running outside of bootloader */
-   writel(1 << AT91C_ID_PIOC, AT91C_PMC_PCER);
-
-   /* setup nand flash access (allow ample margin) */
-   /* 4 wait states, 1 setup, 1 hold, 1 float for 8-bit device */
-   writel(AT91C_SMC2_WSEN | KB9202_SMC2_NWS | KB9202_SMC2_TDF |
-   AT91C_SMC2_DBW_8 | KB9202_SMC2_RWSETUP | KB9202_SMC2_RWHOLD,
-   AT91C_SMC_CSR3);
-
-   /* enable internal NAND controller */
-   value = readl(AT91C_EBI_CSA);
-   value |= AT91C_EBI_CS3A_SMC_SmartMedia;
-   writel(value, AT91C_EBI_CSA);
-
- 

[PATCH 51/88] omap: Drop unused CONFIG_OMAP_USB_PHY

2023-01-23 Thread Simon Glass
This option does not exist, so the Makefile rule does nothing. Drop it.

Signed-off-by: Simon Glass 
---

 drivers/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index 83b14ef1fd3..15d19d0c8a3 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -59,7 +59,6 @@ obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
 obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/udc/
 obj-$(CONFIG_SPL_WATCHDOG) += watchdog/
 obj-$(CONFIG_SPL_USB_HOST) += usb/host/
-obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
 obj-$(CONFIG_SPL_SATA) += ata/ scsi/
 obj-$(CONFIG_SPL_LEGACY_BLOCK) += block/
 obj-$(CONFIG_SPL_THERMAL) += thermal/
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 45/88] nand: Drop unused actl_nand driver

2023-01-23 Thread Simon Glass
This is not used since this commit:

   ed7fe2bee12 ppc: Remove xpedite boards

Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 board/xes/common/Makefile|  1 -
 board/xes/common/actl_nand.c | 49 
 2 files changed, 50 deletions(-)
 delete mode 100644 board/xes/common/actl_nand.c

diff --git a/board/xes/common/Makefile b/board/xes/common/Makefile
index d6f09f71b75..b139ee9f759 100644
--- a/board/xes/common/Makefile
+++ b/board/xes/common/Makefile
@@ -7,4 +7,3 @@ obj-$(CONFIG_MPC86XX)   += fsl_8xxx_clk.o
 obj-$(CONFIG_ARCH_P2020)   += fsl_8xxx_clk.o
 obj-$(CONFIG_MPC85XX)  += fsl_8xxx_misc.o board.o
 obj-$(CONFIG_MPC86XX)  += fsl_8xxx_misc.o board.o
-obj-$(CONFIG_NAND_ACTL)+= actl_nand.o
diff --git a/board/xes/common/actl_nand.c b/board/xes/common/actl_nand.c
deleted file mode 100644
index 2d8a57576a6..000
--- a/board/xes/common/actl_nand.c
+++ /dev/null
@@ -1,49 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright 2008 Extreme Engineering Solutions, Inc.
- *
- * This driver support NAND devices which have address lines
- * connected as ALE and CLE inputs.
- */
-
-#include 
-#include 
-#include 
-#include 
-
-/*
- * Hardware specific access to control-lines
- */
-static void nand_addr_hwcontrol(struct mtd_info *mtd, int cmd, uint ctrl)
-{
-   struct nand_chip *this = mtd_to_nand(mtd);
-   ulong IO_ADDR_W;
-
-   if (ctrl & NAND_CTRL_CHANGE) {
-   IO_ADDR_W = (ulong)this->IO_ADDR_W;
-
-   IO_ADDR_W &= ~(CONFIG_SYS_NAND_ACTL_CLE |
-   CONFIG_SYS_NAND_ACTL_ALE |
-   CONFIG_SYS_NAND_ACTL_NCE);
-   if (ctrl & NAND_CLE)
-   IO_ADDR_W |= CONFIG_SYS_NAND_ACTL_CLE;
-   if (ctrl & NAND_ALE)
-   IO_ADDR_W |= CONFIG_SYS_NAND_ACTL_ALE;
-   if (ctrl & NAND_NCE)
-   IO_ADDR_W |= CONFIG_SYS_NAND_ACTL_NCE;
-
-   this->IO_ADDR_W = (void *)IO_ADDR_W;
-   }
-
-   if (cmd != NAND_CMD_NONE)
-   writeb(cmd, this->IO_ADDR_W);
-}
-
-int board_nand_init(struct nand_chip *nand)
-{
-   nand->ecc.mode = NAND_ECC_SOFT;
-   nand->cmd_ctrl = nand_addr_hwcontrol;
-   nand->chip_delay = CONFIG_SYS_NAND_ACTL_DELAY;
-
-   return 0;
-}
-- 
2.39.1.456.gfc5497dd1b-goog



[PATCH 46/88] mtd: Drop unused fsl_upm driver

2023-01-23 Thread Simon Glass
This is not used since this commit:

   8d1e3cb1400 powerpc: mpc83xx: remove MPC8360ERDK, EMPC8360EMDS support

Drop the driver and Kconfig option.

Signed-off-by: Simon Glass 
---

 drivers/mtd/nand/raw/Makefile  |   1 -
 drivers/mtd/nand/raw/fsl_upm.c | 187 -
 include/linux/mtd/fsl_upm.h|  44 
 3 files changed, 232 deletions(-)
 delete mode 100644 drivers/mtd/nand/raw/fsl_upm.c
 delete mode 100644 include/linux/mtd/fsl_upm.h

diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
index 4c59903aa8c..e8764cf358b 100644
--- a/drivers/mtd/nand/raw/Makefile
+++ b/drivers/mtd/nand/raw/Makefile
@@ -56,7 +56,6 @@ obj-$(CONFIG_NAND_DENALI) += denali.o
 obj-$(CONFIG_NAND_DENALI_DT) += denali_dt.o
 obj-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o
-obj-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
 obj-$(CONFIG_NAND_FSMC) += fsmc_nand.o
 obj-$(CONFIG_NAND_KB9202) += kb9202_nand.o
 obj-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
deleted file mode 100644
index 91cc1339537..000
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ /dev/null
@@ -1,187 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * FSL UPM NAND driver
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- *Anton Vorontsov 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static void fsl_upm_start_pattern(struct fsl_upm *upm, u32 pat_offset)
-{
-   clrsetbits_be32(upm->mxmr, MxMR_MAD_MSK, MxMR_OP_RUNP | pat_offset);
-   (void)in_be32(upm->mxmr);
-}
-
-static void fsl_upm_end_pattern(struct fsl_upm *upm)
-{
-   clrbits_be32(upm->mxmr, MxMR_OP_RUNP);
-
-   while (in_be32(upm->mxmr) & MxMR_OP_RUNP)
-   eieio();
-}
-
-static void fsl_upm_run_pattern(struct fsl_upm *upm, int width,
-   void __iomem *io_addr, u32 mar)
-{
-   out_be32(upm->mar, mar);
-   (void)in_be32(upm->mar);
-   switch (width) {
-   case 8:
-   out_8(io_addr, 0x0);
-   break;
-   case 16:
-   out_be16(io_addr, 0x0);
-   break;
-   case 32:
-   out_be32(io_addr, 0x0);
-   break;
-   }
-}
-
-static void fun_wait(struct fsl_upm_nand *fun)
-{
-   if (fun->dev_ready) {
-   while (!fun->dev_ready(fun->chip_nr))
-   debug("unexpected busy state\n");
-   } else {
-   /*
-* If the R/B pin is not connected,
-* a short delay is necessary.
-*/
-   udelay(1);
-   }
-}
-
-#if CONFIG_SYS_NAND_MAX_CHIPS > 1
-static void fun_select_chip(struct mtd_info *mtd, int chip_nr)
-{
-   struct nand_chip *chip = mtd_to_nand(mtd);
-   struct fsl_upm_nand *fun = nand_get_controller_data(chip);
-
-   if (chip_nr >= 0) {
-   fun->chip_nr = chip_nr;
-   chip->IO_ADDR_R = chip->IO_ADDR_W =
-   fun->upm.io_addr + fun->chip_offset * chip_nr;
-   } else if (chip_nr == -1) {
-   chip->cmd_ctrl(mtd, NAND_CMD_NONE, 0 | NAND_CTRL_CHANGE);
-   }
-}
-#endif
-
-static void fun_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-   struct nand_chip *chip = mtd_to_nand(mtd);
-   struct fsl_upm_nand *fun = nand_get_controller_data(chip);
-   void __iomem *io_addr;
-   u32 mar;
-
-   if (!(ctrl & fun->last_ctrl)) {
-   fsl_upm_end_pattern(&fun->upm);
-
-   if (cmd == NAND_CMD_NONE)
-   return;
-
-   fun->last_ctrl = ctrl & (NAND_ALE | NAND_CLE);
-   }
-
-   if (ctrl & NAND_CTRL_CHANGE) {
-   if (ctrl & NAND_ALE)
-   fsl_upm_start_pattern(&fun->upm, fun->upm_addr_offset);
-   else if (ctrl & NAND_CLE)
-   fsl_upm_start_pattern(&fun->upm, fun->upm_cmd_offset);
-   }
-
-   mar = cmd << (32 - fun->width);
-   io_addr = fun->upm.io_addr;
-#if CONFIG_SYS_NAND_MAX_CHIPS > 1
-   if (fun->chip_nr > 0) {
-   io_addr += fun->chip_offset * fun->chip_nr;
-   if (fun->upm_mar_chip_offset)
-   mar |= fun->upm_mar_chip_offset * fun->chip_nr;
-   }
-#endif
-   fsl_upm_run_pattern(&fun->upm, fun->width, io_addr, mar);
-
-   /*
-* Some boards/chips needs this.  At least the MPC8360E-RDK
-* needs it.  Probably weird chip, because I don't see any
-* need for this on MPC8555E + Samsung K9F1G08U0A.  Usually
-* here are 0-2 unexpected busy states per block read.
-*/
-   if (fun->wait_flags & FSL_UPM_WAIT_RUN_PATTERN)
-   fun_wait(fun);
-}
-
-static u8 upm_nand_read_byte(struct mtd_info *mtd)
-{
-   struct nand_chip *chip = mtd_to_nand(mtd);
-
-   return in_8(chip->IO_A

  1   2   3   >