From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lokesh Vutla Date: Tue, 17 May 2016 18:34:19 +0530 Subject: [U-Boot] [PATCH v2 8/8] board: am335x: Allow to choose serial device dynamically In-Reply-To: <20160517112637.GO4404@bill-the-cat> References: <1463379449-4902-1-git-send-email-lokeshvutla@ti.com> <1463379449-4902-9-git-send-email-lokeshvutla@ti.com> <20160517004154.GL4404@bill-the-cat> <573A9BE9.9020100@ti.com> <20160517112637.GO4404@bill-the-cat> Message-ID: <573B16D3.502@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 5/17/2016 4:56 PM, Tom Rini wrote: > On Tue, May 17, 2016 at 09:49:53AM +0530, Lokesh Vutla wrote: >> >> >> On 5/17/2016 6:11 AM, Tom Rini wrote: >>> On Mon, May 16, 2016 at 11:47:29AM +0530, Lokesh Vutla wrote: >>> >>>> Different AM335x based platforms have different serial consoles. As serial >>>> console is Kconfig option a separate defconfig has to be created for each >>>> platform. So pass the serial device dynamically. >>>> >>>> Signed-off-by: Lokesh Vutla >>>> --- >>>> Changes since v1: >>>> - New patch. >>>> board/ti/am335x/board.c | 11 +++++++++++ >>>> include/serial.h | 4 ++++ >>>> 2 files changed, 15 insertions(+) >>>> >>>> diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c >>>> index ff52314..56f4984 100644 >>>> --- a/board/ti/am335x/board.c >>>> +++ b/board/ti/am335x/board.c >>>> @@ -11,6 +11,7 @@ >>>> #include >>>> #include >>>> #include >>>> +#include >>>> #include >>>> #include >>>> #include >>>> @@ -59,6 +60,16 @@ static inline int __maybe_unused read_eeprom(void) >>>> return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR); >>>> } >>>> >>>> +#ifndef CONFIG_DM_SERIAL >>>> +struct serial_device *default_serial_console(void) >>>> +{ >>>> + if (board_is_icev2()) >>>> + return &eserial4_device; >>>> + else >>>> + return &eserial1_device; >>>> +} >>>> +#endif >>>> + >>>> #ifndef CONFIG_SKIP_LOWLEVEL_INIT >>>> static const struct ddr_data ddr2_data = { >>>> .datardsratio0 = MT47H128M16RT25E_RD_DQS, >>> >>> ... so in the DM case we're already handling this correctly? Can't we >> >> With DM+DT we are handling it correctly which is only in U-Boot. >> This part of code is meant for only SPL(DM_* is not yet enabled in >> SPL). > > ... aren't we in the middle of doing this conversion 'tho? hmm... I don't think this conversion for SPL has been done. Thanks and regards, Lokesh >