Skip to content

Commit

Permalink
lpc32xx: Kconfig: switch to CONFIG_CONS_INDEX
Browse files Browse the repository at this point in the history
There's nothing special or unique to the lpc32xx that requires its own config
parameter for specifying the console uart index. Therefore instead of using
the lpc32xx-specific CONFIG_SYS_LPC32XX_UART include parameter, use the
already-available CONFIG_CONS_INDEX from Kconfig.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
  • Loading branch information
twoerner authored and trini committed Jul 6, 2021
1 parent 3a37386 commit bd4dbf9
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 19 deletions.
4 changes: 2 additions & 2 deletions arch/arm/include/asm/arch-lpc32xx/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
/* Basic CPU architecture */

/* UART configuration */
#if (CONFIG_SYS_LPC32XX_UART == 1) || (CONFIG_SYS_LPC32XX_UART == 2) || \
(CONFIG_SYS_LPC32XX_UART == 7)
#if (CONFIG_CONS_INDEX == 1) || (CONFIG_CONS_INDEX == 2) || \
(CONFIG_CONS_INDEX == 7)
#if !defined(CONFIG_LPC32XX_HSUART)
#define CONFIG_LPC32XX_HSUART
#endif
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-lpc32xx/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ void lpc32xx_uart_init(unsigned int uart_id)
return;

/* Disable loopback mode, if it is set by S1L bootloader */
clrbits_le32(&ctrl->loop,
UART_LOOPBACK(CONFIG_SYS_LPC32XX_UART));
clrbits_le32(&ctrl->loop, UART_LOOPBACK(uart_id));

if (uart_id < 3 || uart_id > 6)
return;
Expand Down
2 changes: 1 addition & 1 deletion board/timll/devkit3250/devkit3250.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void reset_periph(void)

int board_early_init_f(void)
{
lpc32xx_uart_init(CONFIG_SYS_LPC32XX_UART);
lpc32xx_uart_init(CONFIG_CONS_INDEX);
lpc32xx_i2c_init(1);
lpc32xx_i2c_init(2);
lpc32xx_ssp_init();
Expand Down
2 changes: 1 addition & 1 deletion board/timll/devkit3250/devkit3250_spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void spl_board_init(void)
/* First of all silence buzzer controlled by GPO_20 */
writel((1 << 20), &gpio->p3_outp_clr);

lpc32xx_uart_init(CONFIG_SYS_LPC32XX_UART);
lpc32xx_uart_init(CONFIG_CONS_INDEX);
preloader_console_init();

ddr_init(&dram_64mb);
Expand Down
2 changes: 1 addition & 1 deletion board/work-microwave/work_92105/work_92105.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void reset_periph(void)
int board_early_init_f(void)
{
/* initialize serial port for console */
lpc32xx_uart_init(CONFIG_SYS_LPC32XX_UART);
lpc32xx_uart_init(CONFIG_CONS_INDEX);
/* enable I2C, SSP, MAC, NAND */
lpc32xx_i2c_init(1); /* only I2C1 has devices, I2C2 has none */
lpc32xx_ssp_init();
Expand Down
2 changes: 1 addition & 1 deletion board/work-microwave/work_92105/work_92105_spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const struct emc_dram_settings dram_128mb = {
void spl_board_init(void)
{
/* initialize serial port for console */
lpc32xx_uart_init(CONFIG_SYS_LPC32XX_UART);
lpc32xx_uart_init(CONFIG_CONS_INDEX);
/* initialize console */
preloader_console_init();
/* init DDR and NAND to chainload U-Boot */
Expand Down
2 changes: 2 additions & 0 deletions configs/devkit3250_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ CONFIG_PHYLIB=y
CONFIG_PHY_ADDR_ENABLE=y
CONFIG_PHY_ADDR=31
CONFIG_PHY_SMSC=y
CONFIG_SPECIFY_CONSOLE_INDEX=y
CONFIG_CONS_INDEX=5
CONFIG_SYS_NS16550=y
CONFIG_SPI=y
CONFIG_USB=y
Expand Down
2 changes: 2 additions & 0 deletions configs/work_92105_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ CONFIG_MTD_RAW_NAND=y
CONFIG_PHYLIB=y
CONFIG_PHY_ADDR_ENABLE=y
CONFIG_PHY_SMSC=y
CONFIG_SPECIFY_CONSOLE_INDEX=y
CONFIG_CONS_INDEX=5
CONFIG_SYS_NS16550=y
CONFIG_SPI=y
5 changes: 0 additions & 5 deletions include/configs/devkit3250.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_4K \
- GENERATED_GBL_DATA_SIZE)

/*
* Serial Driver
*/
#define CONFIG_SYS_LPC32XX_UART 5 /* UART5 */

/*
* DMA
*/
Expand Down
5 changes: 0 additions & 5 deletions include/configs/work_92105.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_512K \
- GENERATED_GBL_DATA_SIZE)

/*
* Serial Driver
*/
#define CONFIG_SYS_LPC32XX_UART 5 /* UART5 - NS16550 */

/*
* Ethernet Driver
*/
Expand Down
1 change: 0 additions & 1 deletion scripts/config_whitelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2734,7 +2734,6 @@ CONFIG_SYS_LOW
CONFIG_SYS_LOWMEM_BASE
CONFIG_SYS_LOW_RES_TIMER
CONFIG_SYS_LPAE_SDRAM_BASE
CONFIG_SYS_LPC32XX_UART
CONFIG_SYS_LS1_DDR_BLOCK1_SIZE
CONFIG_SYS_LS_MC_AIOP_IMG_MAX_LENGTH
CONFIG_SYS_LS_MC_BOOT_TIMEOUT_MS
Expand Down

0 comments on commit bd4dbf9

Please sign in to comment.