[U-Boot] [PATCH v2 00/17]
Subsystems (7)
v2 cover [U-Boot] [PATCH v2 00/17]
This series patch bring up rk3036 uboot, since rk3036 only 4K size SRAM for SPL, so in SPL image only support timer, uart, sdram driver, adn back to bootrom when finish ddr initial.
Lin Huang (17):
rockchip: add timer driver
rockchip: move SYS_MALLOC_F_LEN to rk3288 own Kconfig
rockchip: rename board-spl.c to rk3288-board-spl.c
rockchip: add config decide whether to build common.c
dm: core: Add SPL Kconfig for REGMAP and SYSCON
rockchip: serial driver support rk3036
rockchip: Bring in RK3036 device tree file includes and bindings
rockchip: rk3036: Add clock driver
rockchip: rk3036: Add header files for GRF
rockchip: rk3036: Add Soc reset driver
rockchip: rk3036: Add a simple syscon driver
rockchip: rk3036: Add pinctrl driver
rockchip: Add an rk3036 MMC driver
rockchip: add early uart driver
rockchip: add rk3036 sdram driver
rockchip: rk3036: Add core Soc start-up code
rockchip: Add basic support for evb-rk3036 board
arch/arm/dts/Makefile | 3 +- arch/arm/dts/rk3036-sdk.dts | 46 ++ arch/arm/dts/rk3036.dtsi | 427 +++++++++++++ arch/arm/include/asm/arch-rockchip/cru_rk3036.h | 168 +++++ arch/arm/include/asm/arch-rockchip/grf_rk3036.h | 493 +++++++++++++++ arch/arm/include/asm/arch-rockchip/sdram_rk3036.h | 337 ++++++++++ arch/arm/include/asm/arch-rockchip/timer.h | 16 + arch/arm/include/asm/arch-rockchip/uart.h | 39 ++ arch/arm/mach-rockchip/Kconfig | 13 +- arch/arm/mach-rockchip/Makefile | 10 +- arch/arm/mach-rockchip/board-spl.c | 287 --------- arch/arm/mach-rockchip/board.c | 1 + arch/arm/mach-rockchip/rk3036-board-spl.c | 44 ++ arch/arm/mach-rockchip/rk3036/Kconfig | 17 + arch/arm/mach-rockchip/rk3036/Makefile | 13 + arch/arm/mach-rockchip/rk3036/reset_rk3036.c | 45 ++ arch/arm/mach-rockchip/rk3036/save_boot_param.S | 34 + arch/arm/mach-rockchip/rk3036/sdram_rk3036.c | 732 ++++++++++++++++++++++ arch/arm/mach-rockchip/rk3036/syscon_rk3036.c | 21 + arch/arm/mach-rockchip/rk3288-board-spl.c | 270 ++++++++ arch/arm/mach-rockchip/rk3288/Kconfig | 3 + arch/arm/mach-rockchip/rk_early_print.c | 55 ++ arch/arm/mach-rockchip/rk_timer.c | 48 ++ board/evb_rk3036/evb_rk3036/Kconfig | 15 + board/evb_rk3036/evb_rk3036/MAINTAINERS | 0 board/evb_rk3036/evb_rk3036/Makefile | 7 + board/evb_rk3036/evb_rk3036/evb_rk3036.c | 48 ++ configs/chromebook_jerry_defconfig | 2 + configs/evb-rk3036_defconfig | 29 + configs/firefly-rk3288_defconfig | 2 + configs/sandbox_defconfig | 2 + drivers/clk/Makefile | 1 + drivers/clk/clk_rk3036.c | 414 ++++++++++++ drivers/core/Kconfig | 19 + drivers/core/Makefile | 4 +- drivers/mmc/Kconfig | 9 + drivers/mmc/Makefile | 1 + drivers/mmc/rockchip_3036_dw_mmc.c | 487 ++++++++++++++ drivers/pinctrl/Kconfig | 18 + drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3036.c | 276 ++++++++ drivers/serial/serial_rockchip.c | 1 + include/configs/evb_rk3036.h | 12 + include/configs/rk3036_common.h | 120 ++++ include/configs/rk3288_common.h | 6 +- include/dt-bindings/clock/rk3036-cru.h | 186 ++++++ 46 files changed, 4484 insertions(+), 298 deletions(-) create mode 100644 arch/arm/dts/rk3036-sdk.dts create mode 100644 arch/arm/dts/rk3036.dtsi create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3036.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3036.h create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_rk3036.h create mode 100644 arch/arm/include/asm/arch-rockchip/timer.h create mode 100644 arch/arm/include/asm/arch-rockchip/uart.h delete mode 100644 arch/arm/mach-rockchip/board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3036-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3036/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3036/Makefile create mode 100644 arch/arm/mach-rockchip/rk3036/reset_rk3036.c create mode 100644 arch/arm/mach-rockchip/rk3036/save_boot_param.S create mode 100644 arch/arm/mach-rockchip/rk3036/sdram_rk3036.c create mode 100644 arch/arm/mach-rockchip/rk3036/syscon_rk3036.c create mode 100644 arch/arm/mach-rockchip/rk3288-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk_early_print.c create mode 100644 arch/arm/mach-rockchip/rk_timer.c create mode 100644 board/evb_rk3036/evb_rk3036/Kconfig create mode 100644 board/evb_rk3036/evb_rk3036/MAINTAINERS create mode 100644 board/evb_rk3036/evb_rk3036/Makefile create mode 100644 board/evb_rk3036/evb_rk3036/evb_rk3036.c create mode 100644 configs/evb-rk3036_defconfig create mode 100644 drivers/clk/clk_rk3036.c create mode 100644 drivers/mmc/rockchip_3036_dw_mmc.c create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3036.c create mode 100644 include/configs/evb_rk3036.h create mode 100644 include/configs/rk3036_common.h create mode 100644 include/dt-bindings/clock/rk3036-cru.h
Signature · 1 line
1.9.1
PATCH v2 1/17 rockchip: add timer driver
some rockchip soc will not include lib/timer.c in SPL stage, so implement timer driver for some soc can use us delay function in SPL.
---
Changes in v1: None
Changes in v2: add udelay function
arch/arm/include/asm/arch-rockchip/timer.h | 16 ++++++++++ arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/board-spl.c | 21 ++----------- arch/arm/mach-rockchip/rk_timer.c | 48 ++++++++++++++++++++++++++++++ include/configs/rk3288_common.h | 3 +- 5 files changed, 69 insertions(+), 20 deletions(-) create mode 100644 arch/arm/include/asm/arch-rockchip/timer.h create mode 100644 arch/arm/mach-rockchip/rk_timer.c
arch/arm/include/asm/arch-rockchip/timer.h new file +16 -0
@@ -0,0 +1,16 @@ +#ifndef __ASM_ARCH_TIMER_H +#define __ASM_ARCH_TIMER_H + +struct rk_timer { +unsigned int timer_load_count0; +unsigned int timer_load_count1; +unsigned int timer_curr_value0; +unsigned int timer_curr_value1; +unsigned int timer_ctrl_reg; +unsigned int timer_int_status; +}; + +void rockchip_timer_init (void ); +void rockchip_udelay (unsigned int us); + +#endif
arch/arm/mach-rockchip/Makefile +1 -0
@@ -10,4 +10,5 @@ else obj-y += board.o endif obj-y += common.o +obj-y += rk_timer.o obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288/
arch/arm/mach-rockchip/board-spl.c +2 -19
@@ -18,6 +18,7 @@#include <asm/arch/hardware.h> #include <asm/arch/periph.h> #include <asm/arch/sdram.h> +#include <asm/arch/timer.h> #include <dm/pinctrl.h> #include <dm/root.h> #include <dm/test.h>
@@ -110,24 +111,6 @@ static void configure_l2ctlr(void)write_l2ctlr (l2ctlr); } -struct rk3288_timer { -u32 timer_load_count0; -u32 timer_load_count1; -u32 timer_curr_value0; -u32 timer_curr_value1; -u32 timer_ctrl_reg; -u32 timer_int_status; -}; - -void init_timer (void ) -{ -struct rk3288_timer *const timer7_ptr = (void *)TIMER7_BASE ; - -writel (0xffffffff , &timer7_ptr->timer_load_count0); -writel (0xffffffff , &timer7_ptr->timer_load_count1); -writel (1 , &timer7_ptr->timer_ctrl_reg); -} -static int configure_emmc (struct udevice *pinctrl) {struct gpio_desc desc;
@@ -197,7 +180,7 @@ void board_init_f(ulong dummy)hang (); } -init_timer (); +rockchip_timer_init ();configure_l2ctlr (); ret =uclass_get_device (UCLASS_CLK ,0 , &dev);
arch/arm/mach-rockchip/rk_timer.c new file +48 -0
48 lines not on this page · raw message
include/configs/rk3288_common.h +2 -1
@@ -24,7 +24,8 @@#define CONFIG_DISPLAY_BOARDINFO #define CONFIG_SYS_TIMER_RATE (24 * 1000 * 1000) -#define CONFIG_SYS_TIMER_COUNTER (TIMER7_BASE + 8) +#define CONFIG_SYS_TIMER_BASE 0xff810020/* TIMER7 */ +#define CONFIG_SYS_TIMER_COUNTER (CONFIG_SYS_TIMER_BASE + 8)#define CONFIG_SPL_FRAMEWORK #define CONFIG_SPL_LIBCOMMON_SUPPORT
Signature · 1 line
1.9.1
PATCH v2 2/17 rockchip: move SYS_MALLOC_F_LEN to rk3288 own Kconfig
In reply to Lin Huangsince different rockchip SOC have different size of SRAM, So the size SYS_MALLOC_F_LEN may different, so move this config to rk3288 own Kconfig
---
Changes in v1: None
Changes in v2: None
arch/arm/mach-rockchip/Kconfig | 3 --- arch/arm/mach-rockchip/rk3288/Kconfig | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-rockchip/Kconfig +0 -3
@@ -12,9 +12,6 @@ config ROCKCHIP_RK3288 config SYS_MALLOC_F default y -config SYS_MALLOC_F_LEN - default 0x800 - config SPL_DM default y
arch/arm/mach-rockchip/rk3288/Kconfig +3 -0
@@ -19,6 +19,9 @@ config TARGET_CHROMEBOOK_JERRY config SYS_SOC default "rockchip" +config SYS_MALLOC_F_LEN + default 0x0800 + source "board/google/chromebook_jerry/Kconfig" source "board/firefly/firefly-rk3288/Kconfig"
Signature · 1 line
1.9.1
PATCH v2 3/17 rockchip: rename board-spl.c to rk3288-board-spl.c
In reply to Lin Huangsince different rockchip soc need different spl file, so rename board-spl.c.
---
arch/arm/mach-rockchip/Makefile | 2 +- arch/arm/mach-rockchip/board-spl.c | 270 ------------------------------ arch/arm/mach-rockchip/rk3288-board-spl.c | 270 ++++++++++++++++++++++++++++++ 3 files changed, 271 insertions(+), 271 deletions(-) delete mode 100644 arch/arm/mach-rockchip/board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3288-board-spl.c
arch/arm/mach-rockchip/Makefile +1 -1
@@ -5,7 +5,7 @@ # ifdef CONFIG_SPL_BUILD -obj-y += board-spl.o +obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o else obj-y += board.o endif
arch/arm/mach-rockchip/board-spl.c deleted +0 -270
270 lines not on this page · raw message
arch/arm/mach-rockchip/rk3288-board-spl.c new file +270 -0
270 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 4/17 rockchip: add config decide whether to build common.c
In reply to Lin Huangsome rockchips soc will not use uclass in SPL stage, so define config to decide whether to build common.c
--- arch/arm/mach-rockchip/Makefile | 2 +- include/configs/rk3288_common.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-rockchip/Makefile +1 -1
@@ -9,6 +9,6 @@ obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o else obj-y += board.o endif -obj-y += common.o obj-y += rk_timer.o +obj-$(CONFIG_$(SPL_)ROCKCHIP_COMMON) += common.o obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288/
include/configs/rk3288_common.h +3 -0
@@ -45,6 +45,9 @@#define CONFIG_SPL_STACK 0xff718000#define CONFIG_SPL_TEXT_BASE 0xff704004 +#define CONFIG_ROCKCHIP_COMMON +#define CONFIG_SPL_ROCKCHIP_COMMON +/* MMC/SD IP block */ #define CONFIG_MMC #define CONFIG_GENERIC_MMC
Signature · 1 line
1.9.1
PATCH v2 5/17 dm: core: Add SPL Kconfig for REGMAP and SYSCON
In reply to Lin HuangAdd SPL Kconfig for REGMAP and SYSCON, so REGMAP and SYSCON can remove from SPL stage.
--- configs/chromebook_jerry_defconfig | 2 ++ configs/firefly-rk3288_defconfig | 2 ++ configs/sandbox_defconfig | 2 ++ drivers/core/Kconfig | 19 +++++++++++++++++++ drivers/core/Makefile | 4 ++-- 5 files changed, 27 insertions(+), 2 deletions(-)
configs/chromebook_jerry_defconfig +2 -0
@@ -14,7 +14,9 @@ CONFIG_SPL_OF_CONTROL=y CONFIG_CLK=y CONFIG_SPL_CLK=y CONFIG_REGMAP=y +CONFIG_SPL_REGMAP=y CONFIG_SYSCON=y +CONFIG_SPL_SYSCON=y CONFIG_RESET=y CONFIG_LED=y CONFIG_SPL_LED=y
configs/firefly-rk3288_defconfig +2 -0
@@ -14,7 +14,9 @@ CONFIG_SPL_OF_CONTROL=y CONFIG_CLK=y CONFIG_SPL_CLK=y CONFIG_REGMAP=y +CONFIG_SPL_REGMAP=y CONFIG_SYSCON=y +CONFIG_SPL_SYSCON=y CONFIG_RESET=y CONFIG_LED=y CONFIG_LED_GPIO=y
configs/sandbox_defconfig +2 -0
@@ -17,7 +17,9 @@ CONFIG_OF_CONTROL=y CONFIG_OF_HOSTFILE=y CONFIG_CLK=y CONFIG_REGMAP=y +CONFIG_SPL_REGMAP=y CONFIG_SYSCON=y +CONFIG_SPL_SYSCON=y CONFIG_DEVRES=y CONFIG_DM_PCI=y CONFIG_PCI_SANDBOX=y
drivers/core/Kconfig +19 -0
@@ -72,6 +72,16 @@ config REGMAP support any bus type (I2C, SPI) but so far this only supports direct memory access. +config SPL_REGMAP + bool "Support register maps in SPL" + depends on DM + help + Hardware peripherals tend to have one or more sets of registers + which can be accessed to control the hardware. A register map + models this with a simple read/write interface. It can in principle + support any bus type (I2C, SPI) but so far this only supports + direct memory access. + config SYSCON bool "Support system controllers" depends on REGMAP
@@ -81,6 +91,15 @@ config SYSCON by this uclass, including accessing registers via regmap and assigning a unique number to each. +config SPL_SYSCON + bool "Support system controllers in SPL" + depends on REGMAP + help + Many SoCs have a number of system controllers which are dealt with + as a group by a single driver. Some common functionality is provided + by this uclass, including accessing registers via regmap and + assigning a unique number to each. + config DEVRES bool "Managed device resources" depends on DM
drivers/core/Makefile +2 -2
@@ -9,5 +9,5 @@ obj-$(CONFIG_DEVRES) += devres.o obj-$(CONFIG_$(SPL_)DM_DEVICE_REMOVE) += device-remove.o obj-$(CONFIG_$(SPL_)SIMPLE_BUS) += simple-bus.o obj-$(CONFIG_DM) += dump.o -obj-$(CONFIG_REGMAP) += regmap.o -obj-$(CONFIG_SYSCON) += syscon-uclass.o +obj-$(CONFIG_$(SPL_)REGMAP) += regmap.o +obj-$(CONFIG_$(SPL_)SYSCON) += syscon-uclass.o
Signature · 1 line
1.9.1
PATCH v2 6/17 rockchip: serial driver support rk3036
In reply to Lin Huang---
Changes in v1: None
Changes in v2:
- modify code suggest by Simon
drivers/serial/serial_rockchip.c | 1 + 1 file changed, 1 insertion(+)
drivers/serial/serial_rockchip.c +1 -0
@@ -12,6 +12,7 @@static const struct udevice_id rockchip_serial_ids[] = { { .compatible ="rockchip,rk3288-uart" }, + { .compatible ="rockchip,rk3036-uart" }, { } };
Signature · 1 line
1.9.1
PATCH v2 7/17 rockchip: Bring in RK3036 device tree file includes and bindings
In reply to Lin HuangSince rk3036 device tree file still in reviewing, bring it from
https://patchwork.kernel.org/patch/7203371/ and add some aliases we need in uboot
---
Changes in v1:
- clean copyright announcement
Changes in v2: None
arch/arm/dts/rk3036.dtsi | 427 +++++++++++++++++++++++++++++++++ include/dt-bindings/clock/rk3036-cru.h | 186 ++++++++++++++ 2 files changed, 613 insertions(+) create mode 100644 arch/arm/dts/rk3036.dtsi create mode 100644 include/dt-bindings/clock/rk3036-cru.h
arch/arm/dts/rk3036.dtsi new file +427 -0
@@ -0,0 +1,427 @@ +/* + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/pinctrl/rockchip.h> +#include <dt-bindings/clock/rk3036-cru.h> +#include "skeleton.dtsi" + +/ { + compatible = "rockchip,rk3036"; + + interrupt-parent = <&gic>; + + aliases { + gpio0 = &gpio0; + gpio1 = &gpio1; + gpio2 = &gpio2; + i2c1 = &i2c1; + serial0 = &uart0; + serial1 = &uart1; + serial2 = &uart2; + mmc0 = &emmc; + }; + + memory { + device_type = "memory"; + reg = <0x60000000 0x40000000>; + }; + + arm-pmu { + compatible = "arm,cortex-a7-pmu"; + interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>; + interrupt-affinity = <&cpu0>, <&cpu1>; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + enable-method = "rockchip,rk3036-smp"; + + cpu0: cpu at f00 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf00>; + operating-points = < + /* KHz uV */ + 816000 1000000 + >; + #cooling-cells = <2>; /* min followed by max */ + clock-latency = <40000>; + clocks = <&cru ARMCLK>; + resets = <&cru SRST_CORE0>; + }; + cpu1: cpu at f01 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf01>; + resets = <&cru SRST_CORE1>; + }; + }; + + amba { + compatible = "arm,amba-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + pdma: pdma at 20078000 { + compatible = "arm,pl330", "arm,primecell"; + reg = <0x20078000 0x4000>; + arm,pl330-broken-no-flushp; + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>; + #dma-cells = <1>; + clocks = <&cru ACLK_DMAC2>; + clock-names = "apb_pclk"; + }; + }; + + xin24m: oscillator { + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "xin24m"; + #clock-cells = <0>; + }; + + timer { + compatible = "arm,armv7-timer"; + arm,cpu-registers-not-fw-configured; + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; + clock-frequency = <24000000>; + }; + + cru: clock-controller at 20000000 { + compatible = "rockchip,rk3036-cru"; + reg = <0x20000000 0x1000>; + rockchip,grf = <&grf>; + #clock-cells = <1>; + #reset-cells = <1>; + assigned-clocks = <&cru PLL_GPLL>; + assigned-clock-rates = <594000000>; + }; + + uart0: serial at 20060000 { + compatible = "rockchip,rk3036-uart", "snps,dw-apb-uart"; + reg = <0x20060000 0x100>; + interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>; + clock-names = "baudclk", "apb_pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; + }; + + uart1: serial at 20064000 { + compatible = "rockchip,rk3036-uart", "snps,dw-apb-uart"; + reg = <0x20064000 0x100>; + interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>; + clock-names = "baudclk", "apb_pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&uart1_xfer>; + }; + + uart2: serial at 20068000 { + compatible = "rockchip,rk3036-uart", "snps,dw-apb-uart"; + reg = <0x20068000 0x100>; + interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>; + clock-names = "baudclk", "apb_pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&uart2_xfer>; + }; + + pwm0: pwm at 20050000 { + compatible = "rockchip,rk2928-pwm"; + reg = <0x20050000 0x10>; + #pwm-cells = <3>; + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; + clocks = <&cru PCLK_PWM>; + clock-names = "pwm"; + status = "disabled"; + }; + + pwm1: pwm at 20050010 { + compatible = "rockchip,rk2928-pwm"; + reg = <0x20050010 0x10>; + #pwm-cells = <3>; + pinctrl-names = "default"; + pinctrl-0 = <&pwm1_pin>; + clocks = <&cru PCLK_PWM>; + clock-names = "pwm"; + status = "disabled"; + }; + + pwm2: pwm at 20050020 { + compatible = "rockchip,rk2928-pwm"; + reg = <0x20050020 0x10>; + #pwm-cells = <3>; + pinctrl-names = "default"; + pinctrl-0 = <&pwm2_pin>; + clocks = <&cru PCLK_PWM>; + clock-names = "pwm"; + status = "disabled"; + }; + + pwm3: pwm at 20050030 { + compatible = "rockchip,rk2928-pwm"; + reg = <0x20050030 0x10>; + #pwm-cells = <2>; + pinctrl-names = "default"; + pinctrl-0 = <&pwm3_pin>; + clocks = <&cru PCLK_PWM>; + clock-names = "pwm"; + status = "disabled"; + }; + + sram: sram at 10080000 { + compatible = "rockchip,rk3036-smp-sram", "mmio-sram"; + reg = <0x10080000 0x2000>; + }; + + gic: interrupt-controller at 10139000 { + compatible = "arm,gic-400"; + interrupt-controller; + #interrupt-cells = <3>; + #address-cells = <0>; + + reg = <0x10139000 0x1000>, + <0x1013a000 0x1000>, + <0x1013c000 0x2000>, + <0x1013e000 0x2000>; + interrupts = <GIC_PPI 9 0xf04>; + }; + + grf: syscon at 20008000 { + compatible = "rockchip,rk3036-grf", "syscon"; + reg = <0x20008000 0x1000>; + }; + + usb_otg: usb at 10180000 { + compatible = "rockchip,rk3288-usb", "rockchip,rk3066-usb", + "snps,dwc2"; + reg = <0x10180000 0x40000>; + interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_OTG0>; + clock-names = "otg"; + dr_mode = "otg"; + g-np-tx-fifo-size = <16>; + g-rx-fifo-size = <275>; + g-tx-fifo-size = <256 128 128 64 64 32>; + g-use-dma; + status = "disabled"; + }; + + usb_host: usb at 101c0000 { + compatible = "rockchip,rk3288-usb", "rockchip,rk3066-usb", + "snps,dwc2"; + reg = <0x101c0000 0x40000>; + interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_OTG1>; + clock-names = "otg"; + dr_mode = "host"; + status = "disabled"; + }; + + emmc: dwmmc at 1021c000 { + compatible = "rockchip,rk3288-dw-mshc"; + clock-frequency = <37500000>; + clock-freq-min-max = <400000 37500000>; + clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>, + <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; + clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; + dmas = <&pdma 12>; + dma-names = "rx-tx"; + fifo-depth = <0x100>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x1021c000 0x4000>; + broken-cd; + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + disable-wp; + non-removable; + num-slots = <1>; + default-sample-phase = <158>; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; + }; + + pinctrl: pinctrl { + compatible = "rockchip,rk3036-pinctrl"; + rockchip,grf = <&grf>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + gpio0: gpio0 at 2007c000 { + compatible = "rockchip,gpio-bank"; + reg = <0x2007c000 0x100>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO0>; + + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio1: gpio1 at 20080000 { + compatible = "rockchip,gpio-bank"; + reg = <0x20080000 0x100>; + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO1>; + + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio2: gpio2 at 20084000 { + compatible = "rockchip,gpio-bank"; + reg = <0x20084000 0x100>; + interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO2>; + + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>; + }; + + pcfg_pull_up: pcfg-pull-up { + bias-pull-up; + }; + + pcfg_pull_down: pcfg-pull-down { + bias-pull-down; + }; + + pcfg_pull_none: pcfg-pull-none { + bias-disable; + }; + + emmc { + /* + * We run eMMC at max speed; bump up drive strength. + * We also have external pulls, so disable the internal ones. + */ + emmc_clk: emmc-clk { + rockchip,pins = <2 4 RK_FUNC_2 &pcfg_pull_none>; + }; + + emmc_cmd: emmc-cmd { + rockchip,pins = <2 1 RK_FUNC_2 &pcfg_pull_none>; + }; + + emmc_bus8: emmc-bus8 { + rockchip,pins = <1 24 RK_FUNC_2 &pcfg_pull_none>, + <1 25 RK_FUNC_2 &pcfg_pull_none>, + <1 26 RK_FUNC_2 &pcfg_pull_none>, + <1 27 RK_FUNC_2 &pcfg_pull_none>; + /* + <1 28 RK_FUNC_2 &pcfg_pull_up>, + <1 29 RK_FUNC_2 &pcfg_pull_up>, + <1 30 RK_FUNC_2 &pcfg_pull_up>, + <1 31 RK_FUNC_2 &pcfg_pull_up>; + */ + }; + }; + + uart0 { + uart0_xfer: uart0-xfer { + rockchip,pins = <0 16 RK_FUNC_1 &pcfg_pull_none>, + <0 17 RK_FUNC_1 &pcfg_pull_none>; + }; + + uart0_cts: uart0-cts { + rockchip,pins = <0 18 RK_FUNC_1 &pcfg_pull_none>; + }; + + uart0_rts: uart0-rts { + rockchip,pins = <0 19 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + uart1 { + uart1_xfer: uart1-xfer { + rockchip,pins = <2 22 RK_FUNC_1 &pcfg_pull_none>, + <2 23 RK_FUNC_1 &pcfg_pull_none>; + }; + /* no rts / cts for uart1 */ + }; + + uart2 { + uart2_xfer: uart2-xfer { + rockchip,pins = <1 18 RK_FUNC_2 &pcfg_pull_none>, + <1 19 RK_FUNC_2 &pcfg_pull_none>; + }; + /* no rts / cts for uart2 */ + }; + + pwm0 { + pwm0_pin: pwm0-pin { + rockchip,pins = <0 0 RK_FUNC_2 &pcfg_pull_none>; + }; + }; + + pwm1 { + pwm1_pin: pwm1-pin { + rockchip,pins = <0 1 RK_FUNC_2 &pcfg_pull_none>; + }; + }; + + pwm2 { + pwm2_pin: pwm2-pin { + rockchip,pins = <0 1 2 &pcfg_pull_none>; + }; + }; + + pwm3 { + pwm3_pin: pwm3-pin { + rockchip,pins = <0 27 1 &pcfg_pull_none>; + }; + }; + + i2c1 { + i2c1_xfer: i2c1-xfer { + rockchip,pins = <0 2 RK_FUNC_1 &pcfg_pull_none>, + <0 3 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + }; + + i2c1: i2c at 20056000 { + compatible = "rockchip,rk3288-i2c"; + reg = <0x20056000 0x1000>; + interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; + #address-cells = <1>; + #size-cells = <0>; + clock-names = "i2c"; + clocks = <&cru PCLK_I2C1>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_xfer>; + status = "disabled"; + }; +};
include/dt-bindings/clock/rk3036-cru.h new file +186 -0
186 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 8/17 rockchip: rk3036: Add clock driver
In reply to Lin HuangAdd a driver for setting up and modifying the various PLLs, peripheral clocks and mmc clocks on RK3036
---
Changes in v1:
- clean copyright announcement
Changes in v2:
- move some macro to cru_rk3036.h
arch/arm/include/asm/arch-rockchip/cru_rk3036.h | 168 ++++++++++ drivers/clk/Makefile | 1 + drivers/clk/clk_rk3036.c | 414 ++++++++++++++++++++++++ 3 files changed, 583 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3036.h create mode 100644 drivers/clk/clk_rk3036.c
arch/arm/include/asm/arch-rockchip/cru_rk3036.h new file +168 -0
@@ -0,0 +1,168 @@ +/* +* (C) Copyright 2015 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ +#ifndef _ASM_ARCH_CRU_RK3036_H +#define _ASM_ARCH_CRU_RK3036_H + +#include <common.h> + +#define OSC_HZ (24 * 1000 * 1000) + +#define APLL_HZ (600 * 1000000) +#define GPLL_HZ (594 * 1000000) + +#define CORE_PERI_HZ 150000000 +#define CORE_ACLK_HZ 300000000 + +#define CPU_ACLK_HZ 150000000 +#define CPU_HCLK_HZ 300000000 +#define CPU_PCLK_HZ 300000000 + +#define PERI_ACLK_HZ 148500000 +#define PERI_HCLK_HZ 148500000 +#define PERI_PCLK_HZ 74250000 + +struct rk3036_cru { +struct rk3036_pll { +unsigned int con0; +unsigned int con1; +unsigned int con2; +unsigned int con3; + } pll[4 ]; +unsigned int cru_mode_con; +unsigned int cru_clksel_con[35 ]; +unsigned int cru_clkgate_con[11 ]; +unsigned int reserved; +unsigned int cru_glb_srst_fst_value; +unsigned int cru_glb_srst_snd_value; +unsigned int reserved1[2 ]; +unsigned int cru_softrst_con[9 ]; +unsigned int cru_misc_con; +unsigned int reserved2[2 ]; +unsigned int cru_glb_cnt_th; +unsigned int cru_sdmmc_con[2 ]; +unsigned int cru_sdio_con[2 ]; +unsigned int cru_emmc_con[2 ]; +unsigned int reserved3; +unsigned int cru_rst_st; +unsigned int reserved4[0x23 ]; +unsigned int cru_pll_mask_con; +}; +check_member (rk3036_cru, cru_pll_mask_con,0x01f0 ); + +struct pll_div { +u32 refdiv; +u32 fbdiv; +u32 postdiv1; +u32 postdiv2; +u32 frac; +}; + +enum { +/* PLLCON0*/ +PLL_POSTDIV1_MASK =7 , +PLL_POSTDIV1_SHIFT =12 , +PLL_FBDIV_MASK =0xfff , +PLL_FBDIV_SHIFT =0 , + +/* PLLCON1 */ +PLL_DSMPD_MASK =1 , +PLL_DSMPD_SHIFT =12 , +PLL_LOCK_STATUS_MASK =1 , +PLL_LOCK_STATUS_SHIFT =10 , +PLL_POSTDIV2_MASK =7 , +PLL_POSTDIV2_SHIFT =6 , +PLL_REFDIV_MASK =0x3f , +PLL_REFDIV_SHIFT =0 , +PLL_RST_SHIFT =14 , + +/* CRU_MODE */ +GPLL_MODE_MASK =3 , +GPLL_MODE_SHIFT =12 , +GPLL_MODE_SLOW =0 , +GPLL_MODE_NORM , +GPLL_MODE_DEEP , +DPLL_MODE_MASK =1 , +DPLL_MODE_SHIFT =4 , +DPLL_MODE_SLOW =0 , +DPLL_MODE_NORM , +APLL_MODE_MASK =1 , +APLL_MODE_SHIFT =0 , +APLL_MODE_SLOW =0 , +APLL_MODE_NORM , + +/* CRU_CLK_SEL0_CON */ +CPU_CLK_PLL_SEL_MASK =3 , +CPU_CLK_PLL_SEL_SHIFT =14 , +CPU_CLK_PLL_SEL_APLL =0 , +CPU_CLK_PLL_SEL_DPLL , +CPU_CLK_PLL_SEL_GPLL , +ACLK_CPU_DIV_MASK =0x1f , +ACLK_CPU_DIV_SHIFT =8 , +CORE_CLK_PLL_SEL_MASK =1 , +CORE_CLK_PLL_SEL_SHIFT =7 , +CORE_CLK_PLL_SEL_APLL =0 , +CORE_CLK_PLL_SEL_GPLL , +CORE_DIV_CON_MASK =0x1f , +CORE_DIV_CON_SHIFT =0 , + +/* CRU_CLK_SEL1_CON */ +CPU_PCLK_DIV_MASK =7 , +CPU_PCLK_DIV_SHIFT =12 , +CPU_HCLK_DIV_MASK =3 , +CPU_HCLK_DIV_SHIFT =8 , +CORE_ACLK_DIV_MASK =7 , +CORE_ACLK_DIV_SHIFT =4 , +CORE_PERI_DIV_MASK =0xf , +CORE_PERI_DIV_SHIFT =0 , + +/* CRU_CLKSEL10_CON */ +PERI_PLL_SEL_MASK =3 , +PERI_PLL_SEL_SHIFT =14 , +PERI_PLL_APLL =0 , +PERI_PLL_DPLL , +PERI_PLL_GPLL , +PERI_PCLK_DIV_MASK =3 , +PERI_PCLK_DIV_SHIFT =12 , +PERI_HCLK_DIV_MASK =3 , +PERI_HCLK_DIV_SHIFT =8 , +PERI_ACLK_DIV_MASK =0x1f , +PERI_ACLK_DIV_SHIFT =0 , + +/* CRU_CLKSEL11_CON */ +SDIO_DIV_MASK =0x7f , +SDIO_DIV_SHIFT =8 , +MMC0_DIV_MASK =0x7f , +MMC0_DIV_SHIFT =0 , + +/* CRU_CLKSEL12_CON */ +EMMC_PLL_MASK =3 , +EMMC_PLL_SHIFT =12 , +EMMC_SEL_APLL =0 , +EMMC_SEL_DPLL , +EMMC_SEL_GPLL , +EMMC_SEL_24M , +SDIO_PLL_MASK =3 , +SDIO_PLL_SHIFT =10 , +SDIO_SEL_APLL =0 , +SDIO_SEL_DPLL , +SDIO_SEL_GPLL , +SDIO_SEL_24M , +MMC0_PLL_MASK =3 , +MMC0_PLL_SHIFT =8 , +MMC0_SEL_APLL =0 , +MMC0_SEL_DPLL , +MMC0_SEL_GPLL , +MMC0_SEL_24M , +EMMC_DIV_MASK =0x7f , +EMMC_DIV_SHIFT =0 , + +/* CRU_SOFTRST5_CON */ +DDRCTRL_PSRST_SHIFT =11 , +DDRCTRL_SRST_SHIFT =10 , +DDRPHY_PSRST_SHIFT =9 , +DDRPHY_SRST_SHIFT =8 , +}; +#endif
drivers/clk/Makefile +1 -0
@@ -6,5 +6,6 @@ # obj-$(CONFIG_CLK) += clk-uclass.o +obj-$(CONFIG_ROCKCHIP_RK3036) += clk_rk3036.o obj-$(CONFIG_ROCKCHIP_RK3288) += clk_rk3288.o obj-$(CONFIG_SANDBOX) += clk_sandbox.o
drivers/clk/clk_rk3036.c new file +414 -0
414 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 9/17 rockchip: rk3036: Add header files for GRF
In reply to Lin HuangGRF is the gereral register file. Add header files with register definitions.
---
Changes in v1:
- clean copyright announcement
Changes in v2:
- move some macro to grf_rk3036.h
arch/arm/include/asm/arch-rockchip/grf_rk3036.h | 493 ++++++++++++++++++++++++ 1 file changed, 493 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3036.h
arch/arm/include/asm/arch-rockchip/grf_rk3036.h new file +493 -0
@@ -0,0 +1,493 @@ +/* +* (C) Copyright 2015 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ +#ifndef _ASM_ARCH_GRF_RK3036_H +#define _ASM_ARCH_GRF_RK3036_H + +#include <common.h> + +struct rk3036_grf { +unsigned int reserved[0x2a ]; +unsigned int gpio0a_iomux; +unsigned int gpio0b_iomux; +unsigned int gpio0c_iomux; +unsigned int gpio0d_iomux; + +unsigned int gpio1a_iomux; +unsigned int gpio1b_iomux; +unsigned int gpio1c_iomux; +unsigned int gpio1d_iomux; + +unsigned int gpio2a_iomux; +unsigned int gpio2b_iomux; +unsigned int gpio2c_iomux; +unsigned int gpio2d_iomux; + +unsigned int reserved2[0x0a ]; +unsigned int gpiods; +unsigned int reserved3[0x05 ]; +unsigned int gpio0l_pull; +unsigned int gpio0h_pull; +unsigned int gpio1l_pull; +unsigned int gpio1h_pull; +unsigned int gpio2l_pull; +unsigned int gpio2h_pull; +unsigned int reserved4[4 ]; +unsigned int soc_con0; +unsigned int soc_con1; +unsigned int soc_con2; +unsigned int soc_status0; +unsigned int reserved5; +unsigned int soc_con3; +unsigned int reserved6; +unsigned int dmac_con0; +unsigned int dmac_con1; +unsigned int dmac_con2; +unsigned int reserved7[5 ]; +unsigned int uoc0_con5; +unsigned int reserved8[4 ]; +unsigned int uoc1_con4; +unsigned int uoc1_con5; +unsigned int reserved9; +unsigned int ddrc_stat; +unsigned int uoc_con6; +unsigned int soc_status1; +unsigned int cpu_con0; +unsigned int cpu_con1; +unsigned int cpu_con2; +unsigned int cpu_con3; +unsigned int reserved10; +unsigned int reserved11; +unsigned int cpu_status0; +unsigned int cpu_status1; +unsigned int os_reg[8 ]; +unsigned int reserved12[6 ]; +unsigned int dll_con[4 ]; +unsigned int dll_status[4 ]; +unsigned int dfi_wrnum; +unsigned int dfi_rdnum; +unsigned int dfi_actnum; +unsigned int dfi_timerval; +unsigned int nfi_fifo[4 ]; +unsigned int reserved13[0x10 ]; +unsigned int usbphy0_con[8 ]; +unsigned int usbphy1_con[8 ]; +unsigned int reserved14[0x10 ]; +unsigned int chip_tag; +unsigned int sdmmc_det_cnt; +}; +check_member (rk3036_grf, sdmmc_det_cnt,0x304 ); + +/* GRF_GPIO0A_IOMUX */ +enum { +GPIO0A3_SHIFT =6 , +GPIO0A3_MASK =1 , +GPIO0A3_GPIO =0 , +GPIO0A3_I2C1_SDA , + +GPIO0A2_SHIFT =4 , +GPIO0A2_MASK =1 , +GPIO0A2_GPIO =0 , +GPIO0A2_I2C1_SCL , + +GPIO0A1_SHIFT =2 , +GPIO0A1_MASK =3 , +GPIO0A1_GPIO =0 , +GPIO0A1_I2C0_SDA , +GPIO0A1_PWM2 , + +GPIO0A0_SHIFT =0 , +GPIO0A0_MASK =3 , +GPIO0A0_GPIO =0 , +GPIO0A0_I2C0_SCL , +GPIO0A0_PWM1 , + +}; + +/* GRF_GPIO0B_IOMUX */ +enum { +GPIO0B6_SHIFT =12 , +GPIO0B6_MASK =3 , +GPIO0B6_GPIO =0 , +GPIO0B6_MMC1_D3 , +GPIO0B6_I2S1_SCLK , + +GPIO0B5_SHIFT =10 , +GPIO0B5_MASK =3 , +GPIO0B5_GPIO =0 , +GPIO0B5_MMC1_D2 , +GPIO0B5_I2S1_SDI , + +GPIO0B4_SHIFT =8 , +GPIO0B4_MASK =3 , +GPIO0B4_GPIO =0 , +GPIO0B4_MMC1_D1 , +GPIO0B4_I2S1_LRCKTX , + +GPIO0B3_SHIFT =6 , +GPIO0B3_MASK =3 , +GPIO0B3_GPIO =0 , +GPIO0B3_MMC1_D0 , +GPIO0B3_I2S1_LRCKRX , + +GPIO0B1_SHIFT =2 , +GPIO0B1_MASK =3 , +GPIO0B1_GPIO =0 , +GPIO0B1_MMC1_CLKOUT , +GPIO0B1_I2S1_MCLK , + +GPIO0B0_SHIFT =0 , +GPIO0B0_MASK =3 , +GPIO0B0_GPIO =0 , +GPIO0B0_MMC1_CMD , +GPIO0B0_I2S1_SDO , +}; + +/* GRF_GPIO0C_IOMUX */ +enum { +GPIO0C4_SHIFT =8 , +GPIO0C4_MASK =1 , +GPIO0C4_GPIO =0 , +GPIO0C4_DRIVE_VBUS , + +GPIO0C3_SHIFT =6 , +GPIO0C3_MASK =1 , +GPIO0C3_GPIO =0 , +GPIO0C3_UART0_CTSN , + +GPIO0C2_SHIFT =4 , +GPIO0C2_MASK =1 , +GPIO0C2_GPIO =0 , +GPIO0C2_UART0_RTSN , + +GPIO0C1_SHIFT =2 , +GPIO0C1_MASK =1 , +GPIO0C1_GPIO =0 , +GPIO0C1_UART0_SIN , + + +GPIO0C0_SHIFT =0 , +GPIO0C0_MASK =1 , +GPIO0C0_GPIO =0 , +GPIO0C0_UART0_SOUT , +}; + +/* GRF_GPIO0D_IOMUX */ +enum { +GPIO0D4_SHIFT =8 , +GPIO0D4_MASK =1 , +GPIO0D4_GPIO =0 , +GPIO0D4_SPDIF , + +GPIO0D3_SHIFT =6 , +GPIO0D3_MASK =1 , +GPIO0D3_GPIO =0 , +GPIO0D3_PWM3 , + +GPIO0D2_SHIFT =4 , +GPIO0D2_MASK =1 , +GPIO0D2_GPIO =0 , +GPIO0D2_PWM0 , +}; + +/* GRF_GPIO1A_IOMUX */ +enum { +GPIO1A5_SHIFT =10 , +GPIO1A5_MASK =1 , +GPIO1A5_GPIO =0 , +GPIO1A5_I2S_SDI , + +GPIO1A4_SHIFT =8 , +GPIO1A4_MASK =1 , +GPIO1A4_GPIO =0 , +GPIO1A4_I2S_SD0 , + +GPIO1A3_SHIFT =6 , +GPIO1A3_MASK =1 , +GPIO1A3_GPIO =0 , +GPIO1A3_I2S_LRCKTX , + +GPIO1A2_SHIFT =4 , +GPIO1A2_MASK =6 , +GPIO1A2_GPIO =0 , +GPIO1A2_I2S_LRCKRX , +GPIO1A2_I2S_PWM1_0 , + +GPIO1A1_SHIFT =2 , +GPIO1A1_MASK =1 , +GPIO1A1_GPIO =0 , +GPIO1A1_I2S_SCLK , + +GPIO1A0_SHIFT =0 , +GPIO1A0_MASK =1 , +GPIO1A0_GPIO =0 , +GPIO1A0_I2S_MCLK , + +}; + +/* GRF_GPIO1B_IOMUX */ +enum { +GPIO1B7_SHIFT =14 , +GPIO1B7_MASK =1 , +GPIO1B7_GPIO =0 , +GPIO1B7_MMC0_CMD , + +GPIO1B3_SHIFT =6 , +GPIO1B3_MASK =1 , +GPIO1B3_GPIO =0 , +GPIO1B3_HDMI_HPD , + +GPIO1B2_SHIFT =4 , +GPIO1B2_MASK =1 , +GPIO1B2_GPIO =0 , +GPIO1B2_HDMI_SCL , + +GPIO1B1_SHIFT =2 , +GPIO1B1_MASK =1 , +GPIO1B1_GPIO =0 , +GPIO1B1_HDMI_SDA , + +GPIO1B0_SHIFT =0 , +GPIO1B0_MASK =1 , +GPIO1B0_GPIO =0 , +GPIO1B0_HDMI_CEC , +}; + +/* GRF_GPIO1C_IOMUX */ +enum { +GPIO1C5_SHIFT =10 , +GPIO1C5_MASK =3 , +GPIO1C5_GPIO =0 , +GPIO1C5_MMC0_D3 , +GPIO1C5_JTAG_TMS , + +GPIO1C4_SHIFT =8 , +GPIO1C4_MASK =3 , +GPIO1C4_GPIO =0 , +GPIO1C4_MMC0_D2 , +GPIO1C4_JTAG_TCK , + +GPIO1C3_SHIFT =6 , +GPIO1C3_MASK =3 , +GPIO1C3_GPIO =0 , +GPIO1C3_MMC0_D1 , +GPIO1C3_UART2_SOUT , + +GPIO1C2_SHIFT =4 , +GPIO1C2_MASK =3 , +GPIO1C2_GPIO =0 , +GPIO1C2_MMC0_D0 , +GPIO1C2_UART2_SIN , + +GPIO1C1_SHIFT =2 , +GPIO1C1_MASK =1 , +GPIO1C1_GPIO =0 , +GPIO1C1_MMC0_DETN , + +GPIO1C0_SHIFT =0 , +GPIO1C0_MASK =1 , +GPIO1C0_GPIO =0 , +GPIO1C0_MMC0_CLKOUT , +}; + +/* GRF_GPIO1D_IOMUX */ +enum { +GPIO1D7_SHIFT =14 , +GPIO1D7_MASK =3 , +GPIO1D7_GPIO =0 , +GPIO1D7_NAND_D7 , +GPIO1D7_EMMC_D7 , +GPIO1D7_SPI_CSN1 , + +GPIO1D6_SHIFT =12 , +GPIO1D6_MASK =3 , +GPIO1D6_GPIO =0 , +GPIO1D6_NAND_D6 , +GPIO1D6_EMMC_D6 , +GPIO1D6_SPI_CSN0 , + +GPIO1D5_SHIFT =10 , +GPIO1D5_MASK =3 , +GPIO1D5_GPIO =0 , +GPIO1D5_NAND_D5 , +GPIO1D5_EMMC_D5 , +GPIO1D5_SPI_TXD , + +GPIO1D4_SHIFT =8 , +GPIO1D4_MASK =3 , +GPIO1D4_GPIO =0 , +GPIO1D4_NAND_D4 , +GPIO1D4_EMMC_D4 , +GPIO1D4_SPI_RXD , + +GPIO1D3_SHIFT =6 , +GPIO1D3_MASK =3 , +GPIO1D3_GPIO =0 , +GPIO1D3_NAND_D3 , +GPIO1D3_EMMC_D3 , +GPIO1D3_SFC_SIO3 , + +GPIO1D2_SHIFT =4 , +GPIO1D2_MASK =3 , +GPIO1D2_GPIO =0 , +GPIO1D2_NAND_D2 , +GPIO1D2_EMMC_D2 , +GPIO1D2_SFC_SIO2 , + +GPIO1D1_SHIFT =2 , +GPIO1D1_MASK =3 , +GPIO1D1_GPIO =0 , +GPIO1D1_NAND_D1 , +GPIO1D1_EMMC_D1 , +GPIO1D1_SFC_SIO1 , + +GPIO1D0_SHIFT =0 , +GPIO1D0_MASK =3 , +GPIO1D0_GPIO =0 , +GPIO1D0_NAND_D0 , +GPIO1D0_EMMC_D0 , +GPIO1D0_SFC_SIO0 , +}; + +/* GRF_GPIO2A_IOMUX */ +enum { +GPIO2A7_SHIFT =14 , +GPIO2A7_MASK =1 , +GPIO2A7_GPIO =0 , +GPIO2A7_TESTCLK_OUT , + +GPIO2A6_SHIFT =12 , +GPIO2A6_MASK =1 , +GPIO2A6_GPIO =0 , +GPIO2A6_NAND_CS0 , + +GPIO2A4_SHIFT =8 , +GPIO2A4_MASK =3 , +GPIO2A4_GPIO =0 , +GPIO2A4_NAND_RDY , +GPIO2A4_EMMC_CMD , +GPIO2A3_SFC_CLK , + +GPIO2A3_SHIFT =6 , +GPIO2A3_MASK =3 , +GPIO2A3_GPIO =0 , +GPIO2A3_NAND_RDN , +GPIO2A4_SFC_CSN1 , + +GPIO2A2_SHIFT =4 , +GPIO2A2_MASK =3 , +GPIO2A2_GPIO =0 , +GPIO2A2_NAND_WRN , +GPIO2A4_SFC_CSN0 , + +GPIO2A1_SHIFT =2 , +GPIO2A1_MASK =3 , +GPIO2A1_GPIO =0 , +GPIO2A1_NAND_CLE , +GPIO2A1_EMMC_CLKOUT , + +GPIO2A0_SHIFT =0 , +GPIO2A0_MASK =3 , +GPIO2A0_GPIO =0 , +GPIO2A0_NAND_ALE , +GPIO2A0_SPI_CLK , +}; + +/* GRF_GPIO2B_IOMUX */ +enum { +GPIO2B7_SHIFT =14 , +GPIO2B7_MASK =1 , +GPIO2B7_GPIO =0 , +GPIO2B7_MAC_RXER , + +GPIO2B6_SHIFT =12 , +GPIO2B6_MASK =3 , +GPIO2B6_GPIO =0 , +GPIO2B6_MAC_CLKOUT , +GPIO2B6_MAC_CLKIN , + +GPIO2B5_SHIFT =10 , +GPIO2B5_MASK =1 , +GPIO2B5_GPIO =0 , +GPIO2B5_MAC_TXEN , + +GPIO2B4_SHIFT =8 , +GPIO2B4_MASK =1 , +GPIO2B4_GPIO =0 , +GPIO2B4_MAC_MDIO , + +GPIO2B2_SHIFT =4 , +GPIO2B2_MASK =1 , +GPIO2B2_GPIO =0 , +GPIO2B2_MAC_CRS , +}; + +/* GRF_GPIO2C_IOMUX */ +enum { +GPIO2C7_SHIFT =14 , +GPIO2C7_MASK =3 , +GPIO2C7_GPIO =0 , +GPIO2C7_UART1_SOUT , +GPIO2C7_TESTCLK_OUT1 , + +GPIO2C6_SHIFT =12 , +GPIO2C6_MASK =1 , +GPIO2C6_GPIO =0 , +GPIO2C6_UART1_SIN , + +GPIO2C5_SHIFT =10 , +GPIO2C5_MASK =1 , +GPIO2C5_GPIO =0 , +GPIO2C5_I2C2_SCL , + +GPIO2C4_SHIFT =8 , +GPIO2C4_MASK =1 , +GPIO2C4_GPIO =0 , +GPIO2C4_I2C2_SDA , + +GPIO2C3_SHIFT =6 , +GPIO2C3_MASK =1 , +GPIO2C3_GPIO =0 , +GPIO2C3_MAC_TXD0 , + +GPIO2C2_SHIFT =4 , +GPIO2C2_MASK =1 , +GPIO2C2_GPIO =0 , +GPIO2C2_MAC_TXD1 , + +GPIO2C1_SHIFT =2 , +GPIO2C1_MASK =1 , +GPIO2C1_GPIO =0 , +GPIO2C1_MAC_RXD0 , + +GPIO2C0_SHIFT =0 , +GPIO2C0_MASK =1 , +GPIO2C0_GPIO =0 , +GPIO2C0_MAC_RXD1 , +}; + +/* GRF_GPIO2D_IOMUX */ +enum { +GPIO2D6_SHIFT =12 , +GPIO2D6_MASK =1 , +GPIO2D6_GPIO =0 , +GPIO2D6_I2S_SDO1 , + +GPIO2D5_SHIFT =10 , +GPIO2D5_MASK =1 , +GPIO2D5_GPIO =0 , +GPIO2D5_I2S_SDO2 , + +GPIO2D4_SHIFT =8 , +GPIO2D4_MASK =1 , +GPIO2D4_GPIO =0 , +GPIO2D4_I2S_SDO3 , + +GPIO2D1_SHIFT =2 , +GPIO2D1_MASK =1 , +GPIO2D1_GPIO =0 , +GPIO2D1_MAC_MDC , +}; +#endif
Signature · 1 line
1.9.1
PATCH v2 10/17 rockchip: rk3036: Add Soc reset driver
In reply to Lin HuangWe can reset the Soc using some CRU (clock/reset unit) register. Add support for this.
---
Changes in v1:
- clean copyright announcement
Changes in v2:
- only build reset_rk3036.c in NON-SPL stage
arch/arm/mach-rockchip/rk3036/Makefile | 10 +++++++ arch/arm/mach-rockchip/rk3036/reset_rk3036.c | 45 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 arch/arm/mach-rockchip/rk3036/Makefile create mode 100644 arch/arm/mach-rockchip/rk3036/reset_rk3036.c
arch/arm/mach-rockchip/rk3036/Makefile new file +10 -0
@@ -0,0 +1,10 @@ +# +# (C) Copyright 2015 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +ifndef CONFIG_SPL_BUILD +obj-y += reset_rk3036.o +endif +
arch/arm/mach-rockchip/rk3036/reset_rk3036.c new file +45 -0
45 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 11/17 rockchip: rk3036: Add a simple syscon driver
In reply to Lin HuangAdd a driver that provides access to system controllers
---
Changes in v1:
- clean copyright announcement
Changes in v2:
- only build syscon_rk3036.c on NON-SPL stage
arch/arm/mach-rockchip/rk3036/Makefile | 2 +- arch/arm/mach-rockchip/rk3036/syscon_rk3036.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-rockchip/rk3036/syscon_rk3036.c
arch/arm/mach-rockchip/rk3036/Makefile +1 -1
@@ -6,5 +6,5 @@ ifndef CONFIG_SPL_BUILD obj-y += reset_rk3036.o +obj-y += syscon_rk3036.o endif -
arch/arm/mach-rockchip/rk3036/syscon_rk3036.c new file +21 -0
@@ -0,0 +1,21 @@ +/* +* (C) Copyright 2015 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch/clock.h> + +static const struct udevice_id rk3036_syscon_ids[] = { + { .compatible ="rockchip,rk3036-grf" , .data =ROCKCHIP_SYSCON_GRF }, + { } +}; + +U_BOOT_DRIVER (syscon_rk3036) = { + .name ="rk3036_syscon" , + .id =UCLASS_SYSCON , + .of_match = rk3036_syscon_ids, +};
Signature · 1 line
1.9.1
PATCH v2 12/17 rockchip: rk3036: Add pinctrl driver
In reply to Lin HuangAdd a driver which support pin multiplexing setup for rk3036
---
Changes in v1:
- clean copyright announcement
Changes in v2: None
drivers/pinctrl/Kconfig | 18 ++ drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3036.c | 276 ++++++++++++++++++++++++++++++ 3 files changed, 295 insertions(+) create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3036.c
drivers/pinctrl/Kconfig +18 -0
@@ -114,6 +114,24 @@ config ROCKCHIP_PINCTRL definitions and pin control functions for each available multiplex function. +config ROCKCHIP_3036_PINCTRL + bool "Rockchip rk3036 pin control driver" + depends on DM + help + Support pin multiplexing control on Rockchip rk3036 SoCs. The driver is + controlled by a device tree node which contains both the GPIO + definitions and pin control functions for each available multiplex + function. + +config ROCKCHIP_PINCTRL + bool "Rockchip pin control driver" + depends on DM + help + Support pin multiplexing control on Rockchip SoCs. The driver is + controlled by a device tree node which contains both the GPIO + definitions and pin control functions for each available multiplex + function. + config PINCTRL_SANDBOX bool "Sandbox pinctrl driver" depends on SANDBOX
drivers/pinctrl/rockchip/Makefile +1 -0
@@ -6,3 +6,4 @@ # obj-$(CONFIG_ROCKCHIP_PINCTRL) += pinctrl_rk3288.o +obj-$(CONFIG_ROCKCHIP_3036_PINCTRL) += pinctrl_rk3036.o
drivers/pinctrl/rockchip/pinctrl_rk3036.c new file +276 -0
276 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 13/17 rockchip: Add an rk3036 MMC driver
In reply to Lin Huangrk3036 mmc driver is similar to dw_mmc, but use external dma, this patch implment fifo mode, need to do dma mode in future.
---
Changes in v1:
- clean copyright announcement
Changes in v2:
- modify code suggest by Simon:
- use get_time() to do timeout
drivers/mmc/Kconfig | 9 + drivers/mmc/Makefile | 1 + drivers/mmc/rockchip_3036_dw_mmc.c | 487 +++++++++++++++++++++++++++++++++++++ 3 files changed, 497 insertions(+) create mode 100644 drivers/mmc/rockchip_3036_dw_mmc.c
drivers/mmc/Kconfig +9 -0
@@ -19,6 +19,15 @@ config ROCKCHIP_DWMMC SD 3.0, SDIO 3.0 and MMC 4.5 and supports common eMMC chips as well as removeable SD and micro-SD cards. +config ROCKCHIP_3036_DWMMC + bool "Rockchip 3036 SD/MMC controller support" + depends on DM_MMC && OF_CONTROL + help + This enables support for the Rockchip 3036 SD/MMM controller, which is + based on Designware IP. The device is compatible with at least + SD 3.0, SDIO 3.0 and MMC 4.5 and supports common eMMC chips as well + as removeable SD and micro-SD cards. + config SH_SDHI bool "SuperH/Renesas ARM SoCs on-chip SDHI host controller support" depends on RMOBILE
drivers/mmc/Makefile +1 -0
@@ -30,6 +30,7 @@ obj-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o obj-$(CONFIG_X86) += pci_mmc.o obj-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o obj-$(CONFIG_ROCKCHIP_DWMMC) += rockchip_dw_mmc.o +obj-$(CONFIG_ROCKCHIP_3036_DWMMC) += rockchip_3036_dw_mmc.o obj-$(CONFIG_SUPPORT_EMMC_RPMB) += rpmb.o obj-$(CONFIG_S3C_SDI) += s3c_sdi.o obj-$(CONFIG_S5P_SDHCI) += s5p_sdhci.o
drivers/mmc/rockchip_3036_dw_mmc.c new file +487 -0
487 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 14/17 rockchip: add early uart driver
In reply to Lin Huangadd early uart driver so we can print debug message in SPL stage
--- arch/arm/include/asm/arch-rockchip/uart.h | 39 ++++++++++++++++++++++ arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk_early_print.c | 55 +++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/uart.h create mode 100644 arch/arm/mach-rockchip/rk_early_print.c
arch/arm/include/asm/arch-rockchip/uart.h new file +39 -0
@@ -0,0 +1,39 @@ +#ifndef __ASM_ARCH_UART_H +#define __ASM_ARCH_UART_H +struct rk_uart { +unsigned int rbr;/* Receive buffer register. */ +unsigned int ier;/* Interrupt enable register. */ +unsigned int fcr;/* FIFO control register. */ +unsigned int lcr;/* Line control register. */ +unsigned int mcr;/* Modem control register. */ +unsigned int lsr;/* Line status register. */ +unsigned int msr;/* Modem status register. */ +unsigned int scr; +unsigned int reserved1[(0x30 -0x20 ) /4 ]; +unsigned int srbr[(0x70 -0x30 ) /4 ]; +unsigned int far; +unsigned int tfr; +unsigned int rfw; +unsigned int usr; +unsigned int tfl; +unsigned int rfl; +unsigned int srr; +unsigned int srts; +unsigned int sbcr; +unsigned int sdmam; +unsigned int sfe; +unsigned int srt; +unsigned int stet; +unsigned int htx; +unsigned int dmasa; +unsigned int reserver2[(0xf4 -0xac ) /4 ]; +unsigned int cpr; +unsigned int ucv; +unsigned int ctr; +}; + +void rk_uart_init (void ); +void print_hex (unsigned int n); +void char *s); +#endif +
arch/arm/mach-rockchip/Makefile +1 -0
@@ -10,5 +10,6 @@ else obj-y += board.o endif obj-y += rk_timer.o +obj-y += rk_early_print.o obj-$(CONFIG_$(SPL_)ROCKCHIP_COMMON) += common.o obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288/
arch/arm/mach-rockchip/rk_early_print.c new file +55 -0
55 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 15/17 rockchip: add rk3036 sdram driver
In reply to Lin Huangadd rk3036 sdram driver so we can set up sdram in SPL
--- arch/arm/include/asm/arch-rockchip/sdram_rk3036.h | 337 ++++++++++ arch/arm/mach-rockchip/rk3036/Makefile | 2 + arch/arm/mach-rockchip/rk3036/sdram_rk3036.c | 732 ++++++++++++++++++++++ 3 files changed, 1071 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_rk3036.h create mode 100644 arch/arm/mach-rockchip/rk3036/sdram_rk3036.c
arch/arm/include/asm/arch-rockchip/sdram_rk3036.h new file +337 -0
@@ -0,0 +1,337 @@ +/* +* (C) Copyright 2015 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ +#ifndef _ASM_ARCH_SDRAM_RK3036_H +#define _ASM_ARCH_SDRAM_RK3036_H + +#include <common.h> + +struct rk3036_ddr_pctl { +u32 scfg; +u32 sctl; +u32 stat; +u32 intrstat; +u32 reserved0[12 ]; +u32 mcmd; +u32 powctl; +u32 powstat; +u32 cmdtstat; +u32 cmdtstaten; +u32 reserved1[3 ]; +u32 mrrcfg0; +u32 mrrstat0; +u32 mrrstat1; +u32 reserved2[4 ]; +u32 mcfg1; +u32 mcfg; +u32 ppcfg; +u32 mstat; +u32 lpddr2zqcfg; +u32 reserved3; +u32 dtupdes; +u32 dtuna; +u32 dtune; +u32 dtuprd0; +u32 dtuprd1; +u32 dtuprd2; +u32 dtuprd3; +u32 dtuawdt; +u32 reserved4[3 ]; +u32 togcnt1u; +u32 tinit; +u32 trsth; +u32 togcnt100n; +u32 trefi; +u32 tmrd; +u32 trfc; +u32 trp; +u32 trtw; +u32 tal; +u32 tcl; +u32 tcwl; +u32 tras; +u32 trc; +u32 trcd; +u32 trrd; +u32 trtp; +u32 twr; +u32 twtr; +u32 texsr; +u32 txp; +u32 txpdll; +u32 tzqcs; +u32 tzqcsi; +u32 tdqs; +u32 tcksre; +u32 tcksrx; +u32 tcke; +u32 tmod; +u32 trstl; +u32 tzqcl; +u32 tmrr; +u32 tckesr; +u32 reserved5[47 ]; +u32 dtuwactl; +u32 dturactl; +u32 dtucfg; +u32 dtuectl; +u32 dtuwd0; +u32 dtuwd1; +u32 dtuwd2; +u32 dtuwd3; +u32 dtuwdm; +u32 dturd0; +u32 dturd1; +u32 dturd2; +u32 dturd3; +u32 dtulfsrwd; +u32 dtulfsrrd; +u32 dtueaf; +u32 dfitctrldelay; +u32 dfiodtcfg; +u32 dfiodtcfg1; +u32 dfiodtrankmap; +u32 dfitphywrdata; +u32 dfitphywrlat; +u32 reserved7[2 ]; +u32 dfitrddataen; +u32 dfitphyrdlat; +u32 reserved8[2 ]; +u32 dfitphyupdtype0; +u32 dfitphyupdtype1; +u32 dfitphyupdtype2; +u32 dfitphyupdtype3; +u32 dfitctrlupdmin; +u32 dfitctrlupdmax; +u32 dfitctrlupddly; +u32 reserved9; +u32 dfiupdcfg; +u32 dfitrefmski; +u32 dfitctrlupdi; +u32 reserved10[4 ]; +u32 dfitrcfg0; +u32 dfitrstat0; +u32 dfitrwrlvlen; +u32 dfitrrdlvlen; +u32 dfitrrdlvlgateen; +u32 dfiststat0; +u32 dfistcfg0; +u32 dfistcfg1; +u32 reserved11; +u32 dfitdramclken; +u32 dfitdramclkdis; +u32 dfistcfg2; +u32 dfistparclr; +u32 dfistparlog; +u32 reserved12[3 ]; +u32 dfilpcfg0; +u32 reserved13[3 ]; +u32 dfitrwrlvlresp0; +u32 dfitrwrlvlresp1; +u32 dfitrwrlvlresp2; +u32 dfitrrdlvlresp0; +u32 dfitrrdlvlresp1; +u32 dfitrrdlvlresp2; +u32 dfitrwrlvldelay0; +u32 dfitrwrlvldelay1; +u32 dfitrwrlvldelay2; +u32 dfitrrdlvldelay0; +u32 dfitrrdlvldelay1; +u32 dfitrrdlvldelay2; +u32 dfitrrdlvlgatedelay0; +u32 dfitrrdlvlgatedelay1; +u32 dfitrrdlvlgatedelay2; +u32 dfitrcmd; +u32 reserved14[46 ]; +u32 ipvr; +u32 iptr; +}; +check_member (rk3036_ddr_pctl, iptr,0x03fc ); + +struct rk3036_ddr_phy { +u32 ddrphy_reg1; +u32 ddrphy_reg3; +u32 ddrphy_reg2; +u32 reserve[11 ]; +u32 ddrphy_reg4a; +u32 ddrphy_reg4b; +u32 reserve1[5 ]; +u32 ddrphy_reg16; +u32 reserve2; +u32 ddrphy_reg18; +u32 ddrphy_reg19; +u32 reserve3; +u32 ddrphy_reg21; +u32 reserve4; +u32 ddrphy_reg22; +u32 reserve5[3 ]; +u32 ddrphy_reg25; +u32 ddrphy_reg26; +u32 ddrphy_reg27; +u32 ddrphy_reg28; +u32 reserve6[17 ]; +u32 ddrphy_reg6; +u32 ddrphy_reg7; +u32 reserve7; +u32 ddrphy_reg8; +u32 ddrphy_reg0e4; +u32 reserve8[11 ]; +u32 ddrphy_reg9; +u32 ddrphy_reg10; +u32 reserve9; +u32 ddrphy_reg11; +u32 ddrphy_reg124; +u32 reserve10[38 ]; +u32 ddrphy_reg29; +u32 reserve11[40 ]; +u32 ddrphy_reg264; +u32 reserve12[18 ]; +u32 ddrphy_reg2a; +u32 reserve13[4 ]; +u32 ddrphy_reg30; +u32 ddrphy_reg31; +u32 ddrphy_reg32; +u32 ddrphy_reg33; +u32 ddrphy_reg34; +u32 ddrphy_reg35; +u32 ddrphy_reg36; +u32 ddrphy_reg37; +u32 ddrphy_reg38; +u32 ddrphy_reg39; +u32 ddrphy_reg40; +u32 ddrphy_reg41; +u32 ddrphy_reg42; +u32 ddrphy_reg43; +u32 ddrphy_reg44; +u32 ddrphy_reg45; +u32 ddrphy_reg46; +u32 ddrphy_reg47; +u32 ddrphy_reg48; +u32 ddrphy_reg49; +u32 ddrphy_reg50; +u32 ddrphy_reg51; +u32 ddrphy_reg52; +u32 ddrphy_reg53; +u32 reserve14; +u32 ddrphy_reg54; +u32 ddrphy_reg55; +u32 ddrphy_reg56; +u32 ddrphy_reg57; +u32 ddrphy_reg58; +u32 ddrphy_reg59; +u32 ddrphy_reg5a; +u32 ddrphy_reg5b; +u32 ddrphy_reg5c; +u32 ddrphy_reg5d; +u32 ddrphy_reg5e; +u32 reserve15[28 ]; +u32 ddrphy_reg5f; +u32 reserve16[6 ]; +u32 ddrphy_reg60; +u32 ddrphy_reg61; +u32 ddrphy_reg62; +}; +check_member (rk3036_ddr_phy, ddrphy_reg62,0x03e8 ); + +struct rk3036_pctl_timing { +u32 togcnt1u; +u32 tinit; +u32 trsth; +u32 togcnt100n; +u32 trefi; +u32 tmrd; +u32 trfc; +u32 trp; +u32 trtw; +u32 tal; +u32 tcl; +u32 tcwl; +u32 tras; +u32 trc; +u32 trcd; +u32 trrd; +u32 trtp; +u32 twr; +u32 twtr; +u32 texsr; +u32 txp; +u32 txpdll; +u32 tzqcs; +u32 tzqcsi; +u32 tdqs; +u32 tcksre; +u32 tcksrx; +u32 tcke; +u32 tmod; +u32 trstl; +u32 tzqcl; +u32 tmrr; +u32 tckesr; +u32 tdpd; +}; + +struct rk3036_phy_timing { +u32 mr[4 ]; +u32 bl; +u32 cl_al; +}; + +typedef union { +u32 noc_timing; +struct { +u32 acttoact:6 ; +u32 rdtomiss:6 ; +u32 wrtomiss:6 ; +u32 burstlen:3 ; +u32 rdtowr:5 ; +u32 wrtord:5 ; +u32 bwratio:1 ; + }; +}rk3036_noc_timing ; + +struct rk3036_ddr_timing { +u32 freq; +struct rk3036_pctl_timing pctl_timing; +struct rk3036_phy_timing phy_timing; +rk3036_noc_timing noc_timing; +}; + +struct rk3036_service_sys { +u32 id_coreid; +u32 id_revisionid; +u32 ddrconf; +u32 ddrtiming; +u32 ddrmode; +u32 readlatency; +}; + +struct rk3036_ddr_config { + +/* +* 000: lpddr +* 001: ddr +* 010: ddr2 +* 011: ddr3 +* 100: lpddr2-s2 +* 101: lpddr2-s4 +* 110: lpddr3 +*/ +u32 ddr_type; +u32 rank; +u32 cs0_row; +u32 cs1_row; + +/* 2: 4bank, 3: 8bank */ +u32 bank; +u32 col; + +/* bw(0: 8bit, 1: 16bit, 2: 32bit) */ +u32 bw; +}; + +void sdram_init (void ); +void get_ddr_config (struct rk3036_ddr_config *config); +size_t sdram_size (void ); +#endif
arch/arm/mach-rockchip/rk3036/Makefile +2 -0
@@ -8,3 +8,5 @@ ifndef CONFIG_SPL_BUILD obj-y += reset_rk3036.o obj-y += syscon_rk3036.o endif + +obj-y += sdram_rk3036.o
arch/arm/mach-rockchip/rk3036/sdram_rk3036.c new file +732 -0
732 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 16/17 rockchip: rk3036: Add core Soc start-up code
In reply to Lin Huangrk3036 only 4K size SRAM for SPL, so only support timer, uart, sdram driver in SPL stage, when finish initial sdram, back to bootrom.
---
Changes in v1:
- clean copyright announcement
Changes in v2:
- support SPL
arch/arm/mach-rockchip/Kconfig | 10 +- arch/arm/mach-rockchip/Makefile | 4 +- arch/arm/mach-rockchip/board.c | 1 + arch/arm/mach-rockchip/rk3036-board-spl.c | 44 +++++++++ arch/arm/mach-rockchip/rk3036/Kconfig | 17 ++++ arch/arm/mach-rockchip/rk3036/Makefile | 1 + arch/arm/mach-rockchip/rk3036/save_boot_param.S | 34 +++++++ include/configs/rk3036_common.h | 120 ++++++++++++++++++++++++ 8 files changed, 229 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-rockchip/rk3036-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3036/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3036/save_boot_param.S create mode 100644 include/configs/rk3036_common.h
arch/arm/mach-rockchip/Kconfig +9 -1
@@ -9,6 +9,14 @@ config ROCKCHIP_RK3288 and video codec support. Peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO, I2S, UART,s, SPI, I2C and PWMs. +config ROCKCHIP_RK3036 + bool "Support Rockchip RK3036" + help + The Rockchip RK3036 is a ARM-based SoC with a dual-core Cortex-A7 + including NEON and GPU, Mali-400 graphics, several DDR3 options + and video codec support. Peripherals include Gigabit Ethernet, + USB2 host and OTG, SDIO, I2S, UART, SPI, I2C and PWMs. + config SYS_MALLOC_F default y
@@ -34,5 +42,5 @@ config ROCKCHIP_SERIAL default y source "arch/arm/mach-rockchip/rk3288/Kconfig" - +source "arch/arm/mach-rockchip/rk3036/Kconfig" endif
arch/arm/mach-rockchip/Makefile +3 -1
@@ -6,10 +6,12 @@ ifdef CONFIG_SPL_BUILD obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o +obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o else -obj-y += board.o +obj-$(CONFIG_ROCKCHIP_RK3288) += board.o endif obj-y += rk_timer.o obj-y += rk_early_print.o obj-$(CONFIG_$(SPL_)ROCKCHIP_COMMON) += common.o obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288/ +obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036/
arch/arm/mach-rockchip/board.c +1 -0
@@ -4,6 +4,7 @@* SPDX-License-Identifier: GPL-2.0+ */ +#include <asm/io.h> #include <common.h> #include <dm.h> #include <ram.h>
arch/arm/mach-rockchip/rk3036-board-spl.c new file +44 -0
44 lines not on this page · raw message
arch/arm/mach-rockchip/rk3036/Kconfig new file +17 -0
@@ -0,0 +1,17 @@ +if ROCKCHIP_RK3036 + +config TARGET_EVB_RK3036 + bool "EVB_RK3036" + +config SYS_SOC + default "rockchip" + +config SYS_MALLOC_F_LEN + default 0x400 + +config ROCKCHIP_COMMON + bool "Support rk common fuction" + +source "board/evb_rk3036/evb_rk3036/Kconfig" + +endif
arch/arm/mach-rockchip/rk3036/Makefile +1 -0
@@ -10,3 +10,4 @@ obj-y += syscon_rk3036.o endif obj-y += sdram_rk3036.o +obj-y += save_boot_param.o
arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +34 -0
@@ -0,0 +1,34 @@ +/* + * (C) Copyright 2015 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <linux/linkage.h> + +.globl SAVE_SP_ADDR +SAVE_SP_ADDR: + .word 0 + +/************************************************************************* + * + * void save_boot_params + * + * Save sp, lr, r1~r12 + * + *************************************************************************/ +ENTRY(save_boot_params) + push {r1-r12, lr} + ldr r0, =SAVE_SP_ADDR + str sp, [r0] + b save_boot_params_ret @ back to my caller +ENDPROC(save_boot_params) + + +.globl back_to_bootrom +ENTRY(back_to_bootrom) + ldr r0, =SAVE_SP_ADDR + ldr sp, [r0] + mov r0, #0 + pop {r1-r12, pc} +ENDPROC(back_to_bootrom)
include/configs/rk3036_common.h new file +120 -0
120 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 16/17 rockchip: rk3036: Add core Soc start-up code
Quoted 42 lines · Lin Huang
rk3036 only 4K size SRAM for SPL, so only support timer, uart, sdram driver in SPL stage, when finish initial sdram, back to bootrom.
Signed-off-by Lin Huang <[email protected]>?
?arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +13
-0@@ -0,0 +1,34 @@ +/* + * (C) Copyright 2015 Google, Inc + * + * SPDX-License-Identifier:?????GPL-2.0+ + */ + +#include <linux/linkage.h> + +.globl SAVE_SP_ADDR +SAVE_SP_ADDR: + .word 0 + +/*************************************************************************
+ *
+ * voidsave_boot_params
+ *
+ * Save sp, lr, r1~r12
+ *
+
*********************************************************************
****/arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +5
-0+ENTRY(save_boot_params) + push {r1-r12, lr} + ldr r0, =SAVE_SP_ADDR + str sp, [r0] + b save_boot_params_ret @ back to mycaller
arch/arm/mach-rockchip/rk3036/save_boot_param.S line 34
Quoted 10 lines
arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +10
-0+ENDPROC(save_boot_params) + + +.globl back_to_bootrom +ENTRY(back_to_bootrom) + ldr r0, =SAVE_SP_ADDR + ldr sp, [r0] + mov r0, #0 + pop {r1-r12, pc} +ENDPROC(back_to_bootrom)
Is this way of going back to be bootrom generic for other Rockchip SOCs as well??
Specifically for RK3288 in maskrom mode we can currently load the? u-boot SPL, but not the main loader. If we could use this method of going to the bootrom on that board that should be a nice way forward.
Quoted 13 lines
include/configs/rk3036_common.h new file +5
-0@@ -0,0 +1,120 @@ +/* +* (C) Copyright 2015 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier:?????GPL-2.0+ +*/ ?
include/configs/rk3036_common.h line 68
Quoted 3 lines
include/configs/rk3036_common.h new file +3
-0+/* RAW SD card / eMMC locations. */ +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 256 +#define CONFIG_SYS_SPI_U_BOOT_OFFS (128 << 10)
I don't think you need to define these if you're having the main u-boot image loaded by your bootrom rather then SPL directly.
include/configs/rk3036_common.h line 72
Quoted 3 lines
include/configs/rk3036_common.h new file +3
-0+/* FAT sd card locations. */ +#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 +#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
ditto
Quoted 20 lines
include/configs/rk3036_common.h new file +19
-0+/* #define CONFIG_SPL_PINCTRL_SUPPORT +#define CONFIG_SPL_GPIO_SUPPORT +#define CONFIG_SPL_RAM_SUPPORT +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT */ + +#define CONFIG_CMD_CACHE +#define CONFIG_CMD_TIME + +#define CONFIG_SYS_SDRAM_BASE 0x60000000 +#define CONFIG_NR_DRAM_BANKS 1 +#define SDRAM_BANK_SIZE (512UL << 20UL) + +#define CONFIG_SPI_FLASH +#define CONFIG_SPI +#define CONFIG_CMD_SF +#define CONFIG_CMD_SPI +#define CONFIG_SPI_FLASH_GIGADEVICE +#define CONFIG_SF_DEFAULT_SPEED 20000000 +#define CONFIG_CMD_I2C
include/configs/rk3036_common.h line 103
Quoted 10 lines
include/configs/rk3036_common.h new file +10
-0+ +#ifndef CONFIG_SPL_BUILD +#include <config_distro_defaults.h> + +#define ENV_MEM_LAYOUT_SETTINGS \ + "scriptaddr=0x00000000\0" \ + "pxefile_addr_r=0x00100000\0" \ + "fdt_addr_r=0x01f00000\0" \ + "kernel_addr_r=0x02000000\0" \ + "ramdisk_addr_r=0x04000000\0"
I suspect these offset don't make sense for this board given your SYS_SDRAM_BASE is?0x60000000
Quoted 10 lines
include/configs/rk3036_common.h new file +8
-0+/* First try to boot from SD (index 0), then eMMC (index 1 */ +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) + +#include <config_distro_bootcmd.h> + +/* Linux fails to load the fdt if it's loaded above 512M on a Rock 2 board, so
+ * limit the fdt reallocation to that */
You probably want to change the comment here :)
include/configs/rk3036_common.h line 115
Quoted 2 lines
include/configs/rk3036_common.h new file +2
-0+#define CONFIG_EXTRA_ENV_SETTINGS \ + "fdt_high=0x1fffffff\0" \
Hopefully the fdt_high isn't needed on 3036? (It's hopefully temporary as well on 3288 until someone figures out what's wrong.
Quoted 5 lines
include/configs/rk3036_common.h new file +5
-0+ENV_MEM_LAYOUT_SETTINGS \ + BOOTENV +#endif + +#endif
Signature · 2 lines
Sjoerd Simons Collabora Ltd.
PATCH v2 16/17 rockchip: rk3036: Add core Soc start-up code
Hi Sjoerd
2015-11-06 17:11 GMT+08:00 Sjoerd Simons <[email protected]>:
Quoted 48 lines · Lin Huang
Quoted 47 lines
rk3036 only 4K size SRAM for SPL, so only support timer, uart, sdram driver in SPL stage, when finish initial sdram, back to bootrom.
Signed-off-by Lin Huang <[email protected]>arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +13
-0@@ -0,0 +1,34 @@ +/* + * (C) Copyright 2015 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <linux/linkage.h> + +.globl SAVE_SP_ADDR +SAVE_SP_ADDR: + .word 0 + +/*************************************************************************
+ *
+ * voidsave_boot_params
+ *
+ * Save sp, lr, r1~r12
+ *
+
*********************************************************************
****/arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +5
-0+ENTRY(save_boot_params) + push {r1-r12, lr} + ldr r0, =SAVE_SP_ADDR + str sp, [r0] + b save_boot_params_ret @ back to mycaller
arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +5
-0+ENDPROC(save_boot_params) + + +.globl back_to_bootrom +ENTRY(back_to_bootrom)
Quoted 9 lines
arch/arm/mach-rockchip/rk3036/save_boot_param.S line 34
Quoted 5 lines
arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +5
-0+ ldr r0, =SAVE_SP_ADDR + ldr sp, [r0] + mov r0, #0 + pop {r1-r12, pc} +ENDPROC(back_to_bootrom)Is this way of going back to be bootrom generic for other Rockchip SOCs as well?
Yes
Quoted 5 lines
Specifically for RK3288 in maskrom mode we can currently load the u-boot SPL, but not the main loader. If we could use this method of going to the bootrom on that board that should be a nice way forward.
Agree.
Simon.What do you think?
Quoted 93 lines
Quoted 9 lines
include/configs/rk3036_common.h new file +0
-0include/configs/rk3036_common.h line 68
Quoted 9 lines
include/configs/rk3036_common.h new file +8
-0@@ -0,0 +1,120 @@ +/* +* (C) Copyright 2015 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ +/* RAW SD card / eMMC locations. */ +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 256 +#define CONFIG_SYS_SPI_U_BOOT_OFFS (128 << 10)I don't think you need to define these if you're having the main u-boot image loaded by your bootrom rather then SPL directly.
include/configs/rk3036_common.h line 72
Quoted 3 lines
include/configs/rk3036_common.h new file +3
-0+/* FAT sd card locations. */ +#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 +#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"ditto
Quoted 20 lines
include/configs/rk3036_common.h new file +19
-0+/* #define CONFIG_SPL_PINCTRL_SUPPORT +#define CONFIG_SPL_GPIO_SUPPORT +#define CONFIG_SPL_RAM_SUPPORT +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT */ + +#define CONFIG_CMD_CACHE +#define CONFIG_CMD_TIME + +#define CONFIG_SYS_SDRAM_BASE 0x60000000 +#define CONFIG_NR_DRAM_BANKS 1 +#define SDRAM_BANK_SIZE (512UL << 20UL) + +#define CONFIG_SPI_FLASH +#define CONFIG_SPI +#define CONFIG_CMD_SF +#define CONFIG_CMD_SPI +#define CONFIG_SPI_FLASH_GIGADEVICE +#define CONFIG_SF_DEFAULT_SPEED 20000000 +#define CONFIG_CMD_I2C include/configs/rk3036_common.h line 103
Quoted 10 lines
include/configs/rk3036_common.h new file +10
-0+ +#ifndef CONFIG_SPL_BUILD +#include <config_distro_defaults.h> + +#define ENV_MEM_LAYOUT_SETTINGS \ + "scriptaddr=0x00000000\0" \ + "pxefile_addr_r=0x00100000\0" \ + "fdt_addr_r=0x01f00000\0" \ + "kernel_addr_r=0x02000000\0" \ + "ramdisk_addr_r=0x04000000\0"I suspect these offset don't make sense for this board given your
SYS_SDRAM_BASEis0x60000000Quoted 10 lines
include/configs/rk3036_common.h new file +8
-0+/* First try to boot from SD (index 0), then eMMC (index 1 */ +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) + +#include <config_distro_bootcmd.h> + +/* Linux fails to load the fdt if it's loaded above 512M on a Rock 2 board, so
+ * limit the fdt reallocation to that */You probably want to change the comment here :)
include/configs/rk3036_common.h line 115
Quoted 2 lines
include/configs/rk3036_common.h new file +2
-0+#define CONFIG_EXTRA_ENV_SETTINGS \ + "fdt_high=0x1fffffff\0" \Hopefully the
fdt_highisn't needed on 3036? (It's hopefully temporary as well on 3288 until someone figures out what's wrong.include/configs/rk3036_common.h line 120
Quoted 5 lines
include/configs/rk3036_common.h new file +5
-0+ENV_MEM_LAYOUT_SETTINGS \ + BOOTENV +#endif + +#endif --
Sjoerd Simons
Collabora Ltd.
Signature · 1 line
Eddie
PATCH v2 16/17 rockchip: rk3036: Add core Soc start-up code
In reply to Sjoerd SimonsHi
Quoted 74 lines · Sjoerd Simons
Quoted 42 lines · Lin Huang
rk3036 only 4K size SRAM for SPL, so only support timer, uart, sdram driver in SPL stage, when finish initial sdram, back to bootrom.
Signed-off-by Lin Huang <[email protected]>arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +13
-0@@ -0,0 +1,34 @@ +/* + * (C) Copyright 2015 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <linux/linkage.h> + +.globl SAVE_SP_ADDR +SAVE_SP_ADDR: + .word 0 + +/*************************************************************************
+ *
+ * voidsave_boot_params
+ *
+ * Save sp, lr, r1~r12
+ *
+
*********************************************************************
****/arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +5
-0+ENTRY(save_boot_params) + push {r1-r12, lr} + ldr r0, =SAVE_SP_ADDR + str sp, [r0] + b save_boot_params_ret @ back to mycaller
arch/arm/mach-rockchip/rk3036/save_boot_param.S line 34
Quoted 10 lines
arch/arm/mach-rockchip/rk3036/save_boot_param.S new file +10
-0+ENDPROC(save_boot_params) + + +.globl back_to_bootrom +ENTRY(back_to_bootrom) + ldr r0, =SAVE_SP_ADDR + ldr sp, [r0] + mov r0, #0 + pop {r1-r12, pc} +ENDPROC(back_to_bootrom)Is this way of going back to be bootrom generic for other Rockchip SOCs as well?
Specifically for RK3288 in maskrom mode we can currently load the u-boot SPL, but not the main loader. If we could use this method of going to the bootrom on that board that should be a nice way forward.
Quoted 13 lines
include/configs/rk3036_common.h new file +5
-0@@ -0,0 +1,120 @@ +/* +* (C) Copyright 2015 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/
Quoted 5 lines
include/configs/rk3036_common.h line 68
Quoted 3 lines
include/configs/rk3036_common.h new file +3
-0+/* RAW SD card / eMMC locations. */ +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 256 +#define CONFIG_SYS_SPI_U_BOOT_OFFS (128 << 10)I don't think you need to define these if you're having the main u-boot image loaded by your bootrom rather then SPL directly.
yes, you are right, i just sended v3, will correct it in v4, thank you.
Quoted 28 lines
include/configs/rk3036_common.h line 72
Quoted 3 lines
include/configs/rk3036_common.h new file +3
-0+/* FAT sd card locations. */ +#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 +#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"ditto
Quoted 23 lines
include/configs/rk3036_common.h new file +23
-0+/* #define CONFIG_SPL_PINCTRL_SUPPORT +#define CONFIG_SPL_GPIO_SUPPORT +#define CONFIG_SPL_RAM_SUPPORT +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT */ + +#define CONFIG_CMD_CACHE +#define CONFIG_CMD_TIME + +#define CONFIG_SYS_SDRAM_BASE 0x60000000 +#define CONFIG_NR_DRAM_BANKS 1 +#define SDRAM_BANK_SIZE (512UL << 20UL) + +#define CONFIG_SPI_FLASH +#define CONFIG_SPI +#define CONFIG_CMD_SF +#define CONFIG_CMD_SPI +#define CONFIG_SPI_FLASH_GIGADEVICE +#define CONFIG_SF_DEFAULT_SPEED 20000000 +#define CONFIG_CMD_I2C + +#ifndef CONFIG_SPL_BUILD +#include <config_distro_defaults.h> +
Quoted 8 lines
include/configs/rk3036_common.h line 103
Quoted 6 lines
include/configs/rk3036_common.h new file +6
-0+#define ENV_MEM_LAYOUT_SETTINGS \ + "scriptaddr=0x00000000\0" \ + "pxefile_addr_r=0x00100000\0" \ + "fdt_addr_r=0x01f00000\0" \ + "kernel_addr_r=0x02000000\0" \ + "ramdisk_addr_r=0x04000000\0"I suspect these offset don't make sense for this board given your
SYS_SDRAM_BASEis0x60000000
Have been correct in v3 patch.
Quoted 12 lines
Quoted 10 lines
include/configs/rk3036_common.h new file +8
-0+/* First try to boot from SD (index 0), then eMMC (index 1 */ +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) + +#include <config_distro_bootcmd.h> + +/* Linux fails to load the fdt if it's loaded above 512M on a Rock 2 board, so
+ * limit the fdt reallocation to that */You probably want to change the comment here :)
yes, will modify it in v4
Quoted 4 lines
include/configs/rk3036_common.h line 115
Quoted 2 lines
include/configs/rk3036_common.h new file +2
-0+#define CONFIG_EXTRA_ENV_SETTINGS \ + "fdt_high=0x1fffffff\0" \Hopefully the
fdt_highisn't needed on 3036? (It's hopefully temporary as well on 3288 until someone figures out what's wrong.
sorry, i am not very clear why 3288 need it.
Quoted 5 lines
Quoted 5 lines
include/configs/rk3036_common.h new file +5
-0+ENV_MEM_LAYOUT_SETTINGS \ + BOOTENV +#endif + +#endif
Signature · 1 line
Lin Huang
PATCH v2 17/17 rockchip: Add basic support for evb-rk3036 board
In reply to Lin HuangThis add some basic files required to allow the board to dispaly serial message and can run command(mmc info etc)
---
Changes in v1:
- clean copyright announcement
Changes in v2:
- get sdram info from evb_rk3036.c
arch/arm/dts/Makefile | 3 +- arch/arm/dts/rk3036-sdk.dts | 46 ++++++++++++++++++++++++++++++ board/evb_rk3036/evb_rk3036/Kconfig | 15 ++++++++++ board/evb_rk3036/evb_rk3036/MAINTAINERS | 0 board/evb_rk3036/evb_rk3036/Makefile | 7 +++++ board/evb_rk3036/evb_rk3036/evb_rk3036.c | 48 ++++++++++++++++++++++++++++++++ configs/evb-rk3036_defconfig | 29 +++++++++++++++++++ include/configs/evb_rk3036.h | 12 ++++++++ 8 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/rk3036-sdk.dts create mode 100644 board/evb_rk3036/evb_rk3036/Kconfig create mode 100644 board/evb_rk3036/evb_rk3036/MAINTAINERS create mode 100644 board/evb_rk3036/evb_rk3036/Makefile create mode 100644 board/evb_rk3036/evb_rk3036/evb_rk3036.c create mode 100644 configs/evb-rk3036_defconfig create mode 100644 include/configs/evb_rk3036.h
arch/arm/dts/Makefile +2 -1
@@ -17,7 +17,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ exynos5422-odroidxu3.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += \ rk3288-firefly.dtb \ - rk3288-jerry.dtb + rk3288-jerry.dtb \ + rk3036-sdk.dtb dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ tegra20-paz00.dtb \
arch/arm/dts/rk3036-sdk.dts new file +46 -0
46 lines not on this page · raw message
board/evb_rk3036/evb_rk3036/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +if TARGET_EVB_RK3036 + +config SYS_BOARD + default "evb_rk3036" + +config SYS_VENDOR + default "evb_rk3036" + +config SYS_CONFIG_NAME + default "evb_rk3036" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + +endif
board/evb_rk3036/evb_rk3036/MAINTAINERS new file +0 -0
board/evb_rk3036/evb_rk3036/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# (C) Copyright 2015 Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += evb_rk3036.o
board/evb_rk3036/evb_rk3036/evb_rk3036.c new file +48 -0
48 lines not on this page · raw message
configs/evb-rk3036_defconfig new file +29 -0
@@ -0,0 +1,29 @@ +CONFIG_ARM=y +CONFIG_ARCH_ROCKCHIP=y +CONFIG_ROCKCHIP_RK3036=y +CONFIG_TARGET_EVB_RK3036=y +CONFIG_DEFAULT_DEVICE_TREE="rk3036-sdk" +CONFIG_SPL_STACK_R=y +CONFIG_SPL_STACK_R_ADDR=0x80000 +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_PMIC=y +CONFIG_CMD_REGULATOR=y +CONFIG_CLK=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y +CONFIG_RESET=y +CONFIG_LED=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_BASE=0x20068000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_SYS_I2C_ROCKCHIP=y +CONFIG_PINCTRL=y +CONFIG_ROCKCHIP_3036_PINCTRL=y +CONFIG_ROCKCHIP_GPIO=y +CONFIG_RAM=y +CONFIG_DM_MMC=y +CONFIG_USE_PRIVATE_LIBGCC=y +CONFIG_CMD_DHRYSTONE=y +CONFIG_ERRNO_STR=y
include/configs/evb_rk3036.h new file +12 -0
@@ -0,0 +1,12 @@ +/* +* (C) Copyright 2015 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include <configs/rk3036_common.h> + +#endif
Signature · 1 line
1.9.1