2019-11-29 08:53:31

by Zhou Yanjie

[permalink] [raw]
Subject: Add initial support for Ingenic X1000 SoC and Y&A CU Neo board v6.

v5->v6:
1.Use "stdout-path = "serial2:115200n8"" instead "stdout-path = &uart2" in DT.
2.Remove "console=ttyS2,115200n8" and "CONFIG_CMDLINE_OVERRIDE=y" from defconfg.
3.Add watchdog timer DT node, and update defconfig for watchdog timer.



2019-11-29 08:54:17

by Zhou Yanjie

[permalink] [raw]
Subject: [PATCH v6 04/12] MIPS: Ingenic: Initial YSH & ATIL CU Neo board support.

Add a device tree for the Ingenic X1000 based YSH & ATIL CU Neo board.
Note that this is unselectable via Kconfig until the X1000 SoC is made
selectable in a later commit.

Signed-off-by: Zhou Yanjie <[email protected]>
---

Notes:
v1->v2:
Rebase on top of mips-next, use TCU for system timer and clocksource.

v2->v3:
No change.

v3->v4:
1.Adjust "model" in "cu1000.dts" to match the description in "devices.yaml".
2.Adjust "bool" in "Kconfig" to avoid duplicate names with subsequent boards.

v4->v5:
1.Rename "cu1000" to "cu1000-neo" to prevent conflicts with subsequent boards
such as "cu1000-geo", and so on.
2.Remove "CONFIG_HZ=100" and "mem=32M@0x0" from defconfg.
3.Modify incorrect comments in DT.

v5->v6:
1.Use "stdout-path = "serial2:115200n8"" instead "stdout-path = &uart2" in DT.
2.Remove "console=ttyS2,115200n8" and "CONFIG_CMDLINE_OVERRIDE=y" from defconfg.

arch/mips/boot/dts/ingenic/Makefile | 1 +
arch/mips/boot/dts/ingenic/cu1000-neo.dts | 52 ++++++++++++++++
arch/mips/configs/cu1000-neo_defconfig | 98 +++++++++++++++++++++++++++++++
arch/mips/jz4740/Kconfig | 4 ++
4 files changed, 155 insertions(+)
create mode 100644 arch/mips/boot/dts/ingenic/cu1000-neo.dts
create mode 100644 arch/mips/configs/cu1000-neo_defconfig

diff --git a/arch/mips/boot/dts/ingenic/Makefile b/arch/mips/boot/dts/ingenic/Makefile
index 9cc4844..e165429 100644
--- a/arch/mips/boot/dts/ingenic/Makefile
+++ b/arch/mips/boot/dts/ingenic/Makefile
@@ -2,5 +2,6 @@
dtb-$(CONFIG_JZ4740_QI_LB60) += qi_lb60.dtb
dtb-$(CONFIG_JZ4770_GCW0) += gcw0.dtb
dtb-$(CONFIG_JZ4780_CI20) += ci20.dtb
+dtb-$(CONFIG_X1000_CU1000_NEO) += cu1000-neo.dtb

obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/ingenic/cu1000-neo.dts b/arch/mips/boot/dts/ingenic/cu1000-neo.dts
new file mode 100644
index 00000000..fb00439
--- /dev/null
+++ b/arch/mips/boot/dts/ingenic/cu1000-neo.dts
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+
+#include "x1000.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/ingenic,tcu.h>
+
+/ {
+ compatible = "yna,cu1000-neo", "ingenic,x1000";
+ model = "YSH & ATIL General Board CU Neo";
+
+ aliases {
+ serial2 = &uart2;
+ };
+
+ chosen {
+ stdout-path = "serial2:115200n8";
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0x0 0x04000000>;
+ };
+};
+
+&exclk {
+ clock-frequency = <24000000>;
+};
+
+&tcu {
+ /* 1500 kHz for the system timer and clocksource */
+ assigned-clocks = <&tcu TCU_CLK_TIMER0>, <&tcu TCU_CLK_TIMER2>;
+ assigned-clock-rates = <1500000>, <1500000>;
+
+ /* Use channel #0 for the system timer channel #2 for the clocksource */
+ ingenic,pwm-channels-mask = <0xfa>;
+};
+
+&uart2 {
+ status = "okay";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pins_uart2>;
+};
+
+&pinctrl {
+ pins_uart2: uart2 {
+ function = "uart2";
+ groups = "uart2-data-d";
+ bias-disable;
+ };
+};
diff --git a/arch/mips/configs/cu1000-neo_defconfig b/arch/mips/configs/cu1000-neo_defconfig
new file mode 100644
index 00000000..4fafe92
--- /dev/null
+++ b/arch/mips/configs/cu1000-neo_defconfig
@@ -0,0 +1,98 @@
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_KERNEL_GZIP=y
+CONFIG_SYSVIPC=y
+CONFIG_NO_HZ_IDLE=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_CGROUPS=y
+CONFIG_MEMCG=y
+CONFIG_MEMCG_KMEM=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_NAMESPACES=y
+CONFIG_USER_NS=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="arch/mips/boot/ramdisk.cpio.gz"
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+CONFIG_MACH_INGENIC=y
+CONFIG_X1000_CU1000_NEO=y
+CONFIG_HIGHMEM=y
+CONFIG_HZ_100=y
+# CONFIG_SECCOMP is not set
+# CONFIG_SUSPEND is not set
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_COMPACTION is not set
+CONFIG_CMA=y
+CONFIG_CMA_AREAS=7
+CONFIG_UEVENT_HELPER=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_ALLOW_DEV_COREDUMP is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_SERIO is not set
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_LEGACY_PTY_COUNT=2
+CONFIG_SERIAL_EARLYCON=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=3
+CONFIG_SERIAL_8250_RUNTIME_UARTS=3
+CONFIG_SERIAL_8250_INGENIC=y
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_GPIO_SYSFS=y
+# CONFIG_HWMON is not set
+# CONFIG_LCD_CLASS_DEVICE is not set
+# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_HID is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_NVMEM=y
+CONFIG_NVMEM_SYSFS=y
+CONFIG_EXT4_FS=y
+# CONFIG_DNOTIFY is not set
+CONFIG_PROC_KCORE=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_TMPFS=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_NLS=y
+CONFIG_NLS_CODEPAGE_936=y
+CONFIG_NLS_CODEPAGE_950=y
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_UTF8=y
+CONFIG_CRYPTO_ECHAINIV=y
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
+CONFIG_PRINTK_TIME=y
+CONFIG_CONSOLE_LOGLEVEL_DEFAULT=15
+CONFIG_CONSOLE_LOGLEVEL_QUIET=15
+CONFIG_MESSAGE_LOGLEVEL_DEFAULT=7
+CONFIG_DEBUG_INFO=y
+CONFIG_STRIP_ASM_SYMS=y
+CONFIG_DEBUG_FS=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_PANIC_ON_OOPS=y
+CONFIG_PANIC_TIMEOUT=10
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+CONFIG_STACKTRACE=y
+# CONFIG_FTRACE is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="earlycon clk_ignore_unused"
diff --git a/arch/mips/jz4740/Kconfig b/arch/mips/jz4740/Kconfig
index 6b96844..412d2fa 100644
--- a/arch/mips/jz4740/Kconfig
+++ b/arch/mips/jz4740/Kconfig
@@ -16,6 +16,10 @@ config JZ4780_CI20
bool "MIPS Creator CI20"
select MACH_JZ4780

+config X1000_CU1000_NEO
+ bool "YSH & ATIL CU1000 Module with Neo backplane"
+ select MACH_X1000
+
endchoice

config MACH_JZ4740
--
2.7.4


2019-11-29 08:54:29

by Zhou Yanjie

[permalink] [raw]
Subject: [PATCH v6 05/12] MIPS: X1000: Add pdma controller DT node.

Add the appropriate DT node to probe the pdma controller driver
using the devicetree.

Signed-off-by: Zhou Yanjie <[email protected]>
---

Notes:
v4:
New patch.

v4->v5:
No change.

v5->v6:
No change.

arch/mips/boot/dts/ingenic/x1000.dtsi | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/arch/mips/boot/dts/ingenic/x1000.dtsi b/arch/mips/boot/dts/ingenic/x1000.dtsi
index 13a6c9ff..c432828 100644
--- a/arch/mips/boot/dts/ingenic/x1000.dtsi
+++ b/arch/mips/boot/dts/ingenic/x1000.dtsi
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <dt-bindings/clock/x1000-cgu.h>
+#include <dt-bindings/dma/x1000-dma.h>

/ {
#address-cells = <1>;
@@ -173,4 +174,16 @@

status = "disabled";
};
+
+ pdma: dma-controller@13420000 {
+ compatible = "ingenic,x1000-dma";
+ reg = <0x13420000 0x400
+ 0x13421000 0x40>;
+ #dma-cells = <2>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <10>;
+
+ clocks = <&cgu X1000_CLK_PDMA>;
+ };
};
--
2.7.4


2019-11-29 08:55:20

by Zhou Yanjie

[permalink] [raw]
Subject: [PATCH v6 06/12] MIPS: CU1000: Update defconfig for pdma controller.

Selected pdma controller support by default.

Signed-off-by: Zhou Yanjie <[email protected]>
---

Notes:
v4:
New patch.

v4->v5:
No change.

v5->v6:
No change.

arch/mips/configs/cu1000-neo_defconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/mips/configs/cu1000-neo_defconfig b/arch/mips/configs/cu1000-neo_defconfig
index 4fafe92..6ac51ec 100644
--- a/arch/mips/configs/cu1000-neo_defconfig
+++ b/arch/mips/configs/cu1000-neo_defconfig
@@ -61,6 +61,8 @@ CONFIG_GPIO_SYSFS=y
# CONFIG_VGA_CONSOLE is not set
# CONFIG_HID is not set
# CONFIG_USB_SUPPORT is not set
+CONFIG_DMADEVICES=y
+CONFIG_DMA_JZ4780=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_NVMEM=y
CONFIG_NVMEM_SYSFS=y
--
2.7.4


2019-11-29 08:55:25

by Zhou Yanjie

[permalink] [raw]
Subject: [PATCH v6 07/12] MIPS: X1000: Add msc controller DT node.

Add the appropriate DT node to probe the msc controller driver
using the devicetree.

Signed-off-by: Zhou Yanjie <[email protected]>
---

Notes:
v5:
New patch.

v5->v6:
No change.

arch/mips/boot/dts/ingenic/cu1000-neo.dts | 16 ++++++++++++
arch/mips/boot/dts/ingenic/x1000.dtsi | 42 +++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)

diff --git a/arch/mips/boot/dts/ingenic/cu1000-neo.dts b/arch/mips/boot/dts/ingenic/cu1000-neo.dts
index fb00439..195b266 100644
--- a/arch/mips/boot/dts/ingenic/cu1000-neo.dts
+++ b/arch/mips/boot/dts/ingenic/cu1000-neo.dts
@@ -43,10 +43,26 @@
pinctrl-0 = <&pins_uart2>;
};

+&msc0 {
+ status = "okay";
+
+ bus-width = <8>;
+ max-frequency = <50000000>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pins_msc0>;
+};
+
&pinctrl {
pins_uart2: uart2 {
function = "uart2";
groups = "uart2-data-d";
bias-disable;
};
+
+ pins_msc0: msc0 {
+ function = "mmc0";
+ groups = "mmc0-1bit", "mmc0-4bit", "mmc0-8bit";
+ bias-disable;
+ };
};
diff --git a/arch/mips/boot/dts/ingenic/x1000.dtsi b/arch/mips/boot/dts/ingenic/x1000.dtsi
index c432828..8b8d335 100644
--- a/arch/mips/boot/dts/ingenic/x1000.dtsi
+++ b/arch/mips/boot/dts/ingenic/x1000.dtsi
@@ -186,4 +186,46 @@

clocks = <&cgu X1000_CLK_PDMA>;
};
+
+ msc0: msc@13450000 {
+ compatible = "ingenic,x1000-mmc";
+ reg = <0x13450000 0x1000>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <37>;
+
+ clocks = <&cgu X1000_CLK_MSC0>;
+ clock-names = "mmc";
+
+ cap-sd-highspeed;
+ cap-mmc-highspeed;
+ cap-sdio-irq;
+
+ dmas = <&pdma X1000_DMA_MSC0_RX 0xffffffff>,
+ <&pdma X1000_DMA_MSC0_TX 0xffffffff>;
+ dma-names = "rx", "tx";
+
+ status = "disabled";
+ };
+
+ msc1: msc@13460000 {
+ compatible = "ingenic,x1000-mmc";
+ reg = <0x13460000 0x1000>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <36>;
+
+ clocks = <&cgu X1000_CLK_MSC1>;
+ clock-names = "mmc";
+
+ cap-sd-highspeed;
+ cap-mmc-highspeed;
+ cap-sdio-irq;
+
+ dmas = <&pdma X1000_DMA_MSC1_RX 0xffffffff>,
+ <&pdma X1000_DMA_MSC1_TX 0xffffffff>;
+ dma-names = "rx", "tx";
+
+ status = "disabled";
+ };
};
--
2.7.4


2019-11-29 08:57:52

by Zhou Yanjie

[permalink] [raw]
Subject: [PATCH v6 09/12] MIPS: X1000: Add rtc DT node.

Add the appropriate DT node to probe the rtc driver
using the devicetree.

Signed-off-by: Zhou Yanjie <[email protected]>
---

Notes:
v5:
New patch.

v5->v6:
No change.

arch/mips/boot/dts/ingenic/x1000.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/mips/boot/dts/ingenic/x1000.dtsi b/arch/mips/boot/dts/ingenic/x1000.dtsi
index 8b8d335..2a0810b 100644
--- a/arch/mips/boot/dts/ingenic/x1000.dtsi
+++ b/arch/mips/boot/dts/ingenic/x1000.dtsi
@@ -69,6 +69,17 @@
interrupts = <27 26 25>;
};

+ rtc: rtc@10003000 {
+ compatible = "ingenic,x1000-rtc", "ingenic,jz4780-rtc";
+ reg = <0x10003000 0x4c>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <32>;
+
+ clocks = <&cgu X1000_CLK_RTCLK>;
+ clock-names = "rtc";
+ };
+
pinctrl: pin-controller@10010000 {
compatible = "ingenic,x1000-pinctrl";
reg = <0x10010000 0x800>;
--
2.7.4


2019-11-29 08:58:29

by Zhou Yanjie

[permalink] [raw]
Subject: [PATCH v6 08/12] MIPS: CU1000: Update defconfig for msc controller.

Selected msc controller support by default.

Signed-off-by: Zhou Yanjie <[email protected]>
---

Notes:
v5:
New patch.

v5->v6:
No change.

arch/mips/configs/cu1000-neo_defconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/mips/configs/cu1000-neo_defconfig b/arch/mips/configs/cu1000-neo_defconfig
index 6ac51ec..eef0c5a 100644
--- a/arch/mips/configs/cu1000-neo_defconfig
+++ b/arch/mips/configs/cu1000-neo_defconfig
@@ -61,6 +61,8 @@ CONFIG_GPIO_SYSFS=y
# CONFIG_VGA_CONSOLE is not set
# CONFIG_HID is not set
# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_JZ4740=y
CONFIG_DMADEVICES=y
CONFIG_DMA_JZ4780=y
# CONFIG_IOMMU_SUPPORT is not set
--
2.7.4


2019-11-29 08:59:43

by Zhou Yanjie

[permalink] [raw]
Subject: [PATCH v6 10/12] MIPS: CU1000: Update defconfig for rtc.

Selected rtc support by default.

Signed-off-by: Zhou Yanjie <[email protected]>
---

Notes:
v5:
New patch.

v5->v6:
No change.

arch/mips/configs/cu1000-neo_defconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/mips/configs/cu1000-neo_defconfig b/arch/mips/configs/cu1000-neo_defconfig
index eef0c5a..b2c090a 100644
--- a/arch/mips/configs/cu1000-neo_defconfig
+++ b/arch/mips/configs/cu1000-neo_defconfig
@@ -63,6 +63,8 @@ CONFIG_GPIO_SYSFS=y
# CONFIG_USB_SUPPORT is not set
CONFIG_MMC=y
CONFIG_MMC_JZ4740=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_JZ4740=y
CONFIG_DMADEVICES=y
CONFIG_DMA_JZ4780=y
# CONFIG_IOMMU_SUPPORT is not set
--
2.7.4


2019-11-29 11:17:50

by Paul Cercueil

[permalink] [raw]
Subject: Re: Add initial support for Ingenic X1000 SoC and Y&A CU Neo board v6.

Hi Zhou,

This series need some reorder.

You introduce the defconfig in patch [03/12], then modify it in
[06/12], [08/12] and [10/12]. This just makes the patchset hard to
review and less likely to be merged.

Simply:
- Add missing X1000 nodes (pdma, mmc, rtc) in one patch,
- then add the CU Neo devicetree & config with PDMA, MMC and RTC
enabled.

And where are patches [11/12] and [12/12]? I didn't receive them.

Cheers,
-Paul



Le ven., nov. 29, 2019 at 16:48, Zhou Yanjie <[email protected]> a
?crit :
> v5->v6:
> 1.Use "stdout-path = "serial2:115200n8"" instead "stdout-path =
> &uart2" in DT.
> 2.Remove "console=ttyS2,115200n8" and "CONFIG_CMDLINE_OVERRIDE=y"
> from defconfg.
> 3.Add watchdog timer DT node, and update defconfig for watchdog timer.
>
>