linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhou Yanjie <zhouyanjie@zoho.com>
To: Paul Cercueil <paul@crapouillou.net>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, robh+dt@kernel.org,
	paul.burton@mips.com, paulburton@kernel.org, jhogan@kernel.org,
	mripard@kernel.org, shawnguo@kernel.org, mark.rutland@arm.com,
	syq@debian.org, ralf@linux-mips.org, heiko@sntech.de,
	icenowy@aosc.io, laurent.pinchart@ideasonboard.com,
	krzk@kernel.org, geert+renesas@glider.be,
	prasannatsmkumar@gmail.com, sernia.zhou@foxmail.com,
	zhenwenjin@gmail.com, 772753199@qq.com
Subject: Re: [PATCH v4 4/6] MIPS: Ingenic: Initial YSH & ATIL CU Neo board support.
Date: Thu, 28 Nov 2019 13:11:45 +0800	[thread overview]
Message-ID: <5DDF5711.9050008@zoho.com> (raw)
In-Reply-To: <1574873873.3.1@crapouillou.net>

Hi Paul,

On 2019年11月28日 00:57, Paul Cercueil wrote:
> Hi Zhou,
>
>
> Le mer., nov. 27, 2019 at 01:06, Zhou Yanjie <zhouyanjie@zoho.com> a 
> écrit :
>> 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 <zhouyanjie@zoho.com>
>> ---
>>
>> 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.
>>
>>  arch/mips/boot/dts/ingenic/Makefile   |   1 +
>>  arch/mips/boot/dts/ingenic/cu1000.dts |  52 ++++++++++++++++++
>>  arch/mips/configs/cu1000_defconfig    | 100 
>> ++++++++++++++++++++++++++++++++++
>>  arch/mips/jz4740/Kconfig              |   4 ++
>>  4 files changed, 157 insertions(+)
>>  create mode 100644 arch/mips/boot/dts/ingenic/cu1000.dts
>>  create mode 100644 arch/mips/configs/cu1000_defconfig
>>
>> diff --git a/arch/mips/boot/dts/ingenic/Makefile 
>> b/arch/mips/boot/dts/ingenic/Makefile
>> index 9cc4844..f6db7bb 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)    += cu1000.dtb
>>
>>  obj-$(CONFIG_BUILTIN_DTB)    += $(addsuffix .o, $(dtb-y))
>> diff --git a/arch/mips/boot/dts/ingenic/cu1000.dts 
>> b/arch/mips/boot/dts/ingenic/cu1000.dts
>> new file mode 100644
>> index 00000000..f92f6af
>> --- /dev/null
>> +++ b/arch/mips/boot/dts/ingenic/cu1000.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", "ingenic,x1000";
>> +    model = "YSH & ATIL General Board CU Neo";
>> +
>> +    aliases {
>> +        serial2 = &uart2;
>> +    };
>> +
>> +    chosen {
>> +        stdout-path = &uart2;
>> +    };
>> +
>> +    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 #1 for the system timer channel #2 for the 
>> clocksource */
>> +    ingenic,pwm-channels-mask = <0xfa>;
>
> From the mask used, I'm gessing that you're reserving channels #0 and 
> #2, not #1 and #2.
>

My fault, you are right, it use channels #0 and #2.

>> +};
>> +
>> +&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_defconfig 
>> b/arch/mips/configs/cu1000_defconfig
>> new file mode 100644
>> index 00000000..88729ee
>> --- /dev/null
>> +++ b/arch/mips/configs/cu1000_defconfig
>> @@ -0,0 +1,100 @@
>> +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=y
>> +CONFIG_HIGHMEM=y
>> +CONFIG_HZ_100=y
>> +CONFIG_HZ=100
>
> This line looks malformed.

Ok, I'll remove it in v7.

>
>> +# 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="console=ttyS2,115200n8 mem=32M@0x0 earlycon 
>> clk_ignore_unused"
>
> You already specify the stdout-path in the devicetree, no need to pass 
> the "console" parameter.
>

According the test log , if remove "console=ttyS2,115200n8", serial will not
initialized and will stuck after:

[    0.016815] printk: bootconsole [x1000_uart0] disabled

if remove both "console=ttyS2,115200n8" and "earlycon" it will stuck after:

Starting kernel ...

So I think both the "earlycon" and the "console=ttyS2,115200n8 earlycon" 
should be retained.

> For the "mem" parameter, it's already set in the devicetree, so no 
> need to set it again here.
> Besides, in the devicetree it is set to 64 MiB.

Ok, I'll remove them in v7.

>
> Why is clk_ignore_unused needed?

In fact, I also don't know why "clk_ignore_unused" needed.
This part of the parameter is copied from ci20_defconfig,
but according to the test, if remove "clk_ignore_unused",
it will stuck after :

[    0.374361] printk: bootconsole [x1000_uart0] disabled

Differeent from the case where "console=ttyS2,115200n8" is removed,
the serial is successfully initialized this time.

So I think "clk_ignore_unused" should be retained.

Thanks and best regards!

>
> Cheers,
> -Paul
>
>> +CONFIG_CMDLINE_OVERRIDE=y
>> diff --git a/arch/mips/jz4740/Kconfig b/arch/mips/jz4740/Kconfig
>> index 6b96844..ccaf507 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
>> +    bool "YSH & ATIL General Module CU1000"
>> +    select MACH_X1000
>> +
>>  endchoice
>>
>>  config MACH_JZ4740
>> -- 
>> 2.7.4
>>
>>
>
>




  reply	other threads:[~2019-11-28  5:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 17:06 Add initial support for Ingenic X1000 SoC and Y&A CU Neo board v4 Zhou Yanjie
2019-11-26 17:06 ` [PATCH v4 1/6] MIPS: Ingenic: Initial X1000 support Zhou Yanjie
2019-11-26 17:06 ` [PATCH v4 2/6] dt-bindings: Document yna vendor-prefix Zhou Yanjie
2019-11-26 17:06 ` [PATCH v4 3/6] dt-bindings: MIPS: Add Ingenic XBurst based boards Zhou Yanjie
2019-11-26 17:06 ` [PATCH v4 4/6] MIPS: Ingenic: Initial YSH & ATIL CU Neo board support Zhou Yanjie
2019-11-27 16:57   ` Paul Cercueil
2019-11-28  5:11     ` Zhou Yanjie [this message]
2019-11-28 12:31       ` Paul Cercueil
2019-11-29  7:48         ` Zhou Yanjie
2019-11-26 17:06 ` [PATCH v4 5/6] MIPS: X1000: Add pdma controller DT node Zhou Yanjie
2019-11-27 16:48   ` Paul Cercueil
2019-11-28  3:26     ` Zhou Yanjie
2019-11-26 17:06 ` [PATCH v4 6/6] MIPS: CU1000: Update defconfig for pdma controller Zhou Yanjie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5DDF5711.9050008@zoho.com \
    --to=zhouyanjie@zoho.com \
    --cc=772753199@qq.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=heiko@sntech.de \
    --cc=icenowy@aosc.io \
    --cc=jhogan@kernel.org \
    --cc=krzk@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mripard@kernel.org \
    --cc=paul.burton@mips.com \
    --cc=paul@crapouillou.net \
    --cc=paulburton@kernel.org \
    --cc=prasannatsmkumar@gmail.com \
    --cc=ralf@linux-mips.org \
    --cc=robh+dt@kernel.org \
    --cc=sernia.zhou@foxmail.com \
    --cc=shawnguo@kernel.org \
    --cc=syq@debian.org \
    --cc=zhenwenjin@gmail.com \
    --subject='Re: [PATCH v4 4/6] MIPS: Ingenic: Initial YSH & ATIL CU Neo board support.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).