Skip to contentSkip to conversation

omap4: sdp: convert to device model

PATCH New Peter Ujfalusi 3 participants 10 messages Jun 15, 2020 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover omap4: sdp: convert to device model

Hi,

The series is based on Tero's omap4 panda and omap5 uevm device model conversion patches.

To avoid removal of the SDP4430 due to neglect.
With these patches applied no more complaints about DM_SPL conversion and the board boots up Linux.
We never had ethernet support for spd4430 in mainline (ks8851 on spi bus), this is still the case.

Linux boots up, but for some reason ethernet is not responsible, that needs to be investigated, unlikely caused by u-boot.

I really like to keep sdp4430/Blaze support as it is the platform where I can test DMIC and other audio features of McPDM/twl6040. The board also have dual LCD, which is a nice thing to have.

Regards,
Peter
---
Peter Ujfalusi (2):
omap4: Copy device tree from Linux 5.7.y for SDP4430
omap4: sdp: convert to device model

 arch/arm/dts/Makefile               |   4 +
 arch/arm/dts/omap4-sdp-es23plus.dts |  14 +
 arch/arm/dts/omap4-sdp.dts          | 713 ++++++++++++++++++++++++++++
 board/ti/sdp4430/sdp.c              |  12 +
 configs/omap4_sdp4430_defconfig     |   8 +
 5 files changed, 751 insertions(+)
 create mode 100644 arch/arm/dts/omap4-sdp-es23plus.dts
 create mode 100644 arch/arm/dts/omap4-sdp.dts
Signature · 4 lines
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#1 lore raw

PATCH 1/2 omap4: Copy device tree from Linux 5.7.y for SDP4430

Copy all device tree files required for omap4 sdp4430 support from mainline Linux.

---
 arch/arm/dts/omap4-sdp-es23plus.dts |  14 +
 arch/arm/dts/omap4-sdp.dts          | 713 ++++++++++++++++++++++++++++
 2 files changed, 727 insertions(+)
 create mode 100644 arch/arm/dts/omap4-sdp-es23plus.dts
 create mode 100644 arch/arm/dts/omap4-sdp.dts
arch/arm/dts/omap4-sdp-es23plus.dts new file +14 -0
new file mode 100644
index 000000000000..42154520d383
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ */
+#include "omap4-sdp.dts"
+
+/* SDP boards with 4430 ES2.3+ or 4460 have external pullups on SCL & SDA */
+&dss_hdmi_pins {
+	pinctrl-single,pins = <
+		OMAP4_IOPAD(0x09a, PIN_INPUT | MUX_MODE0)		/* hdmi_cec.hdmi_cec */
+		OMAP4_IOPAD(0x09c, PIN_INPUT | MUX_MODE0)		/* hdmi_scl.hdmi_scl */
+		OMAP4_IOPAD(0x09e, PIN_INPUT | MUX_MODE0)		/* hdmi_sda.hdmi_sda */
+		>;
+};
arch/arm/dts/omap4-sdp.dts new file +713 -0

713 lines not on this page · raw message

Signature · 4 lines
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#2 lore raw

PATCH 2/2 omap4: sdp: convert to device model

In reply to Peter Ujfalusi

Convert omap4 sdp to device model.

---
 arch/arm/dts/Makefile           |  4 ++++
 board/ti/sdp4430/sdp.c          | 12 ++++++++++++
 configs/omap4_sdp4430_defconfig |  8 ++++++++
 3 files changed, 24 insertions(+)
arch/arm/dts/Makefile +4 -0
index 5ce44d701c19..03b1f8388df7 100644
@@ -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
 
board/ti/sdp4430/sdp.c +12 -0
index a5b350404530..5b294ea79b23 100644
@@ -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
  */
configs/omap4_sdp4430_defconfig +8 -0
index 219721388f13..17751cde8fdc 100644
@@ -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
Signature · 4 lines
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#3 lore raw

PATCH 2/2 omap4: sdp: convert to device model

Quoted 8 lines · Peter Ujfalusi

Convert omap4 sdp to device model.

---
 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!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200615/35d1c5e8/attachment.sig>
#4 lore raw

PATCH 2/2 omap4: sdp: convert to device model

Quoted 11 lines · Tom Rini
Quoted 8 lines · Peter Ujfalusi

Convert omap4 sdp to device model.

---
  arch/arm/dts/Makefile           |  4 ++++
  board/ti/sdp4430/sdp.c          | 12 ++++++++++++
  configs/omap4_sdp4430_defconfig |  8 ++++++++
  3 files changed, 24 insertions(+)
Quoted 4 lines

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

#5 lore raw

PATCH 2/2 omap4: sdp: convert to device model

Quoted 17 lines · Tero Kristo
Quoted 11 lines · Tom Rini
Quoted 8 lines · Peter Ujfalusi

Convert omap4 sdp to device model.

---
  arch/arm/dts/Makefile           |  4 ++++
  board/ti/sdp4430/sdp.c          | 12 ++++++++++++
  configs/omap4_sdp4430_defconfig |  8 ++++++++
  3 files changed, 24 insertions(+)
Quoted 4 lines

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!

Quoted 6 lines

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!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200615/2c102c55/attachment.sig>
#6 lore raw

PATCH 2/2 omap4: sdp: convert to device model

Hi Tom,

Quoted 25 lines · Tom Rini
Quoted 17 lines · Tero Kristo
Quoted 11 lines · Tom Rini
Quoted 8 lines · Peter Ujfalusi

Convert omap4 sdp to device model.

---
  arch/arm/dts/Makefile           |  4 ++++
  board/ti/sdp4430/sdp.c          | 12 ++++++++++++
  configs/omap4_sdp4430_defconfig |  8 ++++++++
  3 files changed, 24 insertions(+)
Quoted 4 lines

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!

Quoted 6 lines

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...

Quoted 7 lines

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

#7 lore raw

PATCH 2/2 omap4: sdp: convert to device model

Quoted 36 lines · Peter Ujfalusi

Hi Tom,

Quoted 25 lines · Tom Rini
Quoted 17 lines · Tero Kristo
Quoted 11 lines · Tom Rini
Quoted 8 lines · Peter Ujfalusi

Convert omap4 sdp to device model.

---
  arch/arm/dts/Makefile           |  4 ++++
  board/ti/sdp4430/sdp.c          | 12 ++++++++++++
  configs/omap4_sdp4430_defconfig |  8 ++++++++
  3 files changed, 24 insertions(+)
Quoted 4 lines

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!

Quoted 6 lines

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...

Quoted 7 lines

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!

Quoted 3 lines

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!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200615/73a6b2e5/attachment.sig>
#8 lore raw

PATCH 2/2 omap4: sdp: convert to device model

Hi Tom,

Quoted 37 lines · Tom Rini
Quoted 36 lines · Peter Ujfalusi

Hi Tom,

Quoted 32 lines · Tom Rini
Quoted 17 lines · Tero Kristo
Quoted 11 lines · Tom Rini
Quoted 8 lines · Peter Ujfalusi

Convert omap4 sdp to device model.

---
  arch/arm/dts/Makefile           |  4 ++++
  board/ti/sdp4430/sdp.c          | 12 ++++++++++++
  configs/omap4_sdp4430_defconfig |  8 ++++++++
  3 files changed, 24 insertions(+)
Quoted 4 lines

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!

Quoted 6 lines

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!

Quoted 7 lines
Quoted 3 lines

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.

Quoted 4 lines

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

#9 lore raw

cover omap4: sdp: convert to device model

In reply to Peter Ujfalusi
Quoted 5 lines · Peter Ujfalusi

Hi,

The series is based on Tero's omap4 panda and omap5 uevm device model conversion patches.

Quoted 8 lines

To avoid removal of the SDP4430 due to neglect.
With these patches applied no more complaints about DM_SPL conversion and the board boots up Linux.
We never had ethernet support for spd4430 in mainline (ks8851 on spi bus), this is still the case.

Linux boots up, but for some reason ethernet is not responsible, that needs to be investigated, unlikely caused by u-boot.

Actually it works in Linux.

Quoted 11 lines

I really like to keep sdp4430/Blaze support as it is the platform where I can test DMIC and other audio features of McPDM/twl6040. The board also have dual LCD, which is a nice thing to have.

Regards,
Peter
---
Peter Ujfalusi (2):
omap4: Copy device tree from Linux 5.7.y for SDP4430
omap4: sdp: convert to device model

Quoted 9 lines
 arch/arm/dts/Makefile               |   4 +
 arch/arm/dts/omap4-sdp-es23plus.dts |  14 +
 arch/arm/dts/omap4-sdp.dts          | 713 ++++++++++++++++++++++++++++
 board/ti/sdp4430/sdp.c              |  12 +
 configs/omap4_sdp4430_defconfig     |   8 +
 5 files changed, 751 insertions(+)
 create mode 100644 arch/arm/dts/omap4-sdp-es23plus.dts
 create mode 100644 arch/arm/dts/omap4-sdp.dts

- P?ter

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