From patchwork Thu May 21 13:06:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 246143 List-Id: U-Boot discussion From: luca at lucaceresoli.net (Luca Ceresoli) Date: Thu, 21 May 2020 15:06:24 +0200 Subject: [PATCH 1/2] board: ti: am57xx: use GPIO_TO_PIN() to define GPIO number Message-ID: <20200521130625.14609-1-luca@lucaceresoli.net> Using the macro makes code readable without the need for a comment. Signed-off-by: Luca Ceresoli --- board/ti/am57xx/board.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 8720eb87a55d..c41aa24f957b 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -68,8 +68,7 @@ static int board_bootmode_has_emmc(void); DECLARE_GLOBAL_DATA_PTR; #define GPIO_ETH_LCD GPIO_TO_PIN(2, 22) -/* GPIO 7_11 */ -#define GPIO_DDR_VTT_EN 203 +#define GPIO_DDR_VTT_EN GPIO_TO_PIN(7, 11) /* Touch screen controller to identify the LCD */ #define OSD_TS_FT_BUS_ADDRESS 0 From patchwork Thu May 21 13:06:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 246144 List-Id: U-Boot discussion From: luca at lucaceresoli.net (Luca Ceresoli) Date: Thu, 21 May 2020 15:06:25 +0200 Subject: [PATCH 2/2] board: ti: use positive logic to detect idk boards In-Reply-To: <20200521130625.14609-1-luca@lucaceresoli.net> References: <20200521130625.14609-1-luca@lucaceresoli.net> Message-ID: <20200521130625.14609-2-luca@lucaceresoli.net> am57x_idk_lcd_detect() exits immediately if a known board not having an LCD is found, i.e. a non-IDK board. This is annoying as we have to remember to add an extra OR clause for every new non-IDK board. Add a board_is_ti_idk() macro so that the logic becomes positive (detect LCD on IDK boards instead of not-known-without-LCD boards). Even more important, add the macro just below the board_is_*_idk() macros, so it is easy to remember to update it when adding a new IDK. Signed-off-by: Luca Ceresoli --- board/ti/am57xx/board.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index c41aa24f957b..511858a5e90c 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -61,6 +61,10 @@ static int board_bootmode_has_emmc(void); #define board_is_am571x_idk() board_ti_is("AM571IDK") #define board_is_bbai() board_ti_is("BBONE-AI") +#define board_is_ti_idk() board_is_am574x_idk() || \ + board_is_am572x_idk() || \ + board_is_am571x_idk() + #ifdef CONFIG_DRIVER_TI_CPSW #include #endif @@ -666,7 +670,7 @@ void am57x_idk_lcd_detect(void) struct udevice *dev; /* Only valid for IDKs */ - if (board_is_x15() || board_is_am572x_evm() || board_is_bbai()) + if (!board_is_ti_idk()) return; /* Only AM571x IDK has gpio control detect.. so check that */