From 6ee68402f4aeacf77305a1bac1c6985aa843d4bd Mon Sep 17 00:00:00 2001 From: Qiufang Dai Date: Tue, 12 Dec 2017 19:55:02 +0800 Subject: [PATCH] G12A: initial dts porting for pxp PD#156734: G12A: initial dts porting for pxp Change-Id: I84d9bd5eb97c0ae0e04f17cd1e41b68fead0ed05 Signed-off-by: Qiufang Dai --- MAINTAINERS | 5 + arch/arm64/boot/dts/amlogic/g12a_pxp.dts | 73 ++++++++ arch/arm64/boot/dts/amlogic/mesong12a.dtsi | 259 +++++++++++++++++++++++++++++ drivers/amlogic/uart/meson_uart.c | 3 +- scripts/amlogic/mk_dtb_gx.sh | 2 + 5 files changed, 341 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/boot/dts/amlogic/g12a_pxp.dts create mode 100644 arch/arm64/boot/dts/amlogic/mesong12a.dtsi diff --git a/MAINTAINERS b/MAINTAINERS index 3b26ab1..c5f1aaa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14270,3 +14270,8 @@ F: Documentation/devicetree/bindings/amlogic/axg-sound-loopback.txt AMLOGIC RM FILM_VOF_SOFT.H IN DI DRIVER M: Bencheng Jing F: drivers/amlogic/media/deinterlace/film_vof_soft.h + +AMLOGIC G12A +M: Qiufang Dai +F: arch/arm64/boot/dts/amlogic/mesong12a.dtsi +F: arch/arm64/boot/dts/amlogic/g12a_pxp.dts diff --git a/arch/arm64/boot/dts/amlogic/g12a_pxp.dts b/arch/arm64/boot/dts/amlogic/g12a_pxp.dts new file mode 100644 index 0000000..16be19d --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/g12a_pxp.dts @@ -0,0 +1,73 @@ +/* + * arch/arm64/boot/dts/amlogic/g12a_pxp.dts + * + * Copyright (C) 2017 Amlogic, Inc. All rights reserved. + * + * 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. + * + */ + +/dts-v1/; + +#include "mesong12a.dtsi" + +/ { + model = "Amlogic"; + compatible = "amlogic, g12a"; + interrupt-parent = <&gic>; + #address-cells = <2>; + #size-cells = <2>; + + aliases { + serial0 = &uart_AO; + }; + + memory@00000000 { + device_type = "memory"; + linux,usable-memory = <0x0 0x100000 0x0 0x3ff00000>; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + /* global autoconfigured region for contiguous allocations */ + secmon_reserved:linux,secmon { + compatible = "shared-dma-pool"; + reusable; + size = <0x0 0x400000>; + alignment = <0x0 0x400000>; + alloc-ranges = <0x0 0x05000000 0x0 0x400000>; + }; + + secos_reserved:linux,secos { + status = "disable"; + compatible = "amlogic, aml_secos_memory"; + reg = <0x0 0x05300000 0x0 0x2000000>; + no-map; + }; + }; + +}; /* end of / */ + +&aobus{ + uart_AO: serial@3000 { + compatible = "amlogic, meson-uart"; + reg = <0x0 0x3000 0x0 0x18>; + interrupts = <0 193 1>; + status = "okay"; + clocks = <&xtal>; + clock-names = "clk_uart"; + xtal_tick_en = <1>; + fifosize = < 64 >; + support-sysrq = <0>; /* 0 not support , 1 support */ + }; +}; diff --git a/arch/arm64/boot/dts/amlogic/mesong12a.dtsi b/arch/arm64/boot/dts/amlogic/mesong12a.dtsi new file mode 100644 index 0000000..3c1106a --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/mesong12a.dtsi @@ -0,0 +1,259 @@ +/* + * arch/arm64/boot/dts/amlogic/mesong12a.dtsi + * + * Copyright (C) 2017 Amlogic, Inc. All rights reserved. + * + * 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. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/ { + cpus:cpus { + #address-cells = <2>; + #size-cells = <0>; + + cpu-map { + cluster0:cluster0 { + core0 { + cpu = <&CPU0>; + }; + core1 { + cpu = <&CPU1>; + }; + core2 { + cpu = <&CPU2>; + }; + core3 { + cpu = <&CPU3>; + }; + }; + }; + + CPU0:cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53","arm,armv8"; + reg = <0x0 0x0>; + enable-method = "psci"; + //clocks = <&scpi_dvfs 0>; + //clock-names = "cpu-cluster.0"; + //cpu-idle-states = <&CPU_SLEEP_0>; + }; + + CPU1:cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a53","arm,armv8"; + reg = <0x0 0x1>; + enable-method = "psci"; + //clocks = <&scpi_dvfs 0>; + //clock-names = "cpu-cluster.0"; + //cpu-idle-states = <&CPU_SLEEP_0>; + }; + + CPU2:cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a53","arm,armv8"; + reg = <0x0 0x2>; + enable-method = "psci"; + //clocks = <&scpi_dvfs 0>; + //clock-names = "cpu-cluster.0"; + //cpu-idle-states = <&CPU_SLEEP_0>; + }; + + CPU3:cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a53","arm,armv8"; + reg = <0x0 0x3>; + enable-method = "psci"; + //clocks = <&scpi_dvfs 0>; + //clock-names = "cpu-cluster.0"; + //cpu-idle-states = <&CPU_SLEEP_0>; + }; + + idle-states { + entry-method = "arm,psci-0.2"; + CPU_SLEEP_0: cpu-sleep-0 { + compatible = "arm,idle-state"; + arm,psci-suspend-param = <0x0010000>; + local-timer-stop; + entry-latency-us = <5000>; + exit-latency-us = <5000>; + min-residency-us = <15000>; + }; + }; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = , + , + , + ; + }; + + timer_bc { + compatible = "arm, meson-bc-timer"; + reg= <0x0 0xffd0f190 0x0 0x4 0x0 0xffd0f194 0x0 0x4>; + timer_name = "Meson TimerF"; + clockevent-rating=<300>; + clockevent-shift=<20>; + clockevent-features=<0x23>; + interrupts = <0 60 1>; + bit_enable=<16>; + bit_mode=<12>; + bit_resolution=<0>; + }; + arm_pmu { + compatible = "arm,armv8-pmuv3"; + interrupts = <0 137 4>; + }; + + gic: interrupt-controller@2c001000 { + compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <0>; + interrupt-controller; + reg = <0x0 0xffc01000 0 0x1000>, + <0x0 0xffc02000 0 0x0100>; + interrupts = ; + }; + + meson_suspend:pm { + compatible = "amlogic, pm"; + status = "disabled"; + device_name = "aml_pm"; + reg = <0x0 0xff80023c 0x0 0x4>; + }; + + secmon { + compatible = "amlogic, secmon"; + status = "disabled"; + memory-region = <&secmon_reserved>; + in_base_func = <0x82000020>; + out_base_func = <0x82000021>; + reserve_mem_size = <0x00300000>; + }; + + mailbox: mhu@c883c400 { + compatible = "amlogic, meson_mhu"; + reg = <0x0 0xff63c400 0x0 0x4c>, /* MHU registers */ + <0x0 0xfffd3000 0x0 0x800>; /* Payload area */ + interrupts = <0 209 1>, /* low priority interrupt */ + <0 210 1>; /* high priority interrupt */ + #mbox-cells = <1>; + mbox-names = "cpu_to_scp_low", "cpu_to_scp_high"; + mboxes = <&mailbox 0 &mailbox 1>; + }; + + cpu_iomap { + compatible = "amlogic, iomap"; + #address-cells=<2>; + #size-cells=<2>; + ranges; + io_cbus_base { + reg = <0x0 0xffd00000 0x0 0x26000>; + }; + io_apb_base { + reg = <0x0 0xffe01000 0x0 0x7f000>; + }; + io_aobus_base { + reg = <0x0 0xff800000 0x0 0xb000>; + }; + io_vapb_base { + reg = <0x0 0xff900000 0x0 0x50000>; + }; + io_hiu_base { + reg = <0x0 0xff63c000 0x0 0x2000>; + }; + }; + + xtal: xtal-clk { + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "xtal"; + #clock-cells = <0>; + }; + + cpu_info { + compatible = "amlogic, cpuinfo"; + status = "okay"; + cpuinfo_cmd = <0x82000044>; + }; + + soc { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + cbus: cbus@ffd00000 { + compatible = "simple-bus"; + reg = <0x0 0xffd00000 0x0 0x26000>; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x0 0x0 0x0 0xffd00000 0x0 0x26000>; + + meson_clk_msr { + compatible = "amlogic, gxl_measure"; + reg = <0x0 0x18004 0x0 0x4 + 0x0 0x1800c 0x0 0x4>; + }; + }; /* end of cbus */ + + aobus: aobus@ff800000 { + compatible = "simple-bus"; + reg = <0x0 0xff800000 0x0 0xb000>; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x0 0x0 0x0 0xff800000 0x0 0xb000>; + + cpu_version { + reg=<0x0 0x220 0x0 0x4>; + }; + };/* end of aobus */ + + periphs: periphs@ff634400 { + compatible = "simple-bus"; + reg = <0x0 0xff634400 0x0 0x400>; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x0 0x0 0x0 0xff634400 0x0 0x400>; + + };/* end of periphs */ + + hiubus: hiubus@ff63c000 { + compatible = "simple-bus"; + reg = <0x0 0xff63c000 0x0 0x2000>; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x0 0x0 0x0 0xff63c000 0x0 0x2000>; + + clkc: clock-controller@0 { + compatible = "amlogic,axg-clkc"; + #clock-cells = <1>; + reg = <0x0 0x0 0x0 0x320>; + }; + };/* end of hiubus*/ + + }; /* end of soc*/ + +};/* end of / */ + diff --git a/drivers/amlogic/uart/meson_uart.c b/drivers/amlogic/uart/meson_uart.c index 27598bd..70b5a63 100644 --- a/drivers/amlogic/uart/meson_uart.c +++ b/drivers/amlogic/uart/meson_uart.c @@ -1092,7 +1092,8 @@ static int meson_uart_probe(struct platform_device *pdev) pr_err("%s: clock source not found\n", dev_name(&pdev->dev)); /* return PTR_ERR(clk); */ } - port->uartclk = clk_get_rate(clk); + if (!IS_ERR(clk)) + port->uartclk = clk_get_rate(clk); #endif port->fifosize = 64; diff --git a/scripts/amlogic/mk_dtb_gx.sh b/scripts/amlogic/mk_dtb_gx.sh index 46593c3..e35b9ed 100755 --- a/scripts/amlogic/mk_dtb_gx.sh +++ b/scripts/amlogic/mk_dtb_gx.sh @@ -27,3 +27,5 @@ make ARCH=arm64 axg_s420.dtb || echo "Compile dtb Fail !!" make ARCH=arm64 axg_s400_v03.dtb || echo "Compile dtb Fail !!" make ARCH=arm64 axg_s420_v03.dtb || echo "Compile dtb Fail !!" + +make ARCH=arm64 g12a_pxp.dtb || echo "Compile dtb Fail!!" -- 2.7.4