Skip to contentSkip to conversation

Patchset v4 Poplar 96Boards EE

U-Boot Superseded Jorge Ramirez-Ortiz 5 participants 53 messages May 8, 2017 – May 29, 2017

Subsystems (5)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

[PATCHv4 1/3] ARM64: dts: hi3798cv200-poplar: add device tree bindings [PATCHv4 2/3] driver: mmc: update debug info
[PATCHv4 3/3] ARM64: poplar: hi3798cv200: u-boot support for Poplar

The following changes with respect to v3:

- Remove modifications to the linux kernel device tree
- Introduce board specific uboot device tree config
* specify the clock for the console
* define the ehci parameters to allow using the ehci-generic driver

#1 lore raw

PATCH v4 1/3 ARM64: dts: hi3798cv200-poplar: add device tree bindings

pulled from linux-next tag 20170505

---
 arch/arm/dts/hi3798cv200-poplar.dts     | 162 +++++++++++++
 arch/arm/dts/hi3798cv200.dtsi           | 411 ++++++++++++++++++++++++++++++++
 include/dt-bindings/clock/histb-clock.h |  66 +++++
 include/dt-bindings/reset/ti-syscon.h   |  38 +++
 4 files changed, 677 insertions(+)
 create mode 100644 arch/arm/dts/hi3798cv200-poplar.dts
 create mode 100644 arch/arm/dts/hi3798cv200.dtsi
 create mode 100644 include/dt-bindings/clock/histb-clock.h
 create mode 100644 include/dt-bindings/reset/ti-syscon.h
arch/arm/dts/hi3798cv200-poplar.dts new file +162 -0
new file mode 100644
index 0000000..b914287
@@ -0,0 +1,162 @@
+/*
+ * DTS File for HiSilicon Poplar Development Board
+ *
+ * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
+ *
+ * Released under the GPLv2 only.
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include "hi3798cv200.dtsi"
+
+/ {
+	model = "HiSilicon Poplar Development Board";
+	compatible = "hisilicon,hi3798cv200-poplar", "hisilicon,hi3798cv200";
+
+	aliases {
+		serial0 = &uart0;
+		serial2 = &uart2;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x0 0x0 0x0 0x80000000>;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		user-led0 {
+			label = "USER-LED0";
+			gpios = <&gpio6 3 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "heartbeat";
+			default-state = "off";
+		};
+
+		user-led1 {
+			label = "USER-LED1";
+			gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "mmc0";
+			default-state = "off";
+		};
+
+		user-led2 {
+			label = "USER-LED2";
+			gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "none";
+			default-state = "off";
+		};
+
+		user-led3 {
+			label = "USER-LED3";
+			gpios = <&gpio10 6 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "cpu0";
+			default-state = "off";
+		};
+	};
+};
+
+&gmac1 {
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+	phy-handle = <&eth_phy1>;
+	phy-mode = "rgmii";
+	hisilicon,phy-reset-delays-us = <10000 10000 30000>;
+
+	eth_phy1: phy at 3 {
+		reg = <3>;
+	};
+};
+
+&gpio1 {
+	status = "okay";
+	gpio-line-names = "LS-GPIO-E",	"",
+			  "",		"",
+			  "",		"LS-GPIO-F",
+			  "",		"LS-GPIO-J";
+};
+
+&gpio2 {
+	status = "okay";
+	gpio-line-names = "LS-GPIO-H",	"LS-GPIO-I",
+			  "LS-GPIO-L",	"LS-GPIO-G",
+			  "LS-GPIO-K",	"",
+			  "",		"";
+};
+
+&gpio3 {
+	status = "okay";
+	gpio-line-names = "",		"",
+			  "",		"",
+			  "LS-GPIO-C",	"",
+			  "",		"LS-GPIO-B";
+};
+
+&gpio4 {
+	status = "okay";
+	gpio-line-names = "",		"",
+			  "",		"",
+			  "",		"LS-GPIO-D",
+			  "",		"";
+};
+
+&gpio5 {
+	status = "okay";
+	gpio-line-names = "",		"USER-LED-1",
+			  "USER-LED-2",	"",
+			  "",		"LS-GPIO-A",
+			  "",		"";
+};
+
+&gpio6 {
+	status = "okay";
+	gpio-line-names = "",		"",
+			  "",		"USER-LED-0",
+			  "",		"",
+			  "",		"";
+};
+
+&gpio10 {
+	status = "okay";
+	gpio-line-names = "",		"",
+			  "",		"",
+			  "",		"",
+			  "USER-LED-3",	"";
+};
+
+&i2c0 {
+	status = "okay";
+	label = "LS-I2C0";
+};
+
+&i2c2 {
+	status = "okay";
+	label = "LS-I2C1";
+};
+
+&ir {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+	label = "LS-SPI0";
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&uart2 {
+	status = "okay";
+	label = "LS-UART0";
+};
+/* No optional LS-UART1 on Low Speed Expansion Connector. */
arch/arm/dts/hi3798cv200.dtsi new file +411 -0

411 lines not on this page · raw message

include/dt-bindings/clock/histb-clock.h new file +66 -0

66 lines not on this page · raw message

include/dt-bindings/reset/ti-syscon.h new file +38 -0
new file mode 100644
index 0000000..884fd91
@@ -0,0 +1,38 @@
+/*
+ * TI Syscon Reset definitions
+ *
+ * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __DT_BINDINGS_RESET_TI_SYSCON_H__
+#define __DT_BINDINGS_RESET_TI_SYSCON_H__
+
+/*
+ * The reset does not support the feature and corresponding
+ * values are not valid
+ */
+#define ASSERT_NONE	(1 << 0)
+#define DEASSERT_NONE	(1 << 1)
+#define STATUS_NONE	(1 << 2)
+
+/* When set this function is activated by setting(vs clearing) this bit */
+#define ASSERT_SET	(1 << 3)
+#define DEASSERT_SET	(1 << 4)
+#define STATUS_SET	(1 << 5)
+
+/* The following are the inverse of the above and are added for consistency */
+#define ASSERT_CLEAR	(0 << 3)
+#define DEASSERT_CLEAR	(0 << 4)
+#define STATUS_CLEAR	(0 << 5)
+
+#endif
Signature · 1 line
2.7.4
#2 lore raw

PATCH v4 2/3 driver: mmc: update debug info

In reply to Jorge Ramirez-Ortiz

This driver is used in another board; remove board information from the driver debug log.

---
 drivers/mmc/hi6220_dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/hi6220_dw_mmc.c +1 -1
index fdaf1e4..d795198 100644
@@ -20,7 +20,7 @@
 
 static int hi6220_dwmci_core_init(struct dwmci_host *host, int index)
 {
-	host->name = "HiKey DWMMC";
+	host->name = "Hisilicon DWMMC";
 
 	host->dev_index = index;
 
Signature · 1 line
2.7.4
#3 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

In reply to Jorge Ramirez-Ortiz

This port adds support for:
1) Serial
2) eMMC
3) USB

It has been tested with ARM TRUSTED FIRMWARE running u-boot as the BL33 executable [see board's README]

eMMC has been tested for reading and booting the loader[1] and linux kernels as well as saving the u-boot environment.

USB has been tested with ASIX networking adapter and SanDisk 7.4GB drive.

PSCI has been tested via the reset call.

The firwmare upgrade process has been tested via TFTP and USB FAT filesystem containing the fastboot.bin image in one of the partitions.

---
 arch/arm/Kconfig                                   |  12 ++
 arch/arm/dts/hi3798cv200.dtsi                      |   3 +
 arch/arm/dts/poplar-uboot.dtsi                     |  24 +++
 arch/arm/include/asm/arch-hi3798cv200/dwmmc.h      |  13 ++
 .../arm/include/asm/arch-hi3798cv200/hi3798cv200.h |  50 +++++
 board/hisilicon/poplar/Kconfig                     |  15 ++
 board/hisilicon/poplar/MAINTAINERS                 |   6 +
 board/hisilicon/poplar/Makefile                    |   7 +
 board/hisilicon/poplar/README                      | 232 +++++++++++++++++++++
 board/hisilicon/poplar/poplar.c                    | 155 ++++++++++++++
 configs/poplar_defconfig                           |  26 +++
 include/configs/poplar.h                           |  86 ++++++++
 12 files changed, 629 insertions(+)
 create mode 100644 arch/arm/dts/poplar-uboot.dtsi
 create mode 100644 arch/arm/include/asm/arch-hi3798cv200/dwmmc.h
 create mode 100644 arch/arm/include/asm/arch-hi3798cv200/hi3798cv200.h
 create mode 100644 board/hisilicon/poplar/Kconfig
 create mode 100644 board/hisilicon/poplar/MAINTAINERS
 create mode 100644 board/hisilicon/poplar/Makefile
 create mode 100644 board/hisilicon/poplar/README
 create mode 100644 board/hisilicon/poplar/poplar.c
 create mode 100644 configs/poplar_defconfig
 create mode 100644 include/configs/poplar.h
arch/arm/Kconfig +12 -0
index 1df6b36..d41e047 100644
@@ -816,6 +816,17 @@ config TARGET_HIKEY
 	  Support for HiKey 96boards platform. It features a HI6220
 	  SoC, with 8xA53 CPU, mali450 gpu, and 1GB RAM.
 
+config TARGET_POPLAR
+	bool "Support Poplar 96boards Enterprise Edition Platform"
+	select ARM64
+	select DM
+	select OF_CONTROL
+	select DM_SERIAL
+	select DM_USB
+	  help
+	  Support for Poplar 96boards EE platform. It features a HI3798cv200
+	  SoC, with 4xA53 CPU, MaliT720 GPU, and 1GB RAM.
+
 config TARGET_LS1012AQDS
 	bool "Support ls1012aqds"
 	select ARCH_LS1012A
@@ -1145,6 +1156,7 @@ source "board/grinn/chiliboard/Kconfig"
 source "board/gumstix/pepper/Kconfig"
 source "board/h2200/Kconfig"
 source "board/hisilicon/hikey/Kconfig"
+source "board/hisilicon/poplar/Kconfig"
 source "board/imx31_phycore/Kconfig"
 source "board/isee/igep0033/Kconfig"
 source "board/olimex/mx23_olinuxino/Kconfig"
arch/arm/dts/hi3798cv200.dtsi +3 -0
index 75865f8..caa17de 100644
@@ -409,3 +409,6 @@
 		};
 	};
 };
+
+#include "poplar-uboot.dtsi"
+
arch/arm/dts/poplar-uboot.dtsi new file +24 -0
new file mode 100644
index 0000000..8a9668a
@@ -0,0 +1,24 @@
+/*
+ * U-Boot addition to:
+ *  1) initialize the console clock rate.
+ *  2) provide support for the generic-ehci USB driver currently not available
+ *     in the linux kernel (8/May/2017).
+ *
+ * (C) Copyright 2017 Jorge Ramirez-Ortiz <[email protected]>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+&soc {
+	usb2: ehci at 9890000 {
+		compatible = "generic-ehci";
+		reg = <0x9890000 0x100>;
+		status = "okay";
+	};
+};
+
+&uart0 {
+	clock = <75000000>;
+	status = "okay";
+};
+
arch/arm/include/asm/arch-hi3798cv200/dwmmc.h new file +13 -0
new file mode 100644
index 0000000..1060d94
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2017 Linaro
+ * Jorge Ramirez-Ortiz <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _HI3798cv200_DWMMC_H_
+#define _HI3798cv200_DWMMC_H_
+
+int hi6220_dwmci_add_port(int index, u32 regbase, int bus_width);
+
+#endif /* _HI3798cv200_DWMMC_H_ */
arch/arm/include/asm/arch-hi3798cv200/hi3798cv200.h new file +50 -0

50 lines not on this page · raw message

board/hisilicon/poplar/Kconfig new file +15 -0
new file mode 100644
index 0000000..3397295
@@ -0,0 +1,15 @@
+if TARGET_POPLAR
+
+config SYS_BOARD
+	default "poplar"
+
+config SYS_VENDOR
+	default "hisilicon"
+
+config SYS_SOC
+	default "hi3798cv200"
+
+config SYS_CONFIG_NAME
+	default "poplar"
+
+endif
board/hisilicon/poplar/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000..0cc01c8
@@ -0,0 +1,6 @@
+Poplar BOARD
+M:     Jorge Ramirez-Ortiz <[email protected]>
+S:     Maintained
+F:     board/hisilicon/poplar
+F:     include/configs/poplar.h
+F:     configs/poplar_defconfig
board/hisilicon/poplar/Makefile new file +7 -0
new file mode 100644
index 0000000..101545d
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2017 Linaro
+# Jorge Ramirez-Ortiz <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+obj-y	:= poplar.o
board/hisilicon/poplar/README new file +232 -0

232 lines not on this page · raw message

board/hisilicon/poplar/poplar.c new file +155 -0

155 lines not on this page · raw message

configs/poplar_defconfig new file +26 -0
new file mode 100644
index 0000000..8f9f40f
@@ -0,0 +1,26 @@
+CONFIG_ARM=y
+CONFIG_TARGET_POPLAR=y
+CONFIG_IDENT_STRING="poplar"
+CONFIG_DEFAULT_DEVICE_TREE="hi3798cv200-poplar"
+CONFIG_SYS_PROMPT="poplar# "
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_DISPLAY_CPUINFO=n
+CONFIG_DISPLAY_BOARDINFO=y
+CONFIG_ISO_PARTITION=n
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_K3=y
+CONFIG_PL011_SERIAL=y
+CONFIG_PSCI_RESET=y
+CONFIG_USB=y
+CONFIG_USB_EHCI=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_STORAGE=y
+CONFIG_NET=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_DM_GPIO is not set
+CONFIG_LIB_RAND=y
+CONFIG_CMD_UNZIP=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+
include/configs/poplar.h new file +86 -0

86 lines not on this page · raw message

Signature · 1 line
2.7.4
#4 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 4 lines · Jorge Ramirez-Ortiz

This port adds support for:
1) Serial
2) eMMC
3) USB

[snip]

Quoted 2 lines
 arch/arm/dts/hi3798cv200.dtsi                      |   3 +
 arch/arm/dts/poplar-uboot.dtsi                     |  24 +++

[snip]

arch/arm/dts/hi3798cv200.dtsi line 413

Quoted 10 lines
arch/arm/dts/hi3798cv200.dtsi +2 -0
index 75865f8..caa17de 100644
@@ -409,3 +409,6 @@
 		};
 	};
 };
+
+#include "poplar-uboot.dtsi"

NAK, that's not the mechanism, we have one that will automatically include the right file. IF it's needed.

Quoted 19 lines
arch/arm/dts/poplar-uboot.dtsi new file +13 -0
new file mode 100644
index 0000000..8a9668a
@@ -0,0 +1,24 @@
+/*
+ * U-Boot addition to:
+ *  1) initialize the console clock rate.
+ *  2) provide support for the generic-ehci USB driver currently not available
+ *     in the linux kernel (8/May/2017).
+ *
+ * (C) Copyright 2017 Jorge Ramirez-Ortiz <[email protected]>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+&soc {
+	usb2: ehci at 9890000 {

arch/arm/dts/poplar-uboot.dtsi line 23

Quoted 10 lines
arch/arm/dts/poplar-uboot.dtsi new file +10 -0
+		compatible = "generic-ehci";
+		reg = <0x9890000 0x100>;
+		status = "okay";
+	};
+};
+
+&uart0 {
+	clock = <75000000>;
+	status = "okay";
+};

These are NOT U-Boot specific properties, they should be in the generic board dts file. Lets wait for Alex to chime in on the status of getting the dts file / etc merged into Linux before doing v5. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170508/2ce647aa/attachment.sig>
#5 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 10 lines · Tom Rini
Quoted 4 lines · Jorge Ramirez-Ortiz

This port adds support for:
1) Serial
2) eMMC
3) USB

[snip]

Quoted 2 lines
  arch/arm/dts/hi3798cv200.dtsi                      |   3 +
  arch/arm/dts/poplar-uboot.dtsi                     |  24 +++

[snip]

Quoted 12 lines

arch/arm/dts/hi3798cv200.dtsi line 413

Quoted 10 lines
arch/arm/dts/hi3798cv200.dtsi +2 -0
index 75865f8..caa17de 100644
@@ -409,3 +409,6 @@
  		};
  	};
  };
+
+#include "poplar-uboot.dtsi"

NAK, that's not the mechanism, we have one that will automatically include the right file. IF it's needed.

yeah I thought so...still what about what is being done for the dragonboard? (that is what misled me really)
seems to me that board needs fixing as well...

Quoted 24 lines
Quoted 24 lines
arch/arm/dts/poplar-uboot.dtsi new file +17 -0
new file mode 100644
index 0000000..8a9668a
@@ -0,0 +1,24 @@
+/*
+ * U-Boot addition to:
+ *  1) initialize the console clock rate.
+ *  2) provide support for the generic-ehci USB driver currently not available
+ *     in the linux kernel (8/May/2017).
+ *
+ * (C) Copyright 2017 Jorge Ramirez-Ortiz <[email protected]>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+&soc {
+	usb2: ehci at 9890000 {
+		compatible = "generic-ehci";
+		reg = <0x9890000 0x100>;
+		status = "okay";
+	};
Quoted 8 lines

arch/arm/dts/poplar-uboot.dtsi line 23

Quoted 6 lines
arch/arm/dts/poplar-uboot.dtsi new file +6 -0
+};
+
+&uart0 {
+	clock = <75000000>;
+	status = "okay";
+};

These are NOT U-Boot specific properties, they should be in the generic board dts file.

why did you ask me to remove them from the generic board dts file?

Quoted 3 lines

Lets wait for Alex to chime in on the status of getting the dts file / etc merged into Linux before doing v5. Thanks!

sure, no pb. thanks for the quick responses :)

#6 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 24 lines · Jorge Ramirez
Quoted 10 lines · Tom Rini
Quoted 4 lines · Jorge Ramirez-Ortiz

This port adds support for:
1) Serial
2) eMMC
3) USB

[snip]

Quoted 2 lines
 arch/arm/dts/hi3798cv200.dtsi                      |   3 +
 arch/arm/dts/poplar-uboot.dtsi                     |  24 +++

[snip]

Quoted 12 lines

arch/arm/dts/hi3798cv200.dtsi line 413

Quoted 10 lines
arch/arm/dts/hi3798cv200.dtsi +2 -0
index 75865f8..caa17de 100644
@@ -409,3 +409,6 @@
 		};
 	};
 };
+
+#include "poplar-uboot.dtsi"

NAK, that's not the mechanism, we have one that will automatically include the right file. IF it's needed.

Quoted 3 lines

yeah I thought so...still what about what is being done for the dragonboard? (that is what misled me really)
seems to me that board needs fixing as well...

Yes, patches welcome ;) Seriously tho, yes, dragonboard is a bad example here, along with some exynos and broadcom parts, and should be corrected. I'd appreciate a patch there.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170508/dae76b0f/attachment.sig>
#7 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

In reply to Tom Rini
Quoted 47 lines · Tom Rini
Quoted 4 lines · Jorge Ramirez-Ortiz

This port adds support for:
1) Serial
2) eMMC
3) USB

[snip]

Quoted 2 lines
  arch/arm/dts/hi3798cv200.dtsi                      |   3 +
  arch/arm/dts/poplar-uboot.dtsi                     |  24 +++

[snip]

arch/arm/dts/hi3798cv200.dtsi line 413

Quoted 10 lines
arch/arm/dts/hi3798cv200.dtsi +2 -0
index 75865f8..caa17de 100644
@@ -409,3 +409,6 @@
  		};
  	};
  };
+
+#include "poplar-uboot.dtsi"

NAK, that's not the mechanism, we have one that will automatically include the right file. IF it's needed.

Quoted 24 lines
arch/arm/dts/poplar-uboot.dtsi new file +18 -0
new file mode 100644
index 0000000..8a9668a
@@ -0,0 +1,24 @@
+/*
+ * U-Boot addition to:
+ *  1) initialize the console clock rate.
+ *  2) provide support for the generic-ehci USB driver currently not available
+ *     in the linux kernel (8/May/2017).
+ *
+ * (C) Copyright 2017 Jorge Ramirez-Ortiz <[email protected]>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+&soc {
+	usb2: ehci at 9890000 {
+		compatible = "generic-ehci";
+		reg = <0x9890000 0x100>;
+		status = "okay";
+	};
+};
Quoted 9 lines

arch/arm/dts/poplar-uboot.dtsi line 23

Quoted 5 lines
arch/arm/dts/poplar-uboot.dtsi new file +5 -0
+
+&uart0 {
+	clock = <75000000>;
+	status = "okay";
+};

These are NOT U-Boot specific properties, they should be in the generic board dts file. Lets wait for Alex to chime in on the status of getting the dts file / etc merged into Linux before doing v5. Thanks!

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required :) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

would this be acceptable? if not, what would you see us doing?

#8 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 68 lines · Jorge Ramirez
Quoted 47 lines · Tom Rini
Quoted 4 lines · Jorge Ramirez-Ortiz

This port adds support for:
1) Serial
2) eMMC
3) USB

[snip]

Quoted 2 lines
 arch/arm/dts/hi3798cv200.dtsi                      |   3 +
 arch/arm/dts/poplar-uboot.dtsi                     |  24 +++

[snip]

arch/arm/dts/hi3798cv200.dtsi line 413

Quoted 10 lines
arch/arm/dts/hi3798cv200.dtsi +2 -0
index 75865f8..caa17de 100644
@@ -409,3 +409,6 @@
 		};
 	};
 };
+
+#include "poplar-uboot.dtsi"

NAK, that's not the mechanism, we have one that will automatically include the right file. IF it's needed.

Quoted 24 lines
arch/arm/dts/poplar-uboot.dtsi new file +18 -0
new file mode 100644
index 0000000..8a9668a
@@ -0,0 +1,24 @@
+/*
+ * U-Boot addition to:
+ *  1) initialize the console clock rate.
+ *  2) provide support for the generic-ehci USB driver currently not available
+ *     in the linux kernel (8/May/2017).
+ *
+ * (C) Copyright 2017 Jorge Ramirez-Ortiz <[email protected]>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+&soc {
+	usb2: ehci at 9890000 {
+		compatible = "generic-ehci";
+		reg = <0x9890000 0x100>;
+		status = "okay";
+	};
+};
Quoted 9 lines

arch/arm/dts/poplar-uboot.dtsi line 23

Quoted 5 lines
arch/arm/dts/poplar-uboot.dtsi new file +5 -0
+
+&uart0 {
+	clock = <75000000>;
+	status = "okay";
+};

These are NOT U-Boot specific properties, they should be in the generic board dts file. Lets wait for Alex to chime in on the status of getting the dts file / etc merged into Linux before doing v5. Thanks!

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

Quoted 8 lines

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required :) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Can you take a stab at updating the pl01x driver? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170509/34a88d09/attachment.sig>
#9 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 14 lines · Tom Rini
Quoted 14 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Quoted 5 lines
Quoted 4 lines

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Can you take a stab at updating the pl01x driver? Thanks!

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

- if the issue for accepting the Poplar patchset is with the dts modification I can revert to just not using OF for pl01x like other platforms do.
- if the issue is that we wish to enforce each new platform to commit a clock driver then I just need to plan for it (to be honest I didn't envision this to be the case when all I need is to enable a uart)

maintaining full compatibility with the kernel's dts comes at a price so just making sure that this is the direction we want to take (not just a one off where I am the lucky one :) )

#10 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 19 lines · Jorge Ramirez
Quoted 18 lines · Tom Rini
Quoted 18 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Quoted 6 lines
Quoted 1 line

Can you take a stab at updating the pl01x driver? Thanks!

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170510/e46a6043/attachment.sig>
maintainer
#11 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 22 lines · Tom Rini
Quoted 21 lines · Jorge Ramirez
Quoted 19 lines · Tom Rini
Quoted 10 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

Quoted 8 lines

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Can you take a stab at updating the pl01x driver? Thanks!

Quoted 8 lines
Quoted 4 lines

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Rob

#12 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 32 lines · Rob Herring
Quoted 22 lines · Tom Rini
Quoted 21 lines · Jorge Ramirez
Quoted 19 lines · Tom Rini
Quoted 10 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

Quoted 8 lines

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Can you take a stab at updating the pl01x driver? Thanks!

Quoted 8 lines
Quoted 4 lines

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

Quoted 6 lines

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Aw crap, I'm in the wrong. I was thinking this was "clock-frequency" and not that we had invented our own property here.

Quoted 7 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

So, trying to dig out of the hole we made here. The generic serial binding (bindings/serial/serial.txt) documents clock-frequency. The pl011 binding (and primecell which it also references) does not. Would adding clock-frequency to a pl011 node be valid or invalid? If valid, would it also be acceptable to include in dts files that also fill in clocks/clock-names from that binding? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170510/5df0e0d0/attachment.sig>
#13 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Hi,

Quoted 51 lines · Tom Rini
Quoted 32 lines · Rob Herring
Quoted 22 lines · Tom Rini
Quoted 21 lines · Jorge Ramirez
Quoted 19 lines · Tom Rini
Quoted 10 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

Quoted 8 lines

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Can you take a stab at updating the pl01x driver? Thanks!

Quoted 8 lines
Quoted 4 lines

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

Quoted 6 lines

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Aw crap, I'm in the wrong. I was thinking this was "clock-frequency" and not that we had invented our own property here.

Quoted 7 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Quoted 6 lines

So, trying to dig out of the hole we made here. The generic serial binding (bindings/serial/serial.txt) documents clock-frequency. The pl011 binding (and primecell which it also references) does not. Would adding clock-frequency to a pl011 node be valid or invalid? If valid, would it also be acceptable to include in dts files that also fill in clocks/clock-names from that binding? Thanks!

clock-frequency should be OK and supported for boards which don't yet have a clock driver. I don't think we need to explicitly update the pl011 binding though.

Regards,
Simon

maintainer
#14 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

In reply to Tom Rini
Quoted 51 lines · Tom Rini
Quoted 32 lines · Rob Herring
Quoted 22 lines · Tom Rini
Quoted 21 lines · Jorge Ramirez
Quoted 19 lines · Tom Rini
Quoted 10 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

Quoted 8 lines

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Can you take a stab at updating the pl01x driver? Thanks!

Quoted 8 lines
Quoted 4 lines

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

Quoted 6 lines

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Aw crap, I'm in the wrong. I was thinking this was "clock-frequency" and not that we had invented our own property here.

Quoted 7 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Quoted 4 lines

So, trying to dig out of the hole we made here. The generic serial binding (bindings/serial/serial.txt) documents clock-frequency. The pl011 binding (and primecell which it also references) does not. Would adding clock-frequency to a pl011 node be valid or invalid?

Valid in general. It's a common property in the DT spec. Though, it should be listed in the pl011 binding doc as used just like we list reg or interrupts.

Quoted 3 lines

If valid,
would it also be acceptable to include in dts files that also fill in clocks/clock-names from that binding?

Generally we treat that as not valid as they are mutually exclusive.

There's 2 better options. You can define fixed clocks with "fixed-clock" compatible and you already have infrastructure in u-boot to use that. However, the upstream dts file already defines clocks, so that doesn't really work here. The 2nd option is have a table of clock ids and frequencies and register that list of clocks based on matching the clock controller. You'd need a little bit of infrastructure to support that, but otherwise a platform would just need to define a table.

Rob

#15 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Hi,

Quoted 67 lines · Rob Herring
Quoted 51 lines · Tom Rini
Quoted 32 lines · Rob Herring
Quoted 22 lines · Tom Rini
Quoted 21 lines · Jorge Ramirez
Quoted 19 lines · Tom Rini
Quoted 10 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

Quoted 8 lines

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Can you take a stab at updating the pl01x driver? Thanks!

Quoted 8 lines
Quoted 4 lines

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

Quoted 6 lines

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Aw crap, I'm in the wrong. I was thinking this was "clock-frequency" and not that we had invented our own property here.

Quoted 7 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Quoted 4 lines

So, trying to dig out of the hole we made here. The generic serial binding (bindings/serial/serial.txt) documents clock-frequency. The pl011 binding (and primecell which it also references) does not. Would adding clock-frequency to a pl011 node be valid or invalid?

Valid in general. It's a common property in the DT spec. Though, it should be listed in the pl011 binding doc as used just like we list reg or interrupts.

Quoted 3 lines

If valid,
would it also be acceptable to include in dts files that also fill in clocks/clock-names from that binding?

Generally we treat that as not valid as they are mutually exclusive.

Quoted 8 lines

There's 2 better options. You can define fixed clocks with "fixed-clock" compatible and you already have infrastructure in u-boot to use that. However, the upstream dts file already defines clocks, so that doesn't really work here. The 2nd option is have a table of clock ids and frequencies and register that list of clocks based on matching the clock controller. You'd need a little bit of infrastructure to support that, but otherwise a platform would just need to define a table.

It sounds like you are saying the first option isn't an option. The second option adds another layer of pain - we are trying to avoid having platform data.

I'd prefer (in this order):

1. A clock driver
2. Use the existing clock-frequency property

Regards,
SImon

#16 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 44 lines · Simon Glass
Quoted 36 lines
Quoted 23 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

Quoted 6 lines

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Aw crap, I'm in the wrong. I was thinking this was "clock-frequency" and not that we had invented our own property here.

Quoted 7 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Quoted 4 lines

So, trying to dig out of the hole we made here. The generic serial binding (bindings/serial/serial.txt) documents clock-frequency. The pl011 binding (and primecell which it also references) does not. Would adding clock-frequency to a pl011 node be valid or invalid?

Valid in general. It's a common property in the DT spec. Though, it should be listed in the pl011 binding doc as used just like we list reg or interrupts.

Quoted 3 lines

If valid,
would it also be acceptable to include in dts files that also fill in clocks/clock-names from that binding?

Generally we treat that as not valid as they are mutually exclusive.

Quoted 8 lines

There's 2 better options. You can define fixed clocks with "fixed-clock" compatible and you already have infrastructure in u-boot to use that. However, the upstream dts file already defines clocks, so that doesn't really work here. The 2nd option is have a table of clock ids and frequencies and register that list of clocks based on matching the clock controller. You'd need a little bit of infrastructure to support that, but otherwise a platform would just need to define a table.

Quoted 7 lines

It sounds like you are saying the first option isn't an option. The second option adds another layer of pain - we are trying to avoid having platform data.

I'd prefer (in this order):

1. A clock driver

please could you explain the rationale for this request on this particular platform?

And I mean for a platform where a clock driver will:

1. NOT access any hardware
2. *only* provide single hard-coded value (a compiled in frequency) for the pl01x driver.

Consider also (another option) that the pl01x driver can be compiled without OF support and that said frequency can be provided by CONFIG.

It is just that before adding layers of stub code I would like to understand the technical need when there is only one consumer (I don't want to pollute U-Boot's code base with code that is not providing value).

What do we want to achieve by writing a SoC clock driver that hard-codes the frequency rate for the console?
what is the benefit of having such a driver and why is this not an overkill on this platform?

Quoted 1 line

2. Use the existing clock-frequency property

yes, this I could understand.
And it doesn't even need to add a single line to the linux kernel dts files which would be imported from the linux kernel tree and keep unmodified.

#17 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Hi,

Quoted 70 lines · Jorge Ramirez

On 05/10/2017 09:42 PM, Simon Glass wrote:

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Aw crap, I'm in the wrong. I was thinking this was "clock-frequency" and not that we had invented our own property here.

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

So, trying to dig out of the hole we made here. The generic serial binding (bindings/serial/serial.txt) documents clock-frequency. The pl011 binding (and primecell which it also references) does not. Would adding clock-frequency to a pl011 node be valid or invalid?

Valid in general. It's a common property in the DT spec. Though, it should be listed in the pl011 binding doc as used just like we list reg or interrupts.

If valid,
would it also be acceptable to include in dts files that also fill in clocks/clock-names from that binding?

Generally we treat that as not valid as they are mutually exclusive.

There's 2 better options. You can define fixed clocks with "fixed-clock" compatible and you already have infrastructure in u-boot to use that. However, the upstream dts file already defines clocks, so that doesn't really work here. The 2nd option is have a table of clock ids and frequencies and register that list of clocks based on matching the clock controller. You'd need a little bit of infrastructure to support that, but otherwise a platform would just need to define a table.

It sounds like you are saying the first option isn't an option. The second option adds another layer of pain - we are trying to avoid having platform data.

I'd prefer (in this order):

1. A clock driver

please could you explain the rationale for this request on this particular platform?

And I mean for a platform where a clock driver will:

1. NOT access any hardware
2. *only* provide single hard-coded value (a compiled in frequency) for the pl01x driver.

Quoted 6 lines

Consider also (another option) that the pl01x driver can be compiled without OF support and that said frequency can be provided by CONFIG.

It is just that before adding layers of stub code I would like to understand the technical need when there is only one consumer (I don't want to pollute U-Boot's code base with code that is not providing value).

What do we want to achieve by writing a SoC clock driver that hard-codes the frequency rate for the console? what is the benefit of having such a driver and why is this not an overkill on this platform?

For just one device I can accept that it is overkill. Once you have another device, or (e.g.) the ability to change clocks in U-Boot at run time, a clock driver makes sense.

Quoted 7 lines

2. Use the existing clock-frequency property

yes, this I could understand.
And it doesn't even need to add a single line to the linux kernel dts files which would be imported from the linux kernel tree and keep unmodified.

Then it sounds like this approach works for you?

Regards,
Simon

#18 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 35 lines · Simon Glass
Quoted 25 lines

There's 2 better options. You can define fixed clocks with "fixed-clock" compatible and you already have infrastructure in u-boot to use that. However, the upstream dts file already defines clocks, so that doesn't really work here. The 2nd option is have a table of clock ids and frequencies and register that list of clocks based on matching the clock controller. You'd need a little bit of infrastructure to support that, but otherwise a platform would just need to define a table.

It sounds like you are saying the first option isn't an option. The second option adds another layer of pain - we are trying to avoid having platform data.

I'd prefer (in this order):

1. A clock driver

please could you explain the rationale for this request on this particular platform?

And I mean for a platform where a clock driver will:

1. NOT access any hardware
2.*only* provide single hard-coded value (a compiled in frequency) for the pl01x driver.

Quoted 6 lines

Consider also (another option) that the pl01x driver can be compiled without OF support and that said frequency can be provided by CONFIG.

It is just that before adding layers of stub code I would like to understand the technical need when there is only one consumer (I don't want to pollute U-Boot's code base with code that is not providing value).

What do we want to achieve by writing a SoC clock driver that hard-codes the frequency rate for the console? what is the benefit of having such a driver and why is this not an overkill on this platform?

For just one device I can accept that it is overkill. Once you have another device, or (e.g.) the ability to change clocks in U-Boot at run time, a clock driver makes sense.

Quoted 6 lines
Quoted 5 lines

2. Use the existing clock-frequency property

yes, this I could understand.
And it doesn't even need to add a single line to the linux kernel dts files which would be imported from the linux kernel tree and keep unmodified.

Then it sounds like this approach works for you?

ACK: this works for this platform (eMMC, USB host (net/storage) and UART). if this were to change in the future extending with a clock driver as you said would make sense but I don't see this happening.

But to be clear, using "clock-frequency" would mean that I will have to modify serial_pl01x.c (replace "clock" with "clock-frequency") and also fix the device trees of all the current users of this driver - all of them modified their device trees to add u-boot's "clock" property.

do you concur with this?

#19 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

In reply to Simon Glass
Quoted 79 lines · Simon Glass

Hi,

Quoted 67 lines · Rob Herring
Quoted 51 lines · Tom Rini
Quoted 32 lines · Rob Herring
Quoted 22 lines · Tom Rini
Quoted 21 lines · Jorge Ramirez
Quoted 19 lines · Tom Rini
Quoted 10 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

Quoted 8 lines

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Can you take a stab at updating the pl01x driver? Thanks!

Quoted 8 lines
Quoted 4 lines

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

Quoted 6 lines

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Aw crap, I'm in the wrong. I was thinking this was "clock-frequency" and not that we had invented our own property here.

Quoted 7 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Quoted 4 lines

So, trying to dig out of the hole we made here. The generic serial binding (bindings/serial/serial.txt) documents clock-frequency. The pl011 binding (and primecell which it also references) does not. Would adding clock-frequency to a pl011 node be valid or invalid?

Valid in general. It's a common property in the DT spec. Though, it should be listed in the pl011 binding doc as used just like we list reg or interrupts.

Quoted 3 lines

If valid,
would it also be acceptable to include in dts files that also fill in clocks/clock-names from that binding?

Generally we treat that as not valid as they are mutually exclusive.

Quoted 8 lines

There's 2 better options. You can define fixed clocks with "fixed-clock" compatible and you already have infrastructure in u-boot to use that. However, the upstream dts file already defines clocks, so that doesn't really work here. The 2nd option is have a table of clock ids and frequencies and register that list of clocks based on matching the clock controller. You'd need a little bit of infrastructure to support that, but otherwise a platform would just need to define a table.

Quoted 3 lines

It sounds like you are saying the first option isn't an option. The second option adds another layer of pain - we are trying to avoid having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not have some DT data that's not going to be accepted upstream.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170511/f5ac1336/attachment.sig>
#20 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 72 lines · Tom Rini
Quoted 71 lines · Simon Glass

Hi,

Quoted 68 lines · Rob Herring
Quoted 46 lines · Tom Rini
Quoted 29 lines · Rob Herring
Quoted 20 lines · Tom Rini
Quoted 19 lines · Jorge Ramirez
Quoted 18 lines · Tom Rini
Quoted 18 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Can you take a stab at updating the pl01x driver? Thanks!

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

Quoted 6 lines

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Aw crap, I'm in the wrong. I was thinking this was "clock-frequency" and not that we had invented our own property here.

Quoted 7 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Quoted 4 lines

So, trying to dig out of the hole we made here. The generic serial binding (bindings/serial/serial.txt) documents clock-frequency. The pl011 binding (and primecell which it also references) does not. Would adding clock-frequency to a pl011 node be valid or invalid?

Valid in general. It's a common property in the DT spec. Though, it should be listed in the pl011 binding doc as used just like we list reg or interrupts.

Quoted 3 lines

If valid,
would it also be acceptable to include in dts files that also fill in clocks/clock-names from that binding?

Generally we treat that as not valid as they are mutually exclusive.

There's 2 better options. You can define fixed clocks with "fixed-clock" compatible and you already have infrastructure in u-boot to use that. However, the upstream dts file already defines clocks, so that doesn't really work here. The 2nd option is have a table of clock ids and frequencies and register that list of clocks based on matching the clock controller. You'd need a little bit of infrastructure to support that, but otherwise a platform would just need to define a table.

Quoted 8 lines
Quoted 3 lines

It sounds like you are saying the first option isn't an option. The second option adds another layer of pain - we are trying to avoid having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

let's see: I need to use the pl01x uart on an aarch64 platform and I dont need to enable any clocks for uboot in my SoC. Not now, unlikely ever.

Doing what other boards have done to this date is no longer acceptable (ie platform data for the pl01x or using uboots "clock" property embedded in the hacked device trees)

so, what is the recommended way of configuring this uart?

1. write a dummy clock driver to provide the number of choice for the board (in my case 75m)
2. using platform data for the pl01x
3. using u-boot's very own "clock" property in a separate -u-boot.dtsi
4. using a proper clock-frequency property and fixing pl01x and all those dts files that incorrectly have coded uboot properties...

TIA

#21 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 76 lines · Jorge Ramirez
Quoted 75 lines · Tom Rini
Quoted 74 lines · Simon Glass

Hi,

Quoted 60 lines · Rob Herring
Quoted 46 lines · Tom Rini
Quoted 29 lines · Rob Herring
Quoted 20 lines · Tom Rini
Quoted 19 lines · Jorge Ramirez
Quoted 18 lines · Tom Rini
Quoted 18 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Can you take a stab at updating the pl01x driver? Thanks!

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

Quoted 6 lines

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Aw crap, I'm in the wrong. I was thinking this was "clock-frequency" and not that we had invented our own property here.

Quoted 7 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Quoted 4 lines

So, trying to dig out of the hole we made here. The generic serial binding (bindings/serial/serial.txt) documents clock-frequency. The pl011 binding (and primecell which it also references) does not. Would adding clock-frequency to a pl011 node be valid or invalid?

Valid in general. It's a common property in the DT spec. Though, it should be listed in the pl011 binding doc as used just like we list reg or interrupts.

Quoted 3 lines

If valid,
would it also be acceptable to include in dts files that also fill in clocks/clock-names from that binding?

Generally we treat that as not valid as they are mutually exclusive.

Quoted 8 lines

There's 2 better options. You can define fixed clocks with "fixed-clock" compatible and you already have infrastructure in u-boot to use that. However, the upstream dts file already defines clocks, so that doesn't really work here. The 2nd option is have a table of clock ids and frequencies and register that list of clocks based on matching the clock controller. You'd need a little bit of infrastructure to support that, but otherwise a platform would just need to define a table.

It sounds like you are saying the first option isn't an option. The second option adds another layer of pain - we are trying to avoid having platform data.

Quoted 8 lines
Quoted 5 lines

No, I think we're going for overkill here by not doing serial_pl01x.c as platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Sure.

Quoted 7 lines

let's see: I need to use the pl01x uart on an aarch64 platform and I dont need to enable any clocks for uboot in my SoC. Not now, unlikely ever.

Doing what other boards have done to this date is no longer acceptable (ie platform data for the pl01x or using uboots "clock" property embedded in the hacked device trees)

The only thing we all agree on right now is that "clock" is wrong and must be replaced. I've decided we need to discuss bringing in platform data for pl01x. Once we resolve this, then you can re-spin the series (and hopefully have the USB nodes be submitted to Linux too, since they're the standard ones and, uh, should just enable USB on your board in the kernel too..) Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170511/3ad7c255/attachment.sig>
#22 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 10 lines · Tom Rini
Quoted 1 line

ummmm I am a bit lost at this point, could we recap please?

Sure.

Quoted 7 lines

let's see: I need to use the pl01x uart on an aarch64 platform and I dont need to enable any clocks for uboot in my SoC. Not now, unlikely ever.

Doing what other boards have done to this date is no longer acceptable (ie platform data for the pl01x or using uboots "clock" property embedded in the hacked device trees)

Quoted 6 lines

The only thing we all agree on right now is that "clock" is wrong and must be replaced. I've decided we need to discuss bringing in platform data for pl01x. Once we resolve this, then you can re-spin the series (and hopefully have the USB nodes be submitted to Linux too, since they're the standard ones and, uh, should just enable USB on your board in the kernel too..) Thanks!

cool, that sounds great, thanks.

yeah the usb nodes should be ready pretty soon, I have seen them circulating already.

btw, what was it that triggered our discussion? it is not like any of the dts files for armv8 boards are verbatim copies of what you find in the kernel.

Is there a new rule -explicit somewhere?- enforcing that this has to be the case then?

#23 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 18 lines · Jorge Ramirez
Quoted 10 lines · Tom Rini
Quoted 1 line

ummmm I am a bit lost at this point, could we recap please?

Sure.

Quoted 7 lines

let's see: I need to use the pl01x uart on an aarch64 platform and I dont need to enable any clocks for uboot in my SoC. Not now, unlikely ever.

Doing what other boards have done to this date is no longer acceptable (ie platform data for the pl01x or using uboots "clock" property embedded in the hacked device trees)

Quoted 6 lines

The only thing we all agree on right now is that "clock" is wrong and must be replaced. I've decided we need to discuss bringing in platform data for pl01x. Once we resolve this, then you can re-spin the series (and hopefully have the USB nodes be submitted to Linux too, since they're the standard ones and, uh, should just enable USB on your board in the kernel too..) Thanks!

Quoted 8 lines

cool, that sounds great, thanks.

yeah the usb nodes should be ready pretty soon, I have seen them circulating already.

btw, what was it that triggered our discussion? it is not like any of the dts files for armv8 boards are verbatim copies of what you find in the kernel.

They've gotten out of sync? Sigh.. I suppose this starts to push me from the "keep them in the kernel" camp to "push them to a separate authoritative repository" camp.

I do know some of the early boards were out of sync, but that shouldn't be the case moving forward, and isn't the case for ARMv7 things.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170512/b931ca5d/attachment.sig>
maintainer
#24 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 24 lines · Tom Rini
Quoted 23 lines · Jorge Ramirez
Quoted 10 lines · Tom Rini
Quoted 1 line

ummmm I am a bit lost at this point, could we recap please?

Sure.

Quoted 7 lines

let's see: I need to use the pl01x uart on an aarch64 platform and I dont need to enable any clocks for uboot in my SoC. Not now, unlikely ever.

Doing what other boards have done to this date is no longer acceptable (ie platform data for the pl01x or using uboots "clock" property embedded in the hacked device trees)

Quoted 6 lines

The only thing we all agree on right now is that "clock" is wrong and must be replaced. I've decided we need to discuss bringing in platform data for pl01x. Once we resolve this, then you can re-spin the series (and hopefully have the USB nodes be submitted to Linux too, since they're the standard ones and, uh, should just enable USB on your board in the kernel too..) Thanks!

cool, that sounds great, thanks.

yeah the usb nodes should be ready pretty soon, I have seen them circulating already.

Quoted 7 lines
Quoted 3 lines

btw, what was it that triggered our discussion? it is not like any of the dts files for armv8 boards are verbatim copies of what you find in the kernel.

They've gotten out of sync? Sigh.. I suppose this starts to push me from the "keep them in the kernel" camp to "push them to a separate authoritative repository" camp.

What's wrong with the standalone DT tree[1] and importing that to u-boot periodically?

I know folks would like a completely separate tree that's not "the Linux DT tree", but I don't see that happening any time soon. Do we have some Linuxisms in bindings, yes, but in general I think they are more the exception than rule and were things that went in with little review. These days I'm reviewing pretty much all bindings (not all dts files though), so I think it's less of a problem. Logistically, we could probably work out how to move bindings and dts files to a standalone repository as I could apply bindings and most dts files go thru arm-soc maintainers. My biggest concern with a separate repository is review because we would quickly loose any review that Linux subsystem maintainers do, and no one is beating down my door to help be a DT maintainer.

Rob

[1] git://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git

#25 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 36 lines · Rob Herring
Quoted 24 lines · Tom Rini
Quoted 23 lines · Jorge Ramirez
Quoted 10 lines · Tom Rini
Quoted 1 line

ummmm I am a bit lost at this point, could we recap please?

Sure.

Quoted 7 lines

let's see: I need to use the pl01x uart on an aarch64 platform and I dont need to enable any clocks for uboot in my SoC. Not now, unlikely ever.

Doing what other boards have done to this date is no longer acceptable (ie platform data for the pl01x or using uboots "clock" property embedded in the hacked device trees)

Quoted 6 lines

The only thing we all agree on right now is that "clock" is wrong and must be replaced. I've decided we need to discuss bringing in platform data for pl01x. Once we resolve this, then you can re-spin the series (and hopefully have the USB nodes be submitted to Linux too, since they're the standard ones and, uh, should just enable USB on your board in the kernel too..) Thanks!

cool, that sounds great, thanks.

yeah the usb nodes should be ready pretty soon, I have seen them circulating already.

Quoted 7 lines
Quoted 3 lines

btw, what was it that triggered our discussion? it is not like any of the dts files for armv8 boards are verbatim copies of what you find in the kernel.

They've gotten out of sync? Sigh.. I suppose this starts to push me from the "keep them in the kernel" camp to "push them to a separate authoritative repository" camp.

What's wrong with the standalone DT tree[1] and importing that to u-boot periodically?

Quoted 12 lines

I know folks would like a completely separate tree that's not "the Linux DT tree", but I don't see that happening any time soon. Do we have some Linuxisms in bindings, yes, but in general I think they are more the exception than rule and were things that went in with little review. These days I'm reviewing pretty much all bindings (not all dts files though), so I think it's less of a problem. Logistically, we could probably work out how to move bindings and dts files to a standalone repository as I could apply bindings and most dts files go thru arm-soc maintainers. My biggest concern with a separate repository is review because we would quickly loose any review that Linux subsystem maintainers do, and no one is beating down my door to help be a DT maintainer.

Thinking about this, the key word is authoritative. Right now we say (every time I spot a new dts patch) "is this in the kernel yet?" and the answers break down to:
- Yes, see v4.x
- Yes, see linux-next $tag (or Yes, see maintainer-tree-$X)
- No, we're working on it.

To me, the first is great, the second is OK only in that we're probably not relying on anything bleeding edge and likely to change between linux-next $tag and when it finally goes upstream. The third is where we're at with this board. And a problem is that even with the short kernel release cycle, there is a lot of not wanting to wait until things get into the next upstream release.

Making a big and possibly wrong assumption, for something like this board, that doesn't introduce any new bindings, shouldn't this dts be able to go in quickly, once it of course is otherwise correct? And U-Boot (and barebox and the kernel and anyone else that cares) doesn't want the tree until it was correct either. And once a tree is in this upstream, it's just a matter of saying import dts files for $X, taken from $hash of the device tree repository (or even just included as I might make myself get in the habit of syncing the tree in post release, as it'd be on our release cycle, but honestly, I could / should just do that, even if it's a -rc).

Quoted 1 line

[1] git://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git

... also, so it rebases and isn't stable? That makes life less fun for tracing back when we synced $X last.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170517/f0e73622/attachment.sig>
maintainer
#26 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 57 lines · Tom Rini
Quoted 36 lines · Rob Herring
Quoted 24 lines · Tom Rini
Quoted 23 lines · Jorge Ramirez
Quoted 10 lines · Tom Rini
Quoted 1 line

ummmm I am a bit lost at this point, could we recap please?

Sure.

Quoted 7 lines

let's see: I need to use the pl01x uart on an aarch64 platform and I dont need to enable any clocks for uboot in my SoC. Not now, unlikely ever.

Doing what other boards have done to this date is no longer acceptable (ie platform data for the pl01x or using uboots "clock" property embedded in the hacked device trees)

Quoted 6 lines

The only thing we all agree on right now is that "clock" is wrong and must be replaced. I've decided we need to discuss bringing in platform data for pl01x. Once we resolve this, then you can re-spin the series (and hopefully have the USB nodes be submitted to Linux too, since they're the standard ones and, uh, should just enable USB on your board in the kernel too..) Thanks!

cool, that sounds great, thanks.

yeah the usb nodes should be ready pretty soon, I have seen them circulating already.

Quoted 7 lines
Quoted 3 lines

btw, what was it that triggered our discussion? it is not like any of the dts files for armv8 boards are verbatim copies of what you find in the kernel.

They've gotten out of sync? Sigh.. I suppose this starts to push me from the "keep them in the kernel" camp to "push them to a separate authoritative repository" camp.

What's wrong with the standalone DT tree[1] and importing that to u-boot periodically?

Quoted 12 lines

I know folks would like a completely separate tree that's not "the Linux DT tree", but I don't see that happening any time soon. Do we have some Linuxisms in bindings, yes, but in general I think they are more the exception than rule and were things that went in with little review. These days I'm reviewing pretty much all bindings (not all dts files though), so I think it's less of a problem. Logistically, we could probably work out how to move bindings and dts files to a standalone repository as I could apply bindings and most dts files go thru arm-soc maintainers. My biggest concern with a separate repository is review because we would quickly loose any review that Linux subsystem maintainers do, and no one is beating down my door to help be a DT maintainer.

Thinking about this, the key word is authoritative. Right now we say (every time I spot a new dts patch) "is this in the kernel yet?" and the answers break down to:
- Yes, see v4.x
- Yes, see linux-next $tag (or Yes, see maintainer-tree-$X)
- No, we're working on it.

Quoted 6 lines

To me, the first is great, the second is OK only in that we're probably not relying on anything bleeding edge and likely to change between linux-next $tag and when it finally goes upstream. The third is where we're at with this board. And a problem is that even with the short kernel release cycle, there is a lot of not wanting to wait until things get into the next upstream release.

Maybe it was the 3rd case at the start of this, but it is now in v4.12-rc1.

Generally, commits in -next are not rebased and should match what ends up in mainline. But that's not guaranteed and syncing with -next would probably not be the best policy.

Quoted 3 lines

Making a big and possibly wrong assumption, for something like this board, that doesn't introduce any new bindings, shouldn't this dts be able to go in quickly, once it of course is otherwise correct?

New SoC too, so probably a bit more than just a new assembly of existing bindings. Worst case is someone submits this just before the merge window, it's pulled in just after N-rc1, and doesn't get tagged until O-rc1. In this case, the dts was committed on Apr 6 and rc1 was tagged May 13. We could look at doing a filtered tree based off of -next perhaps. Perhaps we should wait to see if the latency is really a problem.

Quoted 3 lines

And
U-Boot (and barebox and the kernel and anyone else that cares) doesn't want the tree until it was correct either.

Exactly.

Quoted 6 lines

And once a tree is in this
upstream, it's just a matter of saying import dts files for $X, taken from $hash of the device tree repository (or even just included as I might make myself get in the habit of syncing the tree in post release, as it'd be on our release cycle, but honestly, I could / should just do that, even if it's a -rc).

Usually an -rcX is safe to take, but sometimes bindings do get changed during -rc cycle.

Quoted 5 lines
Quoted 2 lines

[1] git://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git

... also, so it rebases and isn't stable? That makes life less fun for tracing back when we synced $X last.

It is generated with git-filter-branch. So it may be regenerated if the generation scripts change. As long as you are tracking kernel tags as to what you've imported, then it should not matter. I'm not sure if we've rebased recently. It was named that somewhat as a CYA. Ian can better comment on this.

Rob

#27 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 65 lines · Rob Herring
Quoted 57 lines · Tom Rini
Quoted 36 lines · Rob Herring
Quoted 24 lines · Tom Rini
Quoted 23 lines · Jorge Ramirez
Quoted 10 lines · Tom Rini
Quoted 1 line

ummmm I am a bit lost at this point, could we recap please?

Sure.

Quoted 7 lines

let's see: I need to use the pl01x uart on an aarch64 platform and I dont need to enable any clocks for uboot in my SoC. Not now, unlikely ever.

Doing what other boards have done to this date is no longer acceptable (ie platform data for the pl01x or using uboots "clock" property embedded in the hacked device trees)

Quoted 6 lines

The only thing we all agree on right now is that "clock" is wrong and must be replaced. I've decided we need to discuss bringing in platform data for pl01x. Once we resolve this, then you can re-spin the series (and hopefully have the USB nodes be submitted to Linux too, since they're the standard ones and, uh, should just enable USB on your board in the kernel too..) Thanks!

cool, that sounds great, thanks.

yeah the usb nodes should be ready pretty soon, I have seen them circulating already.

Quoted 7 lines
Quoted 3 lines

btw, what was it that triggered our discussion? it is not like any of the dts files for armv8 boards are verbatim copies of what you find in the kernel.

They've gotten out of sync? Sigh.. I suppose this starts to push me from the "keep them in the kernel" camp to "push them to a separate authoritative repository" camp.

What's wrong with the standalone DT tree[1] and importing that to u-boot periodically?

Quoted 12 lines

I know folks would like a completely separate tree that's not "the Linux DT tree", but I don't see that happening any time soon. Do we have some Linuxisms in bindings, yes, but in general I think they are more the exception than rule and were things that went in with little review. These days I'm reviewing pretty much all bindings (not all dts files though), so I think it's less of a problem. Logistically, we could probably work out how to move bindings and dts files to a standalone repository as I could apply bindings and most dts files go thru arm-soc maintainers. My biggest concern with a separate repository is review because we would quickly loose any review that Linux subsystem maintainers do, and no one is beating down my door to help be a DT maintainer.

Thinking about this, the key word is authoritative. Right now we say (every time I spot a new dts patch) "is this in the kernel yet?" and the answers break down to:
- Yes, see v4.x
- Yes, see linux-next $tag (or Yes, see maintainer-tree-$X)
- No, we're working on it.

Quoted 6 lines

To me, the first is great, the second is OK only in that we're probably not relying on anything bleeding edge and likely to change between linux-next $tag and when it finally goes upstream. The third is where we're at with this board. And a problem is that even with the short kernel release cycle, there is a lot of not wanting to wait until things get into the next upstream release.

Quoted 5 lines

Maybe it was the 3rd case at the start of this, but it is now in v4.12-rc1.

Generally, commits in -next are not rebased and should match what ends up in mainline. But that's not guaranteed and syncing with -next would probably not be the best policy.

Right. I don't like to take the "it's in -next", but the judgement call is that it's often going to be fine anyhow.

Quoted 31 lines
Quoted 3 lines

Making a big and possibly wrong assumption, for something like this board, that doesn't introduce any new bindings, shouldn't this dts be able to go in quickly, once it of course is otherwise correct?

New SoC too, so probably a bit more than just a new assembly of existing bindings. Worst case is someone submits this just before the merge window, it's pulled in just after N-rc1, and doesn't get tagged until O-rc1. In this case, the dts was committed on Apr 6 and rc1 was tagged May 13. We could look at doing a filtered tree based off of -next perhaps. Perhaps we should wait to see if the latency is really a problem.

Quoted 3 lines

And
U-Boot (and barebox and the kernel and anyone else that cares) doesn't want the tree until it was correct either.

Exactly.

Quoted 6 lines

And once a tree is in this
upstream, it's just a matter of saying import dts files for $X, taken from $hash of the device tree repository (or even just included as I might make myself get in the habit of syncing the tree in post release, as it'd be on our release cycle, but honestly, I could / should just do that, even if it's a -rc).

Usually an -rcX is safe to take, but sometimes bindings do get changed during -rc cycle.

Quoted 3 lines
Quoted 2 lines

[1] git://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git

Quoted 8 lines
Quoted 2 lines

... also, so it rebases and isn't stable? That makes life less fun for tracing back when we synced $X last.

It is generated with git-filter-branch. So it may be regenerated if the generation scripts change. As long as you are tracking kernel tags as to what you've imported, then it should not matter. I'm not sure if we've rebased recently. It was named that somewhat as a CYA. Ian can better comment on this.

Well, I suppose the thing here now is that I'm the squeaky wheel, and other projects seem to be fine. I'll give things a harder try on my end and see where we get from there, wrt problems. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170517/f1dce583/attachment.sig>
#28 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

In reply to Jorge Ramirez
Quoted 76 lines · Jorge Ramirez
Quoted 75 lines · Tom Rini
Quoted 74 lines · Simon Glass

Hi,

Quoted 60 lines · Rob Herring
Quoted 46 lines · Tom Rini
Quoted 29 lines · Rob Herring
Quoted 20 lines · Tom Rini
Quoted 19 lines · Jorge Ramirez
Quoted 18 lines · Tom Rini
Quoted 18 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Can you take a stab at updating the pl01x driver? Thanks!

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

Quoted 6 lines

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Aw crap, I'm in the wrong. I was thinking this was "clock-frequency" and not that we had invented our own property here.

Quoted 7 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay. But I don't think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Quoted 4 lines

So, trying to dig out of the hole we made here. The generic serial binding (bindings/serial/serial.txt) documents clock-frequency. The pl011 binding (and primecell which it also references) does not. Would adding clock-frequency to a pl011 node be valid or invalid?

Valid in general. It's a common property in the DT spec. Though, it should be listed in the pl011 binding doc as used just like we list reg or interrupts.

Quoted 3 lines

If valid,
would it also be acceptable to include in dts files that also fill in clocks/clock-names from that binding?

Generally we treat that as not valid as they are mutually exclusive.

Quoted 8 lines

There's 2 better options. You can define fixed clocks with "fixed-clock" compatible and you already have infrastructure in u-boot to use that. However, the upstream dts file already defines clocks, so that doesn't really work here. The 2nd option is have a table of clock ids and frequencies and register that list of clocks based on matching the clock controller. You'd need a little bit of infrastructure to support that, but otherwise a platform would just need to define a table.

It sounds like you are saying the first option isn't an option. The second option adds another layer of pain - we are trying to avoid having platform data.

Quoted 8 lines
Quoted 5 lines

No, I think we're going for overkill here by not doing serial_pl01x.c as platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1, saying as such in the commit (if it's just the commit message that changes, that's fine and great).
- Please update serial_pl01x.c to be able to get the clock via platform data, update and test your board to confirm it works.
- It'd be awesome if you do, but it won't block your series if you don't, update the rest of the platforms that had been using the "clock" platform to instead use the platform data method.

Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170517/70b111e3/attachment.sig>
#29 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 11 lines · Tom Rini
Quoted 7 lines
Quoted 6 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1, saying as such in the commit (if it's just the commit message that changes, that's fine and great).

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Quoted 2 lines

- Please update serial_pl01x.c to be able to get the clock via platform data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

I will have to disable DM_SERIAL and add some configs in include/configs/poplar.h

+#define CONFIG_PL011_SERIAL  1
+#define CONFIG_PL011_CLOCK   75000000
+#define CONFIG_PL01x_PORTS   {(void *) 0xF8B00000,}
+#define CONFIG_CONS_INDEX    0

==> is this acceptable? if not, then what should I do?

Quoted 5 lines

- It'd be awesome if you do, but it won't block your series if you don't, update the rest of the platforms that had been using the "clock" platform to instead use the platform data method.

Thanks!

#30 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 8 lines · Jorge Ramirez
Quoted 7 lines · Tom Rini
Quoted 7 lines
Quoted 6 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Quoted 8 lines
Quoted 4 lines

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1, saying as such in the commit (if it's just the commit message that changes, that's fine and great).

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board, and remove that later once it's upstream.

Quoted 6 lines
Quoted 2 lines

- Please update serial_pl01x.c to be able to get the clock via platform data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then you can use platform data, I think... But Rob, this loops us back around to the first problem too, kind of. Can we really just not make use of clock-frequency and the kernel just not use it?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170525/648f9d72/attachment.sig>
#31 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 13 lines · Tom Rini
Quoted 12 lines · Jorge Ramirez
Quoted 11 lines · Tom Rini
Quoted 7 lines
Quoted 6 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1, saying as such in the commit (if it's just the commit message that changes, that's fine and great).

Quoted 5 lines
Quoted 3 lines

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board, and remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

- Please update serial_pl01x.c to be able to get the clock via platform data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then you can use platform data,

I dont think that would because CONFIG_OF is enabled for USB So the kernel dtsi (not the u-boot.dtsi) that contains the uart node (without the clock!) will be picked by uboot and the uart will not be initialized....

I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1] and then just get rid of the file when possible (and the source code not the configs) would not need to change

https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Quoted 4 lines

I think... But Rob, this loops us back around to
the first problem too, kind of. Can we really just not make use of clock-frequency and the kernel just not use it?

#32 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 17 lines · Jorge Ramirez
Quoted 16 lines · Tom Rini
Quoted 15 lines · Jorge Ramirez
Quoted 14 lines · Tom Rini
Quoted 9 lines
Quoted 8 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as
platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not
have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1,
saying as such in the commit (if it's just the commit message that changes, that's fine and great).

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board, and remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines

- Please update serial_pl01x.c to be able to get the clock via platform
data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then you can use platform data,

I dont think that would because CONFIG_OF is enabled for USB; so the kernel dtsi that contains the uart node (without the clock!) will be picked by u-boot and the uart will not be initialized properly. I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1];
then just get rid of the file when possible (and NEIHER the source code NOR the configs) would need to change

[1]
https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Quoted 6 lines
Quoted 5 lines

I think... But Rob, this loops us back around to
the first problem too, kind of. Can we really just not make use of clock-frequency and the kernel just not use it?

#33 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 47 lines · Jorge Ramirez
Quoted 17 lines · Jorge Ramirez
Quoted 16 lines · Tom Rini
Quoted 15 lines · Jorge Ramirez
Quoted 14 lines · Tom Rini
Quoted 9 lines
Quoted 8 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as
platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not
have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1,
saying as such in the commit (if it's just the commit message that changes, that's fine and great).

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board, and remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines

- Please update serial_pl01x.c to be able to get the clock via platform
data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then you can use platform data,

I dont think that would because CONFIG_OF is enabled for USB; so the kernel dtsi that contains the uart node (without the clock!) will be picked by u-boot and the uart will not be initialized properly. I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1];
then just get rid of the file when possible (and NEIHER the source code NOR the configs) would need to change

Quoted 1 line

[1] https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Yes, sorry. [1] needs to be updated to disable uart0 so that you can use platform data, at least for now. I do want to talk more with Rob about the general problem this exposes.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170525/9f96a00f/attachment.sig>
#34 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 43 lines · Tom Rini
Quoted 42 lines · Jorge Ramirez
Quoted 17 lines · Jorge Ramirez
Quoted 16 lines · Tom Rini
Quoted 15 lines · Jorge Ramirez
Quoted 14 lines · Tom Rini
Quoted 9 lines
Quoted 8 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as
platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not
have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1,
saying as such in the commit (if it's just the commit message that changes, that's fine and great).

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board, and remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

- Please update serial_pl01x.c to be able to get the clock via platform
data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then you can use platform data,

I dont think that would because CONFIG_OF is enabled for USB; so the kernel dtsi that contains the uart node (without the clock!) will be picked by u-boot and the uart will not be initialized properly. I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1];
then just get rid of the file when possible (and NEIHER the source code NOR the configs) would need to change

Quoted 4 lines
Quoted 1 line

[1] https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Yes, sorry. [1] needs to be updated to disable uart0 so that you can use platform data, at least for now. I do want to talk more with Rob about the general problem this exposes.

so you want me to

1) keep the node in
https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

2) add status=disable
3) then add the platform_data

BUT for the pl011 driver to take the platform_data dont I also have to disable CONFIG_OF?

but if I disable CONFIG_OF then I lose USB_DM

am I wrong?

Quoted 1 line
#35 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 44 lines · Jorge Ramirez
Quoted 43 lines · Tom Rini
Quoted 42 lines · Jorge Ramirez
Quoted 17 lines · Jorge Ramirez
Quoted 16 lines · Tom Rini
Quoted 15 lines · Jorge Ramirez
Quoted 14 lines · Tom Rini
Quoted 9 lines
Quoted 8 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as
platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not
have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1,
saying as such in the commit (if it's just the commit message that changes, that's fine and great).

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board, and remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

- Please update serial_pl01x.c to be able to get the clock via platform
data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then you can use platform data,

I dont think that would because CONFIG_OF is enabled for USB; so the kernel dtsi that contains the uart node (without the clock!) will be picked by u-boot and the uart will not be initialized properly. I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1];
then just get rid of the file when possible (and NEIHER the source code NOR the configs) would need to change

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

[1] https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Yes, sorry. [1] needs to be updated to disable uart0 so that you can use platform data, at least for now. I do want to talk more with Rob about the general problem this exposes.

so you want me to

1) keep the node in https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Well, a uart0 node, but no "clock" property as that just needs to go away.

Quoted 7 lines

2) add status=disable
3) then add the platform_data

BUT for the pl011 driver to take the platform_data dont I also have to disable CONFIG_OF?

but if I disable CONFIG_OF then I lose USB_DM

No, the status = "disable" on uart0 should remove it from the dtb, or at least we should see it and go "Oh, no, we don't have uart0 via DT".

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170525/6f8a0334/attachment.sig>
#36 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 45 lines · Tom Rini
Quoted 44 lines · Jorge Ramirez
Quoted 43 lines · Tom Rini
Quoted 42 lines · Jorge Ramirez
Quoted 17 lines · Jorge Ramirez
Quoted 16 lines · Tom Rini
Quoted 15 lines · Jorge Ramirez
Quoted 14 lines · Tom Rini
Quoted 9 lines
Quoted 8 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as
platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not
have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1,
saying as such in the commit (if it's just the commit message that changes, that's fine and great).

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board, and remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

- Please update serial_pl01x.c to be able to get the clock via platform
data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then you can use platform data,

I dont think that would because CONFIG_OF is enabled for USB; so the kernel dtsi that contains the uart node (without the clock!) will be picked by u-boot and the uart will not be initialized properly. I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1];
then just get rid of the file when possible (and NEIHER the source code NOR the configs) would need to change

[1] https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Yes, sorry. [1] needs to be updated to disable uart0 so that you can use platform data, at least for now. I do want to talk more with Rob about the general problem this exposes.

so you want me to

1) keep the node in https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Well, a uart0 node, but no "clock" property as that just needs to go away.

Sounds good to me. now see below

Quoted 11 lines
Quoted 8 lines

2) add status=disable
3) then add the platform_data

BUT for the pl011 driver to take the platform_data dont I also have to disable CONFIG_OF?

but if I disable CONFIG_OF then I lose USB_DM

No, the status = "disable" on uart0 should remove it from the dtb, or at least we should see it and go "Oh, no, we don't have uart0 via DT".

1) Since the UART0 is enabled in the kernel's DTS I will have to modify the device tree that I am importing from kernel.org to disable it.

2) But even doing this is not enough: I have to completely remove the uart0 node from the tree.

So to sum up:

In order to get the platform data for pl01x I have to either disable OF (so I lose the USB node as I said earlier) or *completely* remove the UART0 node from from the kernel dts.
I personally would rather not modify the kernel's DTS trees that I am importing into uboot but I am really confused about the policy now.

please could you clarify?

I still think what I proposed when we started is the better way to go: a uboot specific hi3798cv200-u-boot.dtsifile that contains the two nodes that are giving trouble.

The timeline then goes:
- the usb node will disappear as soon as it lands in korg
- the uart node and the whole file will be removed during the cleanup of all the pl01x uart offenders.

but if you think modifying the kernels dts is better I can do that as well.

#37 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 37 lines · Jorge Ramirez
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

[1]
https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Yes, sorry. [1] needs to be updated to disable uart0 so that you can use platform data, at least for now. I do want to talk more with Rob about the general problem this exposes.

Quoted 7 lines
Quoted 5 lines

so you want me to

1) keep the node in
https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Well, a uart0 node, but no "clock" property as that just needs to go away.

Sounds good to me. now see below

Quoted 11 lines
Quoted 8 lines

2) add status=disable
3) then add the platform_data

BUT for the pl011 driver to take the platform_data dont I also have to disable CONFIG_OF?

but if I disable CONFIG_OF then I lose USB_DM

No, the status = "disable" on uart0 should remove it from the dtb, or at least we should see it and go "Oh, no, we don't have uart0 via DT".

1) Since the UART0 is enabled in the kernel's DTS I will have to modify the device tree that I am importing from kernel.org to disable it.

2) But even doing this is not enough: I have to completely remove the uart0 node from the tree.

Quoted 7 lines

So to sum up:

In order to get the platform data for pl01x I have to either disable OF (so I lose the USB node as I said earlier) or *completely* remove the UART0 node from from the kernel dts.
I personally would rather not modify the kernel's DTS trees that I am importing into uboot but I am really confused about the policy now.

ie: to be clear from my side, doing the following is not enough:

(quoted diff) +0 -0

b/arch/arm/dts/hi3798cv200-poplar.dts
index b914287..d4ce16d 100644

arch/arm/dts/hi3798cv200-poplar.dts +1 -1
@@ -152,7 +152,7 @@
  };
 
  &uart0 {
-   status = "okay";
+ status = "disabled";
  };
 
 

I have to actually do

(quoted diff) +0 -0

b/arch/arm/dts/hi3798cv200-poplar.dts
index b914287..028013f 100644

arch/arm/dts/hi3798cv200-poplar.dts +0 -0
@@ -17,7 +17,6 @@
         compatible = "hisilicon,hi3798cv200-poplar", 

"hisilicon,hi3798cv200";

         aliases {
-           serial0 = &uart0;
                 serial2 = &uart2;
         };

@@ -151,12 +150,9 @@

         label = "LS-SPI0";

};

-&uart0 {
- status = "okay";
-};

  &uart2 {
         status = "okay";
         label = "LS-UART0";
  };

OR

[jramirez at titan git.u-boot (upstream *$)]$ git diff

(quoted diff) +0 -0

b/arch/arm/dts/hi3798cv200-poplar.dts
index b914287..5d909b83 100644

arch/arm/dts/hi3798cv200-poplar.dts +1 -5
@@ -21,10 +21,6 @@
                 serial2 = &uart2;
         };
 
-   chosen {
-           stdout-path = "serial0:115200n8";
-   };
-
         memory at 0 {
                 device_type = "memory";
                 reg = <0x0 0x0 0x0 0x80000000>;
@@ -152,7 +148,7 @@
  };
 
  &uart0 {
-   status = "okay";
+ status = "disabled";
  };
 
  &uart2 {

Is this the right way to go then? alter the kernel DTS when merging into uboot?

Quoted 14 lines

please could you clarify?

I still think what I proposed when we started is the better way to go:
a uboot specific hi3798cv200-u-boot.dtsifile that contains the two nodes that are giving trouble.

The timeline then goes:
- the usb node will disappear as soon as it lands in korg
- the uart node and the whole file will be removed during the cleanup of all the pl01x uart offenders.

but if you think modifying the kernels dts is better I can do that as well.

#38 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

In reply to Jorge Ramirez
Quoted 63 lines · Jorge Ramirez
Quoted 45 lines · Tom Rini
Quoted 44 lines · Jorge Ramirez
Quoted 43 lines · Tom Rini
Quoted 42 lines · Jorge Ramirez
Quoted 17 lines · Jorge Ramirez
Quoted 16 lines · Tom Rini
Quoted 15 lines · Jorge Ramirez
Quoted 14 lines · Tom Rini
Quoted 9 lines
Quoted 8 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as
platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not
have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1,
saying as such in the commit (if it's just the commit message that changes, that's fine and great).

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board, and remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

- Please update serial_pl01x.c to be able to get the clock via platform
data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then you can use platform data,

I dont think that would because CONFIG_OF is enabled for USB; so the kernel dtsi that contains the uart node (without the clock!) will be picked by u-boot and the uart will not be initialized properly. I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1];
then just get rid of the file when possible (and NEIHER the source code NOR the configs) would need to change

[1] https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Yes, sorry. [1] needs to be updated to disable uart0 so that you can use platform data, at least for now. I do want to talk more with Rob about the general problem this exposes.

so you want me to

1) keep the node in https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Well, a uart0 node, but no "clock" property as that just needs to go away.

Sounds good to me. now see below

Quoted 6 lines
Quoted 6 lines

2) add status=disable
3) then add the platform_data

BUT for the pl011 driver to take the platform_data dont I also have to disable CONFIG_OF?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

but if I disable CONFIG_OF then I lose USB_DM

No, the status = "disable" on uart0 should remove it from the dtb, or at least we should see it and go "Oh, no, we don't have uart0 via DT".

1) Since the UART0 is enabled in the kernel's DTS I will have to modify the device tree that I am importing from kernel.org to disable it.

Yes, the dtsi file in [1] is what modifies it.

Quoted 2 lines

2) But even doing this is not enough: I have to completely remove the uart0 node from the tree.

Why? Is this in theory, or in practice? I ask since we just had to disable the kernel-enabled mmc3 node on am335x-evm.dts in am335x-evm-u-boot.dtsi in order to have it boot as probing mmc3 in U-Boot fails (we don't enable the relevant clocks). So disabling uart0 should cause the resulting dtb file to omit entirely, or just have &uart0 {status="disabled"} or similar and U-Boot should not do anything, so platform data should be used. If this is not the case, there's a bug we need to track down.

Quoted 11 lines

So to sum up:

In order to get the platform data for pl01x I have to either disable OF (so I lose the USB node as I said earlier) or *completely* remove the UART0 node from from the kernel dts.
I personally would rather not modify the kernel's DTS trees that I am importing into uboot but I am really confused about the policy now.

Quoted 5 lines

please could you clarify?

I still think what I proposed when we started is the better way to
go: a uboot specific hi3798cv200-u-boot.dtsifile that contains the two nodes that are giving trouble.

I don't understand what we're not understanding, yes, you should be using a -u-boot.dtsi file to mark uart0 as disabled and not have to modify the kernel dts file at all.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170526/b3b44262/attachment.sig>
#39 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

On May 26, 2017 2:46 PM, "Tom Rini" <[email protected]> wrote:

Quoted 4 lines · Jorge Ramirez
Quoted 3 lines · Tom Rini
Quoted 2 lines · Jorge Ramirez
Quoted 1 line · Tom Rini

On Thu, May 25, 2017 at 10:58:20PM +0200, Jorge Ramirez wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Jorge Ramirez
Quoted 7 lines · Tom Rini
Quoted 6 lines · Jorge Ramirez
Quoted 5 lines · Tom Rini
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as
platform data. ns16550 does platform data for this already.

This

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

sounds like the lowest overhead way to get the clock populated and not
have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1,
saying as such in the commit (if it's just the commit message

that

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

changes, that's fine and great).

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board,

and

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line

remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

- Please update serial_pl01x.c to be able to get the clock via platform
data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then

you

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line

can use platform data,

I dont think that would because CONFIG_OF is enabled for USB; so the kernel dtsi that contains the uart node (without the clock!) will be picked by u-boot and the uart will not be initialized properly. I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1];
then just get rid of the file when possible (and NEIHER the source code NOR the configs) would need to change

[1] https://github.com/ldts/poplar-u-boot/blob/upstream/

arch/arm/dts/hi3798cv200-u-boot.dtsi

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

Yes, sorry. [1] needs to be updated to disable uart0 so that you can use platform data, at least for now. I do want to talk more with Rob about the general problem this exposes.

so you want me to

1) keep the node in https://github.com/ldts/poplar-u-boot/blob/upstream/

arch/arm/dts/hi3798cv200-u-boot.dtsi

Quoted 11 lines
Quoted 2 lines

Well, a uart0 node, but no "clock" property as that just needs to go away.

Sounds good to me. now see below

Quoted 6 lines
Quoted 6 lines

2) add status=disable
3) then add the platform_data

BUT for the pl011 driver to take the platform_data dont I also have to disable CONFIG_OF?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

but if I disable CONFIG_OF then I lose USB_DM

No, the status = "disable" on uart0 should remove it from the dtb, or at least we should see it and go "Oh, no, we don't have uart0 via DT".

1) Since the UART0 is enabled in the kernel's DTS I will have to modify the device tree that I am importing from kernel.org to disable it.

Yes, the dtsi file in [1] is what modifies it.

Quoted 2 lines

2) But even doing this is not enough: I have to completely remove the uart0 node from the tree.

Why? Is this in theory, or in practice? I ask since we just had to disable the kernel-enabled mmc3 node on am335x-evm.dts in am335x-evm-u-boot.dtsi in order to have it boot as probing mmc3 in U-Boot fails (we don't enable the relevant clocks). So disabling uart0 should cause the resulting dtb file to omit entirely, or just have &uart0 {status="disabled"} or similar and U-Boot should not do anything, so platform data should be used. If this is not the case, there's a bug we need to track down.

Quoted 11 lines

So to sum up:

In order to get the platform data for pl01x I have to either disable OF (so I lose the USB node as I said earlier) or *completely* remove the UART0 node from from the kernel dts.
I personally would rather not modify the kernel's DTS trees that I am importing into uboot but I am really confused about the policy now.

Quoted 5 lines

please could you clarify?

I still think what I proposed when we started is the better way to
go: a uboot specific hi3798cv200-u-boot.dtsifile that contains the two nodes that are giving trouble.

I don't understand what we're not understanding, yes, you should be using a -u-boot.dtsi file to mark uart0 as disabled and not have to modify the kernel dts file at all.

This the bit that is NOT possible. Doing that is not enough.

I will also have to modify the kernel dts.

--
Tom

#40 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 111 lines · Jorge Ramirez Ortiz

On May 26, 2017 2:46 PM, "Tom Rini" <[email protected]> wrote:

Quoted 4 lines · Jorge Ramirez
Quoted 3 lines · Tom Rini
Quoted 2 lines · Jorge Ramirez
Quoted 1 line · Tom Rini

On Thu, May 25, 2017 at 10:58:20PM +0200, Jorge Ramirez wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Jorge Ramirez
Quoted 7 lines · Tom Rini
Quoted 6 lines · Jorge Ramirez
Quoted 5 lines · Tom Rini
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as
platform data. ns16550 does platform data for this already.

This

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

sounds like the lowest overhead way to get the clock populated and not
have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1,
saying as such in the commit (if it's just the commit message

that

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

changes, that's fine and great).

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board,

and

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line

remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

- Please update serial_pl01x.c to be able to get the clock via platform
data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then

you

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line

can use platform data,

I dont think that would because CONFIG_OF is enabled for USB; so the kernel dtsi that contains the uart node (without the clock!) will be picked by u-boot and the uart will not be initialized properly. I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1];
then just get rid of the file when possible (and NEIHER the source code NOR the configs) would need to change

[1] https://github.com/ldts/poplar-u-boot/blob/upstream/

arch/arm/dts/hi3798cv200-u-boot.dtsi

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

Yes, sorry. [1] needs to be updated to disable uart0 so that you can use platform data, at least for now. I do want to talk more with Rob about the general problem this exposes.

so you want me to

1) keep the node in https://github.com/ldts/poplar-u-boot/blob/upstream/

arch/arm/dts/hi3798cv200-u-boot.dtsi

Quoted 11 lines
Quoted 2 lines

Well, a uart0 node, but no "clock" property as that just needs to go away.

Sounds good to me. now see below

Quoted 6 lines
Quoted 6 lines

2) add status=disable
3) then add the platform_data

BUT for the pl011 driver to take the platform_data dont I also have to disable CONFIG_OF?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

but if I disable CONFIG_OF then I lose USB_DM

No, the status = "disable" on uart0 should remove it from the dtb, or at least we should see it and go "Oh, no, we don't have uart0 via DT".

1) Since the UART0 is enabled in the kernel's DTS I will have to modify the device tree that I am importing from kernel.org to disable it.

Yes, the dtsi file in [1] is what modifies it.

Quoted 2 lines

2) But even doing this is not enough: I have to completely remove the uart0 node from the tree.

Why? Is this in theory, or in practice? I ask since we just had to disable the kernel-enabled mmc3 node on am335x-evm.dts in am335x-evm-u-boot.dtsi in order to have it boot as probing mmc3 in U-Boot fails (we don't enable the relevant clocks). So disabling uart0 should cause the resulting dtb file to omit entirely, or just have &uart0 {status="disabled"} or similar and U-Boot should not do anything, so platform data should be used. If this is not the case, there's a bug we need to track down.

Quoted 11 lines

So to sum up:

In order to get the platform data for pl01x I have to either disable OF (so I lose the USB node as I said earlier) or *completely* remove the UART0 node from from the kernel dts.
I personally would rather not modify the kernel's DTS trees that I am importing into uboot but I am really confused about the policy now.

Quoted 5 lines

please could you clarify?

I still think what I proposed when we started is the better way to
go: a uboot specific hi3798cv200-u-boot.dtsifile that contains the two nodes that are giving trouble.

Quoted 7 lines

I don't understand what we're not understanding, yes, you should be using a -u-boot.dtsi file to mark uart0 as disabled and not have to modify the kernel dts file at all.

This the bit that is NOT possible. Doing that is not enough.

To be clear, are you trying this on current mainline? Simon reminded me that if you don't have 7452946e7f37 in your tree, the -u-boot.dtsi file cannot disable a node.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170526/da8c1b19/attachment.sig>
#41 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 20 lines · Tom Rini
Quoted 20 lines
Quoted 9 lines

So to sum up:

In order to get the platform data for pl01x I have to either disable OF (so I lose the USB node as I said earlier) or*completely* remove the UART0 node from from the kernel dts.
I personally would rather not modify the kernel's DTS trees that I am importing into uboot but I am really confused about the policy now.

Quoted 5 lines

please could you clarify?

I still think what I proposed when we started is the better way to
go: a uboot specific hi3798cv200-u-boot.dtsifile that contains the two nodes that are giving trouble.

I don't understand what we're not understanding, yes, you should be using a -u-boot.dtsi file to mark uart0 as disabled and not have to modify the kernel dts file at all.

Quoted 4 lines
Quoted 1 line

This the bit that is NOT possible. Doing that is not enough.

To be clear, are you trying this on current mainline? Simon reminded me that if you don't have 7452946e7f37 in your tree, the -u-boot.dtsi file cannot disable a node.

yes I have that commit (thanks Tom for checking this)

The issue is actually with serial-uclass.c when the kernel dts contains a chosen node that contains the stdout-path.

     chosen {
         stdout-path = "serial0:115200n8";
     };

Disabling uart0 (ie serial0) in u-boot.dtsi loses the console instead of probing the pl01x for the platform_data.

is there a pre-defined way to work around this?

#42 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 30 lines · Jorge Ramirez
Quoted 20 lines · Tom Rini
Quoted 20 lines
Quoted 9 lines

So to sum up:

In order to get the platform data for pl01x I have to either disable OF (so I lose the USB node as I said earlier) or*completely* remove the UART0 node from from the kernel dts.
I personally would rather not modify the kernel's DTS trees that I am importing into uboot but I am really confused about the policy now.

Quoted 5 lines

please could you clarify?

I still think what I proposed when we started is the better way to
go: a uboot specific hi3798cv200-u-boot.dtsifile that contains the two nodes that are giving trouble.

I don't understand what we're not understanding, yes, you should be using a -u-boot.dtsi file to mark uart0 as disabled and not have to modify the kernel dts file at all.

Quoted 4 lines
Quoted 1 line

This the bit that is NOT possible. Doing that is not enough.

To be clear, are you trying this on current mainline? Simon reminded me that if you don't have 7452946e7f37 in your tree, the -u-boot.dtsi file cannot disable a node.

yes I have that commit (thanks Tom for checking this)

The issue is actually with serial-uclass.c when the kernel dts contains a chosen node that contains the stdout-path.

Quoted 8 lines
    chosen {
        stdout-path = "serial0:115200n8";
    };

Disabling uart0 (ie serial0) in u-boot.dtsi loses the console instead of probing the pl01x for the platform_data.

is there a pre-defined way to work around this?

Provide a new stdout-path in the -u-boot.dtsi too? Any changes you could make to the main dts file so that this would work should be able to be done in the -u-boot.dtsi too.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170529/fcbbf834/attachment.sig>
#43 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 11 lines · Tom Rini
Quoted 10 lines

The issue is actually with serial-uclass.c when the kernel dts contains a chosen node that contains the stdout-path.

     chosen {
         stdout-path = "serial0:115200n8";
     };

Disabling uart0 (ie serial0) in u-boot.dtsi loses the console instead of probing the pl01x for the platform_data.

is there a pre-defined way to work around this?

Provide a new stdout-path in the -u-boot.dtsi too? Any changes you

yes I obviously tried that but are you sure that that is allowed with "chosen" it being kind of a special type of node?
the compiler just cant find the label when added to u-boot.dtsi hence why I was asking (sorry, I should have raised it upfront) ie:

/*
* U-Boot addition to:
* 1) use platform data for the console
* 2) provide support for the generic-ehci USB driver currently not
available
* in the linux kernel (8/May/2017).
*
* (C) Copyright 2017 Jorge Ramirez-Ortiz <[email protected]> *
* SPDX-License-Identifier: GPL-2.0+
*/

&soc {
     usb2: ehci at 9890000 {
         compatible = "generic-ehci";
         reg = <0x9890000 0x100>;
         status = "okay";
     };
};
&uart0 {
     status = "disabled";
};
&chosen {
     stdout-path = &uart0;

};

leads to

LD u-boot
OBJCOPY u-boot.srec
OBJCOPY u-boot-nodtb.bin
SYM u-boot.sym
start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0x37000000 $start $end
DTC arch/arm/dts/hi3798cv200-poplar.dtb
Error: ./arch/arm/dts/hi3798cv200-u-boot.dtsi:27.2-3 label or path, 'chosen', not found
FATAL ERROR: Syntax error parsing input tree scripts/Makefile.lib:322: recipe for target 'arch/arm/dts/hi3798cv200-poplar.dtb' failed
make[2]: *** [arch/arm/dts/hi3798cv200-poplar.dtb] Error 1 dts/Makefile:32: recipe for target 'arch/arm/dts/hi3798cv200-poplar.dtb' failed
make[1]: *** [arch/arm/dts/hi3798cv200-poplar.dtb] Error 2 Makefile:865: recipe for target 'dts/dt.dtb' failed
make: *** [dts/dt.dtb] Error 2

Quoted 2 lines

could make to the main dts file so that this would work should be able to be done in the -u-boot.dtsi too.

#44 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 39 lines · Jorge Ramirez
Quoted 11 lines · Tom Rini
Quoted 10 lines

The issue is actually with serial-uclass.c when the kernel dts contains a chosen node that contains the stdout-path.

     chosen {
         stdout-path = "serial0:115200n8";
     };

Disabling uart0 (ie serial0) in u-boot.dtsi loses the console instead of probing the pl01x for the platform_data.

is there a pre-defined way to work around this?

Provide a new stdout-path in the -u-boot.dtsi too? Any changes you

yes I obviously tried that but are you sure that that is allowed with "chosen" it being kind of a special type of node?
the compiler just cant find the label when added to u-boot.dtsi hence why I was asking (sorry, I should have raised it upfront) ie:

/*
* U-Boot addition to:
* 1) use platform data for the console
* 2) provide support for the generic-ehci USB driver currently not
available
* in the linux kernel (8/May/2017).
*
* (C) Copyright 2017 Jorge Ramirez-Ortiz <[email protected]> *
* SPDX-License-Identifier: GPL-2.0+
*/

&soc {
    usb2: ehci at 9890000 {
        compatible = "generic-ehci";
        reg = <0x9890000 0x100>;
        status = "okay";
    };
};
Quoted 8 lines
&uart0 {
    status = "disabled";
};
&chosen {
    stdout-path = &uart0;

};

oops, wrong syntax. ok done.
will send v5 today

thanks!

Quoted 37 lines

leads to

LD u-boot
OBJCOPY u-boot.srec
OBJCOPY u-boot-nodtb.bin
SYM u-boot.sym
start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1

(quoted diff) +0 -2
-d ' '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut 
-f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0x37000000 $start $end
  DTC     arch/arm/dts/hi3798cv200-poplar.dtb

Error: ./arch/arm/dts/hi3798cv200-u-boot.dtsi:27.2-3 label or path, 'chosen', not found
FATAL ERROR: Syntax error parsing input tree scripts/Makefile.lib:322: recipe for target 'arch/arm/dts/hi3798cv200-poplar.dtb' failed
make[2]: *** [arch/arm/dts/hi3798cv200-poplar.dtb] Error 1 dts/Makefile:32: recipe for target 'arch/arm/dts/hi3798cv200-poplar.dtb' failed
make[1]: *** [arch/arm/dts/hi3798cv200-poplar.dtb] Error 2 Makefile:865: recipe for target 'dts/dt.dtb' failed
make: *** [dts/dt.dtb] Error 2

Quoted 2 lines

could make to the main dts file so that this would work should be able to be done in the -u-boot.dtsi too.

#45 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

In reply to Jorge Ramirez
Quoted 63 lines · Jorge Ramirez
Quoted 11 lines · Tom Rini
Quoted 10 lines

The issue is actually with serial-uclass.c when the kernel dts contains a chosen node that contains the stdout-path.

    chosen {
        stdout-path = "serial0:115200n8";
    };

Disabling uart0 (ie serial0) in u-boot.dtsi loses the console instead of probing the pl01x for the platform_data.

is there a pre-defined way to work around this?

Provide a new stdout-path in the -u-boot.dtsi too? Any changes you

yes I obviously tried that but are you sure that that is allowed with "chosen" it being kind of a special type of node? the compiler just cant find the label when added to u-boot.dtsi hence why I was asking (sorry, I should have raised it upfront) ie:

/*
* U-Boot addition to:
* 1) use platform data for the console
* 2) provide support for the generic-ehci USB driver currently not
available
* in the linux kernel (8/May/2017).
*
* (C) Copyright 2017 Jorge Ramirez-Ortiz <[email protected]> *
* SPDX-License-Identifier: GPL-2.0+
*/

&soc {
    usb2: ehci at 9890000 {
        compatible = "generic-ehci";
        reg = <0x9890000 0x100>;
        status = "okay";
    };
};
&uart0 {
    status = "disabled";
};
&chosen {
    stdout-path = &uart0;

};

leads to

LD u-boot
OBJCOPY u-boot.srec
OBJCOPY u-boot-nodtb.bin
SYM u-boot.sym
start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0x37000000 $start $end
DTC arch/arm/dts/hi3798cv200-poplar.dtb
Error: ./arch/arm/dts/hi3798cv200-u-boot.dtsi:27.2-3 label or path, 'chosen', not found
FATAL ERROR: Syntax error parsing input tree

Quoted 9 lines

scripts/Makefile.lib:322: recipe for target 'arch/arm/dts/hi3798cv200-poplar.dtb' failed make[2]: *** [arch/arm/dts/hi3798cv200-poplar.dtb] Error 1 dts/Makefile:32: recipe for target 'arch/arm/dts/hi3798cv200-poplar.dtb' failed make[1]: *** [arch/arm/dts/hi3798cv200-poplar.dtb] Error 2 Makefile:865: recipe for target 'dts/dt.dtb' failed
make: *** [dts/dt.dtb] Error 2

Well, lets see. Pantelis has been telling me that what we're doing here is going to lead to problems like what you see here in some cases. Any suggestions?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170529/4a795671/attachment.sig>
#46 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 72 lines · Tom Rini
Quoted 62 lines · Jorge Ramirez
Quoted 11 lines · Tom Rini
Quoted 10 lines

The issue is actually with serial-uclass.c when the kernel dts contains a chosen node that contains the stdout-path.

     chosen {
         stdout-path = "serial0:115200n8";
     };

Disabling uart0 (ie serial0) in u-boot.dtsi loses the console instead of probing the pl01x for the platform_data.

is there a pre-defined way to work around this?

Provide a new stdout-path in the -u-boot.dtsi too? Any changes you

yes I obviously tried that but are you sure that that is allowed with "chosen" it being kind of a special type of node? the compiler just cant find the label when added to u-boot.dtsi hence why I was asking (sorry, I should have raised it upfront) ie:

/*
* U-Boot addition to:
* 1) use platform data for the console
* 2) provide support for the generic-ehci USB driver currently not
available
* in the linux kernel (8/May/2017).
*
* (C) Copyright 2017 Jorge Ramirez-Ortiz <[email protected]> *
* SPDX-License-Identifier: GPL-2.0+
*/

&soc {
     usb2: ehci at 9890000 {
         compatible = "generic-ehci";
         reg = <0x9890000 0x100>;
         status = "okay";
     };
};
&uart0 {
     status = "disabled";
};
&chosen {
     stdout-path = &uart0;

};

leads to

LD u-boot
OBJCOPY u-boot.srec
OBJCOPY u-boot-nodtb.bin
SYM u-boot.sym
start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0x37000000 $start $end
DTC arch/arm/dts/hi3798cv200-poplar.dtb
Error: ./arch/arm/dts/hi3798cv200-u-boot.dtsi:27.2-3 label or path, 'chosen', not found
FATAL ERROR: Syntax error parsing input tree

Quoted 9 lines

scripts/Makefile.lib:322: recipe for target 'arch/arm/dts/hi3798cv200-poplar.dtb' failed make[2]: *** [arch/arm/dts/hi3798cv200-poplar.dtb] Error 1 dts/Makefile:32: recipe for target 'arch/arm/dts/hi3798cv200-poplar.dtb' failed make[1]: *** [arch/arm/dts/hi3798cv200-poplar.dtb] Error 2 Makefile:865: recipe for target 'dts/dt.dtb' failed
make: *** [dts/dt.dtb] Error 2

Quoted 4 lines

Well, lets see. Pantelis has been telling me that what we're doing here is going to lead to problems like what you see here in some cases. Any suggestions?

sorry Tom, this is the right syntax for "chosen" hi3798cv200-u-boot.dtsi uart0 is now initialized and functional via platform data

&soc {
     usb2: ehci at 9890000 {
         compatible = "generic-ehci";
         reg = <0x9890000 0x100>;
         status = "okay";
     };
};
&uart0 {
     status = "disabled";
};
/{
     chosen {
         stdout-path = "";
     };
};
#47 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

In reply to Tom Rini

Hi Tom,

Quoted 48 lines · Tom Rini
Quoted 47 lines · Jorge Ramirez
Quoted 17 lines · Jorge Ramirez
Quoted 16 lines · Tom Rini
Quoted 15 lines · Jorge Ramirez
Quoted 14 lines · Tom Rini
Quoted 9 lines
Quoted 8 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as
platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not
have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1,
saying as such in the commit (if it's just the commit message that changes, that's fine and great).

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board, and remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines

- Please update serial_pl01x.c to be able to get the clock via platform
data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then you can use platform data,

I dont think that would because CONFIG_OF is enabled for USB; so the kernel dtsi that contains the uart node (without the clock!) will be picked by u-boot and the uart will not be initialized properly. I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1];
then just get rid of the file when possible (and NEIHER the source code NOR the configs) would need to change

Quoted 5 lines
Quoted 1 line

[1] https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Yes, sorry. [1] needs to be updated to disable uart0 so that you can use platform data, at least for now. I do want to talk more with Rob about the general problem this exposes.

Using platform data because we cannot put a clock frequency in the DT node seems unfortunate to me. With a little flexibility, DT can be made to work. But IMO the sort of pedantry makes great the enemy of good.

Regards,
Simon

#48 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 53 lines · Simon Glass

Hi Tom,

Quoted 50 lines · Tom Rini
Quoted 48 lines · Jorge Ramirez
Quoted 17 lines · Jorge Ramirez
Quoted 16 lines · Tom Rini
Quoted 15 lines · Jorge Ramirez
Quoted 14 lines · Tom Rini
Quoted 9 lines
Quoted 8 lines
Quoted 1 line

having platform data.

No, I think we're going for overkill here by not doing serial_pl01x.c as
platform data. ns16550 does platform data for this already. This sounds like the lowest overhead way to get the clock populated and not
have some DT data that's not going to be accepted upstream.

ummmm I am a bit lost at this point, could we recap please?

Lets update the recap:
- Please re-submit the dts file, now with whatever form is in v4.12-rc1,
saying as such in the commit (if it's just the commit message that changes, that's fine and great).

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

The DTS file in v4.12-rc2 still does NOT contain the usb node.

==> Should I then not use the DM on USB so I can avoid DTS changes?

Well, you can either put it in the -u-boot.dtsi file for the board, and remove that later once it's upstream.

yes I'll do that. thanks.

Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines

- Please update serial_pl01x.c to be able to get the clock via platform
data, update and test your board to confirm it works.

um, It gets tricky;
I can not use platform_data since I can not use SERIAL_DM because the device tree does have a UART node which gets picked up.

How about disabling the node in -u-boot.dtsi for the board and then you can use platform data,

I dont think that would because CONFIG_OF is enabled for USB; so the kernel dtsi that contains the uart node (without the clock!) will be picked by u-boot and the uart will not be initialized properly. I still think that the simplest solution is to let me merge with the kernel's device tree plus this u-boot.dtsi [1];
then just get rid of the file when possible (and NEIHER the source code NOR the configs) would need to change

[1] https://github.com/ldts/poplar-u-boot/blob/upstream/arch/arm/dts/hi3798cv200-u-boot.dtsi

Quoted 8 lines
Quoted 3 lines

Yes, sorry. [1] needs to be updated to disable uart0 so that you can use platform data, at least for now. I do want to talk more with Rob about the general problem this exposes.

Using platform data because we cannot put a clock frequency in the DT node seems unfortunate to me. With a little flexibility, DT can be made to work. But IMO the sort of pedantry makes great the enemy of good.

This, and the alias issue we talked about the other day (wrt mmc) do highlight what I see as problems of the dts being too kernel-centric. But I also really want to wait for Rob to chime in before we get too far here.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170525/46d18186/attachment.sig>
#49 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

In reply to Rob Herring
Quoted 36 lines · Rob Herring
Quoted 20 lines · Tom Rini
Quoted 19 lines · Jorge Ramirez
Quoted 18 lines · Tom Rini
Quoted 18 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Can you take a stab at updating the pl01x driver? Thanks!

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Quoted 3 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay.

agreed

Quoted 5 lines

But I don't
think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

I also agree but please do notice that this was not quite what I was saying. what I am saying is that writing a stub driver to only provide a single UART clock rate and nothing else is also an overkill (this platform has no need for other clocks in u-boot)

Incidentally the value that I need to retrieve is itself hard-coded in an array in the kernel source code and set up via clk_register_fixed_rate instead of using a fixed-clock node in the device tree.
So there is not much value that I can see in providing such a stub driver really...

Quoted 2 lines

Rob

maintainer
#50 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 61 lines · Jorge Ramirez
Quoted 46 lines · Rob Herring
Quoted 28 lines · Tom Rini
Quoted 26 lines · Jorge Ramirez
Quoted 23 lines · Tom Rini
Quoted 15 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Quoted 6 lines

Then when ehci is added to the kernel, the ehci node can be removed

from u-boot.dtsi

And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Can you take a stab at updating the pl01x driver? Thanks!

Quoted 8 lines
Quoted 4 lines

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Quoted 3 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay.

agreed

Quoted 5 lines

But I don't
think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Quoted 4 lines

I also agree but please do notice that this was not quite what I was saying. what I am saying is that writing a stub driver to only provide a single UART clock rate and nothing else is also an overkill (this platform has no need for other clocks in u-boot)

Sorry, I find that hard to believe. There's no SD card, display, SPI, I2C? Those all need clocks at some point.

Quoted 5 lines

Incidentally the value that I need to retrieve is itself hard-coded in an array in the kernel source code and set up via clk_register_fixed_rate instead of using a fixed-clock node in the device tree.
So there is not much value that I can see in providing such a stub driver really...

If you don't need clock properties in Linux, then you shouldn't need them in u-boot either. But that's not what I see in the dts under review:

+ uart0: serial at 8b00000 {

+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x8b00000 0x1000>;
+                       interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&sysctrl HISTB_UART0_CLK>;
+                       clock-names = "apb_pclk";
+                       status = "disabled";
+               };
+
+               uart2: serial at 8b02000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x8b02000 0x1000>;
+                       interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&crg HISTB_UART2_CLK>;
+                       clock-names = "apb_pclk";
+                       status = "disabled";

+ };
+

Which BTW is also wrong as a single clock is deprecated. There should be 2 clocks.

Rob

#51 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

Quoted 51 lines · Rob Herring
Quoted 49 lines · Jorge Ramirez
Quoted 36 lines · Rob Herring
Quoted 20 lines · Tom Rini
Quoted 19 lines · Jorge Ramirez
Quoted 18 lines · Tom Rini
Quoted 18 lines

hey Tom, I am not sure how to move this forward really so let me clarify where I think we stand:

1. The linux kernel does not need the clock property in the uart nodes (only u-boot does: serial_pl01x.c needs fixing).
2. ehci is not present in the linux kernel poplar dts yet but it will be eventually.

with this in mind, what is blocking the acceptance of the patchset?

I can do v5 using the linux kernel dts as is and creating a hi3798cv200-u-boot.dtsi that simply adds the nodes above (this time no #include required:) )

Then when ehci is added to the kernel, the ehci node can be removed from u-boot.dtsi
And when uboot updates its pl01x.c serial driver, the uart0 node can be removed and the u-boot.dtsi filed completely deleted.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Can you take a stab at updating the pl01x driver? Thanks!

updating pl01x is not a big deal I dont think; however this will mean requiring a platform specific clock driver to just use the pl01x - which will take me some time to get into uboot for my platform (and the same might happen to other users).

Ah right. So the flip side here, is one not allowed to have the clock property anymore? Yes, it may not be used in the kernel, but has someone argued that it's not part of the hardware description?

First I've ever seen a "clock" property. We have "clocks" from the clock binding which is a phandle plus #clock-cells number of args. We also have "clock-frequency" which is just the frequency value and has been around forever. Why u-boot went off and did something different i don't know. Sigh. What I can say is a 3rd way is not going to be accepted.

Quoted 3 lines

Generally, the clock binding replaces clock-frequency, but there are some cases where clock binding would be overkill or too complicated for early boot and using clock-frequency would be okay.

agreed

Quoted 5 lines

But I don't
think "I haven't written my platform clock controller driver yet" is a reason to use clock-frequency as generally most platforms are going to have to have one. Providing a stub driver that just returns a fixed frequency shouldn't be too hard IMO.

Quoted 6 lines
Quoted 4 lines

I also agree but please do notice that this was not quite what I was saying. what I am saying is that writing a stub driver to only provide a single UART clock rate and nothing else is also an overkill (this platform has no need for other clocks in u-boot)

Sorry, I find that hard to believe. There's no SD card, display, SPI, I2C? Those all need clocks at some point.

No, the BOOT ROM takes care of them in this platform (pinux, clocks, DDR initialization, etc).
in uboot we are using the console (for which we only need the clock-frequency), eMMC and USB ehci (for storage and networking) and there are no clocks that need to be set in BL33 (uboot runs as BL33)

Quoted 9 lines
Quoted 6 lines

Incidentally the value that I need to retrieve is itself hard-coded in an array in the kernel source code and set up via clk_register_fixed_rate instead of using a fixed-clock node in the device tree.
So there is not much value that I can see in providing such a stub driver really...

If you don't need clock properties in Linux, then you shouldn't need them in u-boot either. But that's not what I see in the dts under review:

sorry I dont understand your point. is this a question about uboot?

Quoted 20 lines
(quoted diff) +18 -0
+               uart0: serial at 8b00000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x8b00000 0x1000>;
+                       interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&sysctrl HISTB_UART0_CLK>;
+                       clock-names = "apb_pclk";
+                       status = "disabled";
+               };
+
+               uart2: serial at 8b02000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x8b02000 0x1000>;
+                       interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&crg HISTB_UART2_CLK>;
+                       clock-names = "apb_pclk";
+                       status = "disabled";
+               };
+
Quoted 2 lines

Which BTW is also wrong as a single clock is deprecated. There should be 2 clocks.

yes I noticed that as well while reading the bindings

Quoted 2 lines

Rob

#52 lore raw

PATCH v4 3/3 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards

In reply to Jorge Ramirez-Ortiz

Am 08.05.2017 um 18:36 schrieb Jorge Ramirez-Ortiz:

Quoted 36 lines

This port adds support for:
1) Serial
2) eMMC
3) USB

It has been tested with ARM TRUSTED FIRMWARE running u-boot as the BL33 executable [see board's README]

eMMC has been tested for reading and booting the loader[1] and linux kernels as well as saving the u-boot environment.

USB has been tested with ASIX networking adapter and SanDisk 7.4GB drive.

PSCI has been tested via the reset call.

The firwmare upgrade process has been tested via TFTP and USB FAT filesystem containing the fastboot.bin image in one of the partitions.

---
 arch/arm/Kconfig                                   |  12 ++
 arch/arm/dts/hi3798cv200.dtsi                      |   3 +
 arch/arm/dts/poplar-uboot.dtsi                     |  24 +++
 arch/arm/include/asm/arch-hi3798cv200/dwmmc.h      |  13 ++
 .../arm/include/asm/arch-hi3798cv200/hi3798cv200.h |  50 +++++
 board/hisilicon/poplar/Kconfig                     |  15 ++
 board/hisilicon/poplar/MAINTAINERS                 |   6 +
 board/hisilicon/poplar/Makefile                    |   7 +
 board/hisilicon/poplar/README                      | 232 +++++++++++++++++++++
 board/hisilicon/poplar/poplar.c                    | 155 ++++++++++++++
 configs/poplar_defconfig                           |  26 +++
 include/configs/poplar.h                           |  86 ++++++++
 12 files changed, 629 insertions(+)
 create mode 100644 arch/arm/dts/poplar-uboot.dtsi
 create mode 100644 arch/arm/include/asm/arch-hi3798cv200/dwmmc.h
Quoted 8 lines
 create mode 100644 arch/arm/include/asm/arch-hi3798cv200/hi3798cv200.h
 create mode 100644 board/hisilicon/poplar/Kconfig
 create mode 100644 board/hisilicon/poplar/MAINTAINERS
 create mode 100644 board/hisilicon/poplar/Makefile
 create mode 100644 board/hisilicon/poplar/README
 create mode 100644 board/hisilicon/poplar/poplar.c
 create mode 100644 configs/poplar_defconfig
 create mode 100644 include/configs/poplar.h

Wende an: ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards .git/rebase-apply/patch:237: trailing whitespace.
DRAM DDR3/3L/4 SDRAM interface, maximum 32-bit data width 2 GB .git/rebase-apply/patch:66: new blank line at EOF.
+
.git/rebase-apply/patch:96: new blank line at EOF.
+
.git/rebase-apply/patch:616: new blank line at EOF.
+
.git/rebase-apply/patch:648: new blank line at EOF.
+
warning: 5 Zeilen fügen Whitespace-Fehler hinzu.

Please address the whitespace warnings.

Regards,
Andreas

Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)