diff mbox series

[2/2] omap4: sdp: convert to device model

Message ID 20200615101605.19922-3-peter.ujfalusi@ti.com
State Accepted
Commit 8812ed97255a30a4f625e3d99a5108bf3e61ec95
Headers show
Series omap4: sdp: convert to device model | expand

Commit Message

Peter Ujfalusi June 15, 2020, 10:16 a.m. UTC
Convert omap4 sdp to device model.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
---
 arch/arm/dts/Makefile           |  4 ++++
 board/ti/sdp4430/sdp.c          | 12 ++++++++++++
 configs/omap4_sdp4430_defconfig |  8 ++++++++
 3 files changed, 24 insertions(+)

Comments

Tom Rini June 15, 2020, 12:53 p.m. UTC | #1
On Mon, Jun 15, 2020 at 01:16:05PM +0300, Peter Ujfalusi wrote:

> Convert omap4 sdp to device model.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
> ---
>  arch/arm/dts/Makefile           |  4 ++++
>  board/ti/sdp4430/sdp.c          | 12 ++++++++++++
>  configs/omap4_sdp4430_defconfig |  8 ++++++++
>  3 files changed, 24 insertions(+)

Please note that this, like the pandaboard series, aren't dealing with
the DM_SPI conversion which brought up removing this to start with.
While I'm pretty sure pandaboard exposes SPI on a header, I don't know
if sdp does and perhaps you just want to remove SPI?  Thanks!
Tero Kristo June 15, 2020, 1:08 p.m. UTC | #2
On 15/06/2020 15:53, Tom Rini wrote:
> On Mon, Jun 15, 2020 at 01:16:05PM +0300, Peter Ujfalusi wrote:
> 
>> Convert omap4 sdp to device model.
>>
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
>> ---
>>   arch/arm/dts/Makefile           |  4 ++++
>>   board/ti/sdp4430/sdp.c          | 12 ++++++++++++
>>   configs/omap4_sdp4430_defconfig |  8 ++++++++
>>   3 files changed, 24 insertions(+)
> 
> Please note that this, like the pandaboard series, aren't dealing with
> the DM_SPI conversion which brought up removing this to start with.
> While I'm pretty sure pandaboard exposes SPI on a header, I don't know
> if sdp does and perhaps you just want to remove SPI?  Thanks!

Can you provide a reference to the DM_SPI discussion?

I guess we could remove DM_SPI from pandaboard also if it is causing 
problems. My initial attempt on that series was just to get basic boot 
working via MMC, and that should be done now if I am not terribly 
mistaken...

-Tero

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Tom Rini June 15, 2020, 1:14 p.m. UTC | #3
On Mon, Jun 15, 2020 at 04:08:51PM +0300, Tero Kristo wrote:
> On 15/06/2020 15:53, Tom Rini wrote:
> > On Mon, Jun 15, 2020 at 01:16:05PM +0300, Peter Ujfalusi wrote:
> > 
> > > Convert omap4 sdp to device model.
> > > 
> > > Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
> > > ---
> > >   arch/arm/dts/Makefile           |  4 ++++
> > >   board/ti/sdp4430/sdp.c          | 12 ++++++++++++
> > >   configs/omap4_sdp4430_defconfig |  8 ++++++++
> > >   3 files changed, 24 insertions(+)
> > 
> > Please note that this, like the pandaboard series, aren't dealing with
> > the DM_SPI conversion which brought up removing this to start with.
> > While I'm pretty sure pandaboard exposes SPI on a header, I don't know
> > if sdp does and perhaps you just want to remove SPI?  Thanks!
> 
> Can you provide a reference to the DM_SPI discussion?
> 
> I guess we could remove DM_SPI from pandaboard also if it is causing
> problems. My initial attempt on that series was just to get basic boot
> working via MMC, and that should be done now if I am not terribly
> mistaken...

It's over in
http://patchwork.ozlabs.org/project/uboot/patch/20200527125637.149189-16-jagan at amarulasolutions.com/
but there's not much to discuss as the DM_SPI / DM_SPI_FLASH conversion
deadline was a year ago this next release, hence the removal of
platforms that haven't.  The good news for OMAP4 (and OMAP5) is that the
driver itself has already been converted so it's no more work than the
USB, etc, conversions that you've both done recently.  Thanks!
Peter Ujfalusi June 15, 2020, 1:35 p.m. UTC | #4
Hi Tom,

On 15/06/2020 16.14, Tom Rini wrote:
> On Mon, Jun 15, 2020 at 04:08:51PM +0300, Tero Kristo wrote:
>> On 15/06/2020 15:53, Tom Rini wrote:
>>> On Mon, Jun 15, 2020 at 01:16:05PM +0300, Peter Ujfalusi wrote:
>>>
>>>> Convert omap4 sdp to device model.
>>>>
>>>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
>>>> ---
>>>>   arch/arm/dts/Makefile           |  4 ++++
>>>>   board/ti/sdp4430/sdp.c          | 12 ++++++++++++
>>>>   configs/omap4_sdp4430_defconfig |  8 ++++++++
>>>>   3 files changed, 24 insertions(+)
>>>
>>> Please note that this, like the pandaboard series, aren't dealing with
>>> the DM_SPI conversion which brought up removing this to start with.
>>> While I'm pretty sure pandaboard exposes SPI on a header, I don't know
>>> if sdp does and perhaps you just want to remove SPI?  Thanks!
>>
>> Can you provide a reference to the DM_SPI discussion?
>>
>> I guess we could remove DM_SPI from pandaboard also if it is causing
>> problems. My initial attempt on that series was just to get basic boot
>> working via MMC, and that should be done now if I am not terribly
>> mistaken...
> 
> It's over in
> http://patchwork.ozlabs.org/project/uboot/patch/20200527125637.149189-16-jagan at amarulasolutions.com/
> but there's not much to discuss as the DM_SPI / DM_SPI_FLASH conversion
> deadline was a year ago this next release, hence the removal of
> platforms that haven't.  The good news for OMAP4 (and OMAP5) is that the
> driver itself has already been converted so it's no more work than the
> USB, etc, conversions that you've both done recently.  Thanks!

Adding DM_SPI to the defconfig? In the board file I don't see any trace
of SPI being enabled or used.
As I said, the ethernet would need SPI, but that never worked in mainline..

- P?ter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Tom Rini June 15, 2020, 1:38 p.m. UTC | #5
On Mon, Jun 15, 2020 at 04:35:52PM +0300, Peter Ujfalusi wrote:
> Hi Tom,
> 
> On 15/06/2020 16.14, Tom Rini wrote:
> > On Mon, Jun 15, 2020 at 04:08:51PM +0300, Tero Kristo wrote:
> >> On 15/06/2020 15:53, Tom Rini wrote:
> >>> On Mon, Jun 15, 2020 at 01:16:05PM +0300, Peter Ujfalusi wrote:
> >>>
> >>>> Convert omap4 sdp to device model.
> >>>>
> >>>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
> >>>> ---
> >>>>   arch/arm/dts/Makefile           |  4 ++++
> >>>>   board/ti/sdp4430/sdp.c          | 12 ++++++++++++
> >>>>   configs/omap4_sdp4430_defconfig |  8 ++++++++
> >>>>   3 files changed, 24 insertions(+)
> >>>
> >>> Please note that this, like the pandaboard series, aren't dealing with
> >>> the DM_SPI conversion which brought up removing this to start with.
> >>> While I'm pretty sure pandaboard exposes SPI on a header, I don't know
> >>> if sdp does and perhaps you just want to remove SPI?  Thanks!
> >>
> >> Can you provide a reference to the DM_SPI discussion?
> >>
> >> I guess we could remove DM_SPI from pandaboard also if it is causing
> >> problems. My initial attempt on that series was just to get basic boot
> >> working via MMC, and that should be done now if I am not terribly
> >> mistaken...
> > 
> > It's over in
> > http://patchwork.ozlabs.org/project/uboot/patch/20200527125637.149189-16-jagan at amarulasolutions.com/
> > but there's not much to discuss as the DM_SPI / DM_SPI_FLASH conversion
> > deadline was a year ago this next release, hence the removal of
> > platforms that haven't.  The good news for OMAP4 (and OMAP5) is that the
> > driver itself has already been converted so it's no more work than the
> > USB, etc, conversions that you've both done recently.  Thanks!
> 
> Adding DM_SPI to the defconfig? In the board file I don't see any trace
> of SPI being enabled or used.
> As I said, the ethernet would need SPI, but that never worked in mainline..

It's enabled in the defconfig today.  If you don't want to enable SPI in
U-Boot (which is fine for the 4430, I assume no one wants to spend the
time trying to enable ethernet on it at this point) just disable it.  I
only have an open question on if that's right for pandaboard because I
thought it's exposed on the expansion header, but I don't know how big a
deal that is these days really.  Thanks!
Peter Ujfalusi June 15, 2020, 1:48 p.m. UTC | #6
Hi Tom,

On 15/06/2020 16.38, Tom Rini wrote:
> On Mon, Jun 15, 2020 at 04:35:52PM +0300, Peter Ujfalusi wrote:
>> Hi Tom,
>>
>> On 15/06/2020 16.14, Tom Rini wrote:
>>> On Mon, Jun 15, 2020 at 04:08:51PM +0300, Tero Kristo wrote:
>>>> On 15/06/2020 15:53, Tom Rini wrote:
>>>>> On Mon, Jun 15, 2020 at 01:16:05PM +0300, Peter Ujfalusi wrote:
>>>>>
>>>>>> Convert omap4 sdp to device model.
>>>>>>
>>>>>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
>>>>>> ---
>>>>>>   arch/arm/dts/Makefile           |  4 ++++
>>>>>>   board/ti/sdp4430/sdp.c          | 12 ++++++++++++
>>>>>>   configs/omap4_sdp4430_defconfig |  8 ++++++++
>>>>>>   3 files changed, 24 insertions(+)
>>>>>
>>>>> Please note that this, like the pandaboard series, aren't dealing with
>>>>> the DM_SPI conversion which brought up removing this to start with.
>>>>> While I'm pretty sure pandaboard exposes SPI on a header, I don't know
>>>>> if sdp does and perhaps you just want to remove SPI?  Thanks!
>>>>
>>>> Can you provide a reference to the DM_SPI discussion?
>>>>
>>>> I guess we could remove DM_SPI from pandaboard also if it is causing
>>>> problems. My initial attempt on that series was just to get basic boot
>>>> working via MMC, and that should be done now if I am not terribly
>>>> mistaken...
>>>
>>> It's over in
>>> http://patchwork.ozlabs.org/project/uboot/patch/20200527125637.149189-16-jagan at amarulasolutions.com/
>>> but there's not much to discuss as the DM_SPI / DM_SPI_FLASH conversion
>>> deadline was a year ago this next release, hence the removal of
>>> platforms that haven't.  The good news for OMAP4 (and OMAP5) is that the
>>> driver itself has already been converted so it's no more work than the
>>> USB, etc, conversions that you've both done recently.  Thanks!
>>
>> Adding DM_SPI to the defconfig? In the board file I don't see any trace
>> of SPI being enabled or used.
>> As I said, the ethernet would need SPI, but that never worked in mainline..
> 
> It's enabled in the defconfig today.  If you don't want to enable SPI in
> U-Boot (which is fine for the 4430, I assume no one wants to spend the
> time trying to enable ethernet on it at this point) just disable it.

Right, on the SDP SPI is used for DLP (display projector),
WLAN/BT/Radio, Modem interface and the KSZ8851SNL Ethernet.
With the exception of ethernet all of them are don't care for u-boot imho.
It is actually pretty annoying that I can not use tftp boot on the
Blaze. With DM_SPI it might make sense to revisit the issue as we had
some old u-boot which used omap_mcsspi API to get ethernet working...

I'll disable the SPI for SDP in v2, let's re-enable if we can get
ethernet working on it.

> I only have an open question on if that's right for pandaboard because I
> thought it's exposed on the expansion header, but I don't know how big a
> deal that is these days really.  Thanks!
> 

- P?ter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
diff mbox series

Patch

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5ce44d701c19..03b1f8388df7 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -852,6 +852,10 @@  dtb-$(CONFIG_TARGET_OMAP4_PANDA) += \
 	omap4-panda.dtb \
 	omap4-panda-es.dtb
 
+dtb-$(CONFIG_TARGET_OMAP4_SDP4430) += \
+	omap4-sdp.dtb \
+	omap4-sdp-es23plus.dtb
+
 dtb-$(CONFIG_TARGET_OMAP5_UEVM) += \
 	omap5-uevm.dtb
 
diff --git a/board/ti/sdp4430/sdp.c b/board/ti/sdp4430/sdp.c
index a5b350404530..5b294ea79b23 100644
--- a/board/ti/sdp4430/sdp.c
+++ b/board/ti/sdp4430/sdp.c
@@ -9,6 +9,7 @@ 
 #include <init.h>
 #include <net.h>
 #include <twl6030.h>
+#include <serial.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
 
@@ -91,6 +92,17 @@  void board_mmc_power_init(void)
 #endif
 #endif
 
+#if defined(CONFIG_SPL_OS_BOOT)
+int spl_start_uboot(void)
+{
+	/* break into full u-boot on 'c' */
+	if (serial_tstc() && serial_getc() == 'c')
+		return 1;
+
+	return 0;
+}
+#endif /* CONFIG_SPL_OS_BOOT */
+
 /*
  * get_board_rev() - get board revision
  */
diff --git a/configs/omap4_sdp4430_defconfig b/configs/omap4_sdp4430_defconfig
index 219721388f13..17751cde8fdc 100644
--- a/configs/omap4_sdp4430_defconfig
+++ b/configs/omap4_sdp4430_defconfig
@@ -5,6 +5,7 @@  CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_ENV_OFFSET=0xE0000
 CONFIG_OMAP44XX=y
 CONFIG_TARGET_OMAP4_SDP4430=y
+CONFIG_DEFAULT_DEVICE_TREE="omap4-sdp"
 CONFIG_CMD_BAT=y
 CONFIG_SPL=y
 CONFIG_SPL_TEXT_BASE=0x40300000
@@ -12,6 +13,7 @@  CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_DEFAULT_FDT_FILE="omap4-sdp.dtb"
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_SPL_I2C_SUPPORT is not set
 # CONFIG_SPL_NAND_SUPPORT is not set
@@ -23,16 +25,20 @@  CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_EXT4_WRITE=y
+CONFIG_OF_CONTROL=y
 # CONFIG_EFI_PARTITION is not set
 CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
+CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_CONS_INDEX=3
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
 CONFIG_USB_GADGET=y
@@ -40,3 +46,5 @@  CONFIG_FAT_WRITE=y
 # CONFIG_REGEX is not set
 CONFIG_OF_LIBFDT=y
 # CONFIG_EFI_LOADER is not set
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_DM_ETH=y