Skip to contentSkip to conversation

ARM: rockchip: Add basic RK3288 support

PATCH In review Wadim Egorov 2 participants 9 messages Aug 24, 2016 – Aug 26, 2016

Subsystems (7)
lore
Share & tools
lore
#4 lore raw

PATCH v2 5/8 mci: dw_mmc: Add RK3288 compatible string

In reply to Wadim Egorov

The SDHC used in the RK2928 and RK3288 are compatible with each other. Add a compatible string for RK3288's SDHC.

---
 drivers/mci/dw_mmc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mci/dw_mmc.c +2 -0
index 0e004ab..27c36a6 100644
@@ -753,6 +753,8 @@ static __maybe_unused struct of_device_id dw_mmc_compatible[] = {
 	}, {
 		.compatible = "rockchip,rk2928-dw-mshc",
 	}, {
+		.compatible = "rockchip,rk3288-dw-mshc",
+	}, {
 		/* sentinel */
 	}
 };
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH v2 3/8 ARM: rockchip: Add early debug support for RK3288

In reply to Wadim Egorov

---
Changes since v1:
- use CONFIG_BAUDRATE instead of hard coded value
- use IOMEM macros

---
 arch/arm/mach-rockchip/include/mach/debug_ll.h | 73 +++++++++++++++-----------
 common/Kconfig                                 |  6 +--
 2 files changed, 46 insertions(+), 33 deletions(-)
arch/arm/mach-rockchip/include/mach/debug_ll.h +43 -30
index c666b99..9fde297 100644
@@ -1,25 +1,31 @@
 #ifndef __MACH_DEBUG_LL_H__
 #define __MACH_DEBUG_LL_H__
 
+#include <common.h>
 #include <io.h>
+#include <mach/rk3188-regs.h>
+#include <mach/rk3288-regs.h>
+
+#ifdef CONFIG_ARCH_RK3188
+
+#define UART_CLOCK		100000000
+#define RK_DEBUG_SOC		RK3188
+#define serial_out(a, v)	writeb(v, a)
+#define serial_in(a)		readb(a)
+
+#elif defined CONFIG_ARCH_RK3288
+
+#define UART_CLOCK		24000000
+#define RK_DEBUG_SOC		RK3288
+#define serial_out(a, v)	writel(v, a)
+#define serial_in(a)		readl(a)
 
-#if CONFIG_DEBUG_ROCKCHIP_UART_PORT == 0
-#define UART_BASE	0x10124000
-#endif
-#if CONFIG_DEBUG_ROCKCHIP_UART_PORT == 1
-#define UART_BASE	0x10126000
-#endif
-#if CONFIG_DEBUG_ROCKCHIP_UART_PORT == 2
-#define UART_BASE	0x20064000
-#endif
-#if CONFIG_DEBUG_ROCKCHIP_UART_PORT == 3
-#define UART_BASE	0x20068000
 #endif
 
-#define LSR_THRE	0x20	/* Xmit holding register empty */
-#define LSR		(5 << 2)
-#define THR		(0 << 2)
+#define __RK_UART_BASE(soc, num) soc##_UART##num##_BASE
+#define RK_UART_BASE(soc, num) __RK_UART_BASE(soc, num)
 
+#define LSR_THRE	0x20	/* Xmit holding register empty */
 #define LCR_BKSE	0x80	/* Bank select enable */
 #define LSR		(5 << 2)
 #define THR		(0 << 2)
@@ -33,28 +39,35 @@
 
 static inline void INIT_LL(void)
 {
-	unsigned int clk = 100000000;
-	unsigned int divisor = clk / 16 / 115200;
-
-	writeb(0x00, UART_BASE + LCR);
-	writeb(0x00, UART_BASE + IER);
-	writeb(0x07, UART_BASE + MDR);
-	writeb(LCR_BKSE, UART_BASE + LCR);
-	writeb(divisor & 0xff, UART_BASE + DLL);
-	writeb(divisor >> 8, UART_BASE + DLM);
-	writeb(0x03, UART_BASE + LCR);
-	writeb(0x03, UART_BASE + MCR);
-	writeb(0x07, UART_BASE + FCR);
-	writeb(0x00, UART_BASE + MDR);
+	void __iomem *base = IOMEM(RK_UART_BASE(RK_DEBUG_SOC,
+		CONFIG_DEBUG_ROCKCHIP_UART_PORT));
+	unsigned int divisor = DIV_ROUND_CLOSEST(UART_CLOCK,
+		16 * CONFIG_BAUDRATE);
+
+	serial_out(base + LCR, 0x00);
+	serial_out(base + IER, 0x00);
+	serial_out(base + MDR, 0x07);
+	serial_out(base + LCR, LCR_BKSE);
+	serial_out(base + DLL, divisor & 0xff);
+	serial_out(base + DLM, divisor >> 8);
+	serial_out(base + LCR, 0x03);
+	serial_out(base + MCR, 0x03);
+	serial_out(base + FCR, 0x07);
+	serial_out(base + MDR, 0x00);
 }
 
 static inline void PUTC_LL(char c)
 {
+	void __iomem *base = IOMEM(RK_UART_BASE(RK_DEBUG_SOC,
+		CONFIG_DEBUG_ROCKCHIP_UART_PORT));
+
 	/* Wait until there is space in the FIFO */
-	while ((readb(UART_BASE + LSR) & LSR_THRE) == 0);
+	while ((serial_in(base + LSR) & LSR_THRE) == 0)
+		;
 	/* Send the character */
-	writeb(c, UART_BASE + THR);
+	serial_out(base + THR, c);
 	/* Wait to make sure it hits the line, in case we die too soon. */
-	while ((readb(UART_BASE + LSR) & LSR_THRE) == 0);
+	while ((serial_in(base + LSR) & LSR_THRE) == 0)
+		;
 }
 #endif
common/Kconfig +3 -3
index 679954e..7a51bf0 100644
@@ -1081,11 +1081,11 @@ config DEBUG_AM33XX_UART
 	  on AM33XX.
 
 config DEBUG_ROCKCHIP_UART
-	bool "RK31xx Debug UART"
+	bool "RK3xxx Debug UART"
 	depends on ARCH_ROCKCHIP
 	help
 	  Say Y here if you want kernel low-level debugging support
-	  on RK31XX.
+	  on RK3XXX.
 
 endchoice
 
@@ -1120,7 +1120,7 @@ config DEBUG_OMAP_UART_PORT
 	  AM33XX: 0 - 2
 
 config DEBUG_ROCKCHIP_UART_PORT
-	int "RK31xx UART debug port" if DEBUG_ROCKCHIP_UART
+	int "RK3xxx UART debug port" if DEBUG_ROCKCHIP_UART
 	default 2
 	depends on ARCH_ROCKCHIP
 	help
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH v2 2/8 clocksource: Add rk3288 timer driver

In reply to Wadim Egorov

This driver comes from the u-boot (v2016.01).

---
Changes since v1:
- moved rk_timer to drivers/clocksource
- rk_timer now binds against a DT node

---
 arch/arm/mach-rockchip/Kconfig              |  5 ++
 arch/arm/mach-rockchip/include/mach/timer.h | 19 ++++++++
 drivers/clocksource/Kconfig                 |  4 ++
 drivers/clocksource/Makefile                |  1 +
 drivers/clocksource/rk_timer.c              | 73 +++++++++++++++++++++++++++++
 5 files changed, 102 insertions(+)
 create mode 100644 arch/arm/mach-rockchip/include/mach/timer.h
 create mode 100644 drivers/clocksource/rk_timer.c
arch/arm/mach-rockchip/Kconfig +5 -0
index e027fae..71fcbe7 100644
@@ -7,6 +7,10 @@ config ARCH_TEXT_BASE
 	default 0x68000000 if ARCH_RK3188
 	default 0x0 if ARCH_RK3288
 
+config RK_TIMER
+	hex
+	default 1
+
 choice
 	prompt "Select Rockchip SoC"
 
@@ -15,6 +19,7 @@ config ARCH_RK3188
 
 config ARCH_RK3288
 	bool "Rockchip RK3288 SoCs"
+	select CLOCKSOURCE_ROCKCHIP
 endchoice
 
 comment "select Rockchip boards:"
arch/arm/mach-rockchip/include/mach/timer.h new file +19 -0
new file mode 100644
index 0000000..e6ed0e4
@@ -0,0 +1,19 @@
+/*
+ * (C) Copyright 2015 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#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;
+};
+
+#endif
drivers/clocksource/Kconfig +4 -0
index 3fb09fb..f1ab554 100644
@@ -49,3 +49,7 @@ config CLOCKSOURCE_ORION
 config CLOCKSOURCE_UEMD
 	bool
 	depends on ARCH_UEMD
+
+config CLOCKSOURCE_ROCKCHIP
+	bool
+	depends on ARCH_ROCKCHIP
drivers/clocksource/Makefile +1 -0
index 4eb1656..39982ff 100644
@@ -7,3 +7,4 @@ obj-$(CONFIG_CLOCKSOURCE_MVEBU)   += mvebu.o
 obj-$(CONFIG_CLOCKSOURCE_NOMADIK) += nomadik.o
 obj-$(CONFIG_CLOCKSOURCE_ORION)   += orion.o
 obj-$(CONFIG_CLOCKSOURCE_UEMD)    += uemd.o
+obj-$(CONFIG_CLOCKSOURCE_ROCKCHIP)+= rk_timer.o
drivers/clocksource/rk_timer.c new file +73 -0

73 lines not on this page · raw message

Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#0 lore raw

PATCH v2 1/8 ARM: rockchip: Add basic RK3288 support

The RK3288 SoC is a low power, high performance processor for mobile phones, personal mobile internet devices and other digital multimedia applications. It has an integrated quad-core cortex-A17 with separate NEON coprocessor.

Prepare mach-rockchip infrastructure for Rockchip RK3288 support. Let's seperate the RK3188 and RK3288 SoCs. Later we will have two different configs.

---
 arch/arm/boards/radxa-rock/board.c                 |   2 +-
 .../{rockchip_defconfig => rk3188_defconfig}       |   1 +
 arch/arm/mach-rockchip/Kconfig                     |  20 +-
 arch/arm/mach-rockchip/Makefile                    |   3 +-
 arch/arm/mach-rockchip/include/mach/cru_rk3288.h   | 184 +++++
 arch/arm/mach-rockchip/include/mach/grf_rk3288.h   | 768 +++++++++++++++++++++
 arch/arm/mach-rockchip/include/mach/hardware.h     |  18 +
 .../mach/{rockchip-regs.h => rk3188-regs.h}        |  12 +-
 arch/arm/mach-rockchip/include/mach/rk3288-regs.h  |  28 +
 arch/arm/mach-rockchip/{core.c => rk3188.c}        |   2 +-
 arch/arm/mach-rockchip/rk3288.c                    |  92 +++
 11 files changed, 1121 insertions(+), 9 deletions(-)
 rename arch/arm/configs/{rockchip_defconfig => rk3188_defconfig} (99%)
 create mode 100644 arch/arm/mach-rockchip/include/mach/cru_rk3288.h
 create mode 100644 arch/arm/mach-rockchip/include/mach/grf_rk3288.h
 create mode 100644 arch/arm/mach-rockchip/include/mach/hardware.h
 rename arch/arm/mach-rockchip/include/mach/{rockchip-regs.h => rk3188-regs.h} (72%)
 create mode 100644 arch/arm/mach-rockchip/include/mach/rk3288-regs.h
 rename arch/arm/mach-rockchip/{core.c => rk3188.c} (96%)
 create mode 100644 arch/arm/mach-rockchip/rk3288.c
arch/arm/boards/radxa-rock/board.c +1 -1
index ec053f9..d45e8a9 100644
@@ -16,7 +16,7 @@
 #include <io.h>
 #include <i2c/i2c.h>
 #include <i2c/i2c-gpio.h>
-#include <mach/rockchip-regs.h>
+#include <mach/rk3188-regs.h>
 #include <mfd/act8846.h>
 #include <asm/armlinux.h>
 
arch/arm/configs/rk3188_defconfig renamed from arch/arm/configs/rockchip_defconfig +1 -0
similarity index 99%
rename from arch/arm/configs/rockchip_defconfig
rename to arch/arm/configs/rk3188_defconfig
index c9bf874..1b6d4ff 100644
@@ -1,4 +1,5 @@
 CONFIG_ARCH_ROCKCHIP=y
+CONFIG_ARCH_RK3188=y
 CONFIG_CACHE_L2X0=y
 CONFIG_MACH_RADXA_ROCK=y
 CONFIG_THUMB2_BAREBOX=y
arch/arm/mach-rockchip/Kconfig +17 -3
index ea4361d..e027fae 100644
@@ -1,14 +1,28 @@
-if ARCH_ROCKCHIP
+
+menu "Rockchip Features"
+	depends on ARCH_ROCKCHIP
 
 config ARCH_TEXT_BASE
 	hex
-	default 0x68000000
+	default 0x68000000 if ARCH_RK3188
+	default 0x0 if ARCH_RK3288
+
+choice
+	prompt "Select Rockchip SoC"
+
+config ARCH_RK3188
+	bool "Rockchip RK3188 SoCs"
+
+config ARCH_RK3288
+	bool "Rockchip RK3288 SoCs"
+endchoice
 
 comment "select Rockchip boards:"
 
 config MACH_RADXA_ROCK
+	depends on ARCH_RK3188
 	select I2C
 	select MFD_ACT8846
 	bool "Radxa rock board"
 
-endif
+endmenu
arch/arm/mach-rockchip/Makefile +2 -1
index 820eb10..4ca7f17 100644
@@ -1 +1,2 @@
-obj-y += core.o
+obj-$(CONFIG_ARCH_RK3188) += rk3188.o
+obj-$(CONFIG_ARCH_RK3288) += rk3288.o
arch/arm/mach-rockchip/include/mach/cru_rk3288.h new file +184 -0

184 lines not on this page · raw message

arch/arm/mach-rockchip/include/mach/grf_rk3288.h new file +768 -0

768 lines not on this page · raw message

arch/arm/mach-rockchip/include/mach/hardware.h new file +18 -0
new file mode 100644
index 0000000..b0afd1f
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2015 Google, Inc
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _ASM_ARCH_HARDWARE_H
+#define _ASM_ARCH_HARDWARE_H
+
+#define RK_CLRSETBITS(clr, set)		((((clr) | (set)) << 16) | set)
+#define RK_SETBITS(set)			RK_CLRSETBITS(0, set)
+#define RK_CLRBITS(clr)			RK_CLRSETBITS(clr, 0)
+
+#define rk_clrsetreg(addr, clr, set)	writel((clr) << 16 | (set), addr)
+#define rk_clrreg(addr, clr)		writel((clr) << 16, addr)
+#define rk_setreg(addr, set)		writel(set, addr)
+
+#endif
arch/arm/mach-rockchip/include/mach/rk3188-regs.h renamed from arch/arm/mach-rockchip/include/mach/rockchip-regs.h +9 -3
similarity index 72%
rename from arch/arm/mach-rockchip/include/mach/rockchip-regs.h
rename to arch/arm/mach-rockchip/include/mach/rk3188-regs.h
index a6a1c64..f147fe2 100644
@@ -11,8 +11,8 @@
  * GNU General Public License for more details.
  */
 
-#ifndef __MACH_ROCKCHIP_REGS_H
-#define __MACH_ROCKCHIP_REGS_H
+#ifndef __MACH_RK3188_REGS_H
+#define __MACH_RK3188_REGS_H
 
 #define RK_CRU_BASE		0x20000000
 #define RK_GRF_BASE		0x20008000
@@ -22,4 +22,10 @@
 
 #define RK_SOC_CON0_REMAP	(1 << 12)
 
-#endif /* __MACH_ROCKCHIP_REGS_H */
+/* UART */
+#define RK3188_UART0_BASE	0x10124000
+#define RK3188_UART1_BASE	0x10126000
+#define RK3188_UART2_BASE	0x20064000
+#define RK3188_UART3_BASE	0x20068000
+
+#endif /* __MACH_RK3188_REGS_H */
arch/arm/mach-rockchip/include/mach/rk3288-regs.h new file +28 -0
new file mode 100644
index 0000000..a83a3a8
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2016 PHYTEC Messtechnik GmbH,
+ * Author: Wadim Egorov <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __MACH_RK3288_REGS_H
+#define __MACH_RK3288_REGS_H
+
+#define RK3288_CRU_BASE		0xff760000
+#define RK3288_GRF_BASE		0xff770000
+
+/* UART */
+#define RK3288_UART0_BASE	0xff180000
+#define RK3288_UART1_BASE	0xff190000
+#define RK3288_UART2_BASE	0xff690000
+#define RK3288_UART3_BASE	0xff1b0000
+#define RK3288_UART4_BASE	0xff1c0000
+
+#endif /* __MACH_RK3288_REGS_H */
arch/arm/mach-rockchip/rk3188.c renamed from arch/arm/mach-rockchip/core.c +1 -1
similarity index 96%
rename from arch/arm/mach-rockchip/core.c
rename to arch/arm/mach-rockchip/rk3188.c
index 2428fee..e7cbf36 100644
@@ -15,7 +15,7 @@
 #include <common.h>
 #include <init.h>
 #include <restart.h>
-#include <mach/rockchip-regs.h>
+#include <mach/rk3188-regs.h>
 
 static void __noreturn rockchip_restart_soc(struct restart_handler *rst)
 {
arch/arm/mach-rockchip/rk3288.c new file +92 -0

92 lines not on this page · raw message

Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH v2 4/8 clk: Add RK3288 clock driver

Add clk driver for RK3288 SoC. This driver comes from the Linux kernel. Based on kernel v4.4

---
 drivers/clk/rockchip/Makefile     |   4 +-
 drivers/clk/rockchip/clk-rk3288.c | 836 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 839 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/rockchip/clk-rk3288.c
drivers/clk/rockchip/Makefile +3 -1
index 865542a..e43f573 100644
@@ -1 +1,3 @@
-obj-y += clk-cpu.o clk-pll.o clk-rk3188.o clk.o
+obj-y += clk-cpu.o clk-pll.o clk.o
+obj-$(CONFIG_ARCH_RK3188) += clk-rk3188.o
+obj-$(CONFIG_ARCH_RK3288) += clk-rk3288.o
drivers/clk/rockchip/clk-rk3288.c new file +836 -0

836 lines not on this page · raw message

Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

PATCH v2 7/8 configs: Add RK3288 defconfig

In reply to Wadim Egorov
---
 arch/arm/configs/rk3288_defconfig | 104 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 arch/arm/configs/rk3288_defconfig
arch/arm/configs/rk3288_defconfig new file +104 -0
new file mode 100644
index 0000000..f54f4cc
@@ -0,0 +1,104 @@
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_ARCH_RK3288=y
+CONFIG_MACH_PHYTEC_SOM_RK3288=y
+CONFIG_THUMB2_BAREBOX=y
+CONFIG_ARM_BOARD_APPEND_ATAG=y
+CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
+CONFIG_ARM_UNWIND=y
+CONFIG_MMU=y
+CONFIG_MALLOC_SIZE=0x0
+CONFIG_MALLOC_TLSF=y
+CONFIG_KALLSYMS=y
+CONFIG_RELOCATABLE=y
+CONFIG_PROMPT="barebox> "
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+CONFIG_BOOTM_SHOW_TYPE=y
+CONFIG_BOOTM_VERBOSE=y
+CONFIG_BOOTM_INITRD=y
+CONFIG_BOOTM_OFTREE=y
+CONFIG_BOOTM_OFTREE_UIMAGE=y
+CONFIG_BOOTM_AIMAGE=y
+CONFIG_CONSOLE_ACTIVATE_NONE=y
+CONFIG_DEFAULT_COMPRESSION_LZO=y
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_RESET_SOURCE=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_ROCKCHIP_UART_PORT=0
+CONFIG_CMD_DMESG=y
+CONFIG_LONGHELP=y
+CONFIG_CMD_IOMEM=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_ARM_MMUINFO=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_GO=y
+CONFIG_CMD_RESET=y
+CONFIG_CMD_UIMAGE=y
+CONFIG_CMD_PARTITION=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_DEFAULTENV=y
+CONFIG_CMD_LOADENV=y
+CONFIG_CMD_PRINTENV=y
+CONFIG_CMD_MAGICVAR=y
+CONFIG_CMD_MAGICVAR_HELP=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_FILETYPE=y
+CONFIG_CMD_LN=y
+CONFIG_CMD_MD5SUM=y
+CONFIG_CMD_SHA1SUM=y
+CONFIG_CMD_SHA224SUM=y
+CONFIG_CMD_SHA256SUM=y
+CONFIG_CMD_UNCOMPRESS=y
+CONFIG_CMD_LET=y
+CONFIG_CMD_MSLEEP=y
+CONFIG_CMD_READF=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_HOST=y
+CONFIG_CMD_MIITOOL=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_TFTP=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_MM=y
+CONFIG_CMD_CLK=y
+CONFIG_CMD_DETECT=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_OF_NODE=y
+CONFIG_CMD_OF_PROPERTY=y
+CONFIG_CMD_OF_DISPLAY_TIMINGS=y
+CONFIG_CMD_OFTREE=y
+CONFIG_CMD_TIME=y
+CONFIG_NET=y
+CONFIG_NET_NFS=y
+CONFIG_NET_NETCONSOLE=y
+CONFIG_OFDEVICE=y
+CONFIG_OF_BAREBOX_DRIVERS=y
+CONFIG_DRIVER_SERIAL_NS16550=y
+CONFIG_DRIVER_NET_ARC_EMAC=y
+CONFIG_SMSC_PHY=y
+CONFIG_I2C_GPIO=y
+CONFIG_MCI=y
+CONFIG_MCI_STARTUP=y
+CONFIG_MCI_MMC_BOOT_PARTITIONS=y
+CONFIG_MCI_DW=y
+CONFIG_MCI_DW_PIO=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_LED_GPIO_OF=y
+CONFIG_GENERIC_PHY=y
+CONFIG_FS_CRAMFS=y
+CONFIG_FS_EXT4=y
+CONFIG_FS_TFTP=y
+CONFIG_FS_NFS=y
+CONFIG_FS_FAT=y
+CONFIG_FS_FAT_WRITE=y
+CONFIG_FS_FAT_LFN=y
+CONFIG_FS_BPKFS=y
+CONFIG_FS_UIMAGEFS=y
+CONFIG_LZO_DECOMPRESS=y
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

PATCH v2 8/8 doc: Add RK3288 Documentation

In reply to Wadim Egorov
---
 Documentation/boards/rk3288.rst            | 57 ++++++++++++++++++++++++++++++
 Documentation/boards/rk3288/phytec-som.rst | 24 +++++++++++++
 2 files changed, 81 insertions(+)
 create mode 100644 Documentation/boards/rk3288.rst
 create mode 100644 Documentation/boards/rk3288/phytec-som.rst
Documentation/boards/rk3288.rst new file +57 -0
new file mode 100644
index 0000000..3acca74
@@ -0,0 +1,57 @@
+Rockchip RK3288
+===============
+
+The RK3288 SoC has a two stage boot process. The booting is completed in two
+consecutive stages. The binary for the 1st stage is referred to as the
+Secondary Program Loader (SPL). The binary for the 2nd stage is simply referred to
+as barebox.
+SPL is a non-interactive loader and is only used to boot the 2nd stage loader.
+
+At this moment barebox can only be used as a 2nd stage bootloader.
+Starting barebox requires another bootloader which will do the very basic
+SDRAM initialization for us. We can use the u-boot for that.
+
+Building barebox
+----------------
+
+The RK3288 boards in barebox are covered by the ``rk3288_defconfig``.
+The resulting images will be placed under ``images/``:
+
+::
+  barebox-rk3288-phycore-som.img
+
+
+Starting and updating barebox
+-----------------------------
+
+SD/MMC
+^^^^^^
+
+For the first stage bootloader we will need an u-boot image. A detailed
+description on how to build and flash an RK3288 SPL image can be found in the
+u-boot source ``u-boot/doc/README.rockchip``.
+
+U-boot requires an image with a special header.
+
+  mkimage -A arm -T firmware -C none -O u-boot -a 0x02000000 -e 0 -n "barebox image" -d images/barebox-rk3288-phycore-som.img barebox.img
+
+To write an image that boots from an SD card (assumed to be /dev/sdc):
+
+  sudo dd if=u-boot/u-boot-spl-dtb.bin of=/dev/sdc seek=64 bs=512
+  sudo dd if=barebox.img of=/dev/sdc seek=256 bs=512
+
+This puts the Rockchip header and SPL image first and then places the barebox
+image at block 256 (i.e. 128KB from the start of the SD card). This
+corresponds with this setting in U-Boot:
+
+  #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR      256
+
+RK3288 Boards
+-------------
+
+.. toctree::
+  :glob:
+  :numbered:
+  :maxdepth: 1
+
+  rk3288/*
Documentation/boards/rk3288/phytec-som.rst new file +24 -0
new file mode 100644
index 0000000..1f3c714
@@ -0,0 +1,24 @@
+Phytec RK3288 based SOMs
+========================
+
+The phycore-som-rk3288 is actually not a real board. It represents a RK3288
+based Phytec module and its boards in the barebox.
+You can find out more about the Phytec SOM concept on the website:
+
+  http://phytec.com/products/system-on-modules/
+
+
+Supported modules and boards
+----------------------------
+
+Currently, barebox supports the following SOMs and boards:
+
+  - phyCORE
+
+    - PCM-946
+    - PCM-947
+
+Building phycore-som-rk3288
+---------------------------
+
+The phycore-som-rk3288 boards are covered by the ``rk3288_defconfig``.
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH v2 6/8 ARM: Add phyCORE-RK3288 SOM support

In reply to Wadim Egorov

The phyCORE-RK3288 aka PCM-059 is a SoM (System on Module) containing a RK3288 SoC. The module can be connected to different carrier boards.

---
 arch/arm/boards/Makefile                           |   1 +
 arch/arm/boards/phytec-som-rk3288/Makefile         |   3 +
 arch/arm/boards/phytec-som-rk3288/board.c          |  31 +++++
 .../defaultenv-physom-rk3288/boot/emmc             |   6 +
 .../defaultenv-physom-rk3288/boot/mmc              |   6 +
 .../defaultenv-physom-rk3288/init/automount        |  12 ++
 .../defaultenv-physom-rk3288/init/bootsource       |   3 +
 arch/arm/boards/phytec-som-rk3288/lowlevel.c       |  44 ++++++
 arch/arm/dts/Makefile                              |   1 +
 arch/arm/dts/rk3288-phycore-som.dts                | 148 +++++++++++++++++++++
 arch/arm/mach-rockchip/Kconfig                     |   7 +
 images/Makefile.rockchip                           |   4 +
 12 files changed, 266 insertions(+)
 create mode 100644 arch/arm/boards/phytec-som-rk3288/Makefile
 create mode 100644 arch/arm/boards/phytec-som-rk3288/board.c
 create mode 100644 arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/emmc
 create mode 100644 arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/mmc
 create mode 100644 arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount
 create mode 100644 arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource
 create mode 100644 arch/arm/boards/phytec-som-rk3288/lowlevel.c
 create mode 100644 arch/arm/dts/rk3288-phycore-som.dts
arch/arm/boards/Makefile +1 -0
index 9241b66..24ce130 100644
@@ -95,6 +95,7 @@ obj-$(CONFIG_MACH_PM9G45)			+= pm9g45/
 obj-$(CONFIG_MACH_QIL_A9260)			+= qil-a926x/
 obj-$(CONFIG_MACH_QIL_A9G20)			+= qil-a926x/
 obj-$(CONFIG_MACH_RADXA_ROCK)			+= radxa-rock/
+obj-$(CONFIG_MACH_PHYTEC_SOM_RK3288)		+= phytec-som-rk3288/
 obj-$(CONFIG_MACH_REALQ7)			+= datamodul-edm-qmx6/
 obj-$(CONFIG_MACH_RPI_COMMON)			+= raspberry-pi/
 obj-$(CONFIG_MACH_SABRELITE)			+= freescale-mx6-sabrelite/
arch/arm/boards/phytec-som-rk3288/Makefile new file +3 -0
new file mode 100644
index 0000000..6f34c9a
@@ -0,0 +1,3 @@
+obj-y += board.o
+lwl-y += lowlevel.o
+bbenv-y += defaultenv-physom-rk3288
arch/arm/boards/phytec-som-rk3288/board.c new file +31 -0
new file mode 100644
index 0000000..8ea6c6c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2016 PHYTEC Messtechnik GmbH,
+ * Author: Wadim Egorov <[email protected]>
+ *
+ * Device initialization for the phyCORE-RK3288 SoM
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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 <common.h>
+#include <init.h>
+#include <envfs.h>
+
+static int physom_devices_init(void)
+{
+	if (!of_machine_is_compatible("phytec,rk3288-phycore-som"))
+		return 0;
+
+	barebox_set_hostname("pcm059");
+	defaultenv_append_directory(defaultenv_physom_rk3288);
+
+	return 0;
+}
+device_initcall(physom_devices_init);
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/emmc new file +6 -0
new file mode 100644
index 0000000..731b07f
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image=/mnt/emmc/linuximage
+global.bootm.oftree=/mnt/emmc/oftree
+
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rw rootwait"
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/mmc new file +6 -0
new file mode 100644
index 0000000..5b19dba
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image=/mnt/sdmmc/linuximage
+global.bootm.oftree=/mnt/sdmmc/oftree
+
+global.linux.bootargs.dyn.root="root=/dev/mmcblk1p2 rw rootwait"
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount new file +12 -0
new file mode 100644
index 0000000..2f9d78a
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	init-menu-add-entry "$0" "Automountpoints"
+	exit
+fi
+
+mkdir -p /mnt/emmc
+automount -d /mnt/emmc 'mshc0.probe=1 && [ -e /dev/mshc0.0 ] && mount /dev/mshc0.0 /mnt/emmc'
+
+mkdir -p /mnt/sdmmc
+automount -d /mnt/sdmmc 'mshc1.probe=1 && [ -e /dev/mshc1.0 ] && mount /dev/mshc1.0 /mnt/sdmmc'
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource new file +3 -0
new file mode 100644
index 0000000..36d34e3
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+global.boot.default="emmc mmc"
arch/arm/boards/phytec-som-rk3288/lowlevel.c new file +44 -0

44 lines not on this page · raw message

arch/arm/dts/Makefile +1 -0
index 813e098..77c9ff3 100644
@@ -54,6 +54,7 @@ pbl-dtb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += imx6q-phytec-pbaa03.dtb.o \
 pbl-dtb-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += armada-xp-openblocks-ax3-4-bb.dtb.o
 pbl-dtb-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_A6) += kirkwood-openblocks_a6-bb.dtb.o
 pbl-dtb-$(CONFIG_MACH_RADXA_ROCK) += rk3188-radxarock.dtb.o
+pbl-dtb-$(CONFIG_MACH_PHYTEC_SOM_RK3288) += rk3288-phycore-som.dtb.o
 pbl-dtb-$(CONFIG_MACH_REALQ7) += imx6q-dmo-edmqmx6.dtb.o
 pbl-dtb-$(CONFIG_MACH_SABRELITE) += imx6q-sabrelite.dtb.o imx6dl-sabrelite.dtb.o
 pbl-dtb-$(CONFIG_MACH_SABRESD) += imx6q-sabresd.dtb.o
arch/arm/dts/rk3288-phycore-som.dts new file +148 -0

148 lines not on this page · raw message

arch/arm/mach-rockchip/Kconfig +7 -0
index 71fcbe7..f2fa3c6 100644
@@ -30,4 +30,11 @@ config MACH_RADXA_ROCK
 	select MFD_ACT8846
 	bool "Radxa rock board"
 
+config MACH_PHYTEC_SOM_RK3288
+	depends on ARCH_RK3288
+	select I2C
+	bool "RK3288 phyCORE SOM"
+	help
+	  Say Y here if you are using a RK3288 based Phytecs SOM
+
 endmenu
images/Makefile.rockchip +4 -0
index 9715b92..3f1ee57 100644
@@ -5,3 +5,7 @@
 pblx-$(CONFIG_MACH_RADXA_ROCK) += start_radxa_rock
 FILE_barebox-radxa-rock.img = start_radxa_rock.pblx
 image-$(CONFIG_MACH_RADXA_ROCK) += barebox-radxa-rock.img
+
+pblx-$(CONFIG_MACH_PHYTEC_SOM_RK3288) += start_rk3288_phycore_som
+FILE_barebox-rk3288-phycore-som.img = start_rk3288_phycore_som.pblx
+image-$(CONFIG_MACH_PHYTEC_SOM_RK3288) += barebox-rk3288-phycore-som.img
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

Re: [PATCH v2 6/8] ARM: Add phyCORE-RK3288 SOM support

Quoted 116 lines · Wadim Egorov

The phyCORE-RK3288 aka PCM-059 is a SoM (System on Module) containing a RK3288 SoC. The module can be connected to different carrier boards.

---
 arch/arm/boards/Makefile                           |   1 +
 arch/arm/boards/phytec-som-rk3288/Makefile         |   3 +
 arch/arm/boards/phytec-som-rk3288/board.c          |  31 +++++
 .../defaultenv-physom-rk3288/boot/emmc             |   6 +
 .../defaultenv-physom-rk3288/boot/mmc              |   6 +
 .../defaultenv-physom-rk3288/init/automount        |  12 ++
 .../defaultenv-physom-rk3288/init/bootsource       |   3 +
 arch/arm/boards/phytec-som-rk3288/lowlevel.c       |  44 ++++++
 arch/arm/dts/Makefile                              |   1 +
 arch/arm/dts/rk3288-phycore-som.dts                | 148 +++++++++++++++++++++
 arch/arm/mach-rockchip/Kconfig                     |   7 +
 images/Makefile.rockchip                           |   4 +
 12 files changed, 266 insertions(+)
 create mode 100644 arch/arm/boards/phytec-som-rk3288/Makefile
 create mode 100644 arch/arm/boards/phytec-som-rk3288/board.c
 create mode 100644 arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/emmc
 create mode 100644 arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/mmc
 create mode 100644 arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount
 create mode 100644 arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource
 create mode 100644 arch/arm/boards/phytec-som-rk3288/lowlevel.c
 create mode 100644 arch/arm/dts/rk3288-phycore-som.dts
arch/arm/boards/Makefile +1 -0
index 9241b66..24ce130 100644
@@ -95,6 +95,7 @@ obj-$(CONFIG_MACH_PM9G45)			+= pm9g45/
 obj-$(CONFIG_MACH_QIL_A9260)			+= qil-a926x/
 obj-$(CONFIG_MACH_QIL_A9G20)			+= qil-a926x/
 obj-$(CONFIG_MACH_RADXA_ROCK)			+= radxa-rock/
+obj-$(CONFIG_MACH_PHYTEC_SOM_RK3288)		+= phytec-som-rk3288/
 obj-$(CONFIG_MACH_REALQ7)			+= datamodul-edm-qmx6/
 obj-$(CONFIG_MACH_RPI_COMMON)			+= raspberry-pi/
 obj-$(CONFIG_MACH_SABRELITE)			+= freescale-mx6-sabrelite/
arch/arm/boards/phytec-som-rk3288/Makefile new file +3 -0
new file mode 100644
index 0000000..6f34c9a
@@ -0,0 +1,3 @@
+obj-y += board.o
+lwl-y += lowlevel.o
+bbenv-y += defaultenv-physom-rk3288
arch/arm/boards/phytec-som-rk3288/board.c new file +31 -0
new file mode 100644
index 0000000..8ea6c6c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2016 PHYTEC Messtechnik GmbH,
+ * Author: Wadim Egorov <[email protected]>
+ *
+ * Device initialization for the phyCORE-RK3288 SoM
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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 <common.h>
+#include <init.h>
+#include <envfs.h>
+
+static int physom_devices_init(void)
+{
+	if (!of_machine_is_compatible("phytec,rk3288-phycore-som"))
+		return 0;
+
+	barebox_set_hostname("pcm059");
+	defaultenv_append_directory(defaultenv_physom_rk3288);
+
+	return 0;
+}
+device_initcall(physom_devices_init);
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/emmc new file +6 -0
new file mode 100644
index 0000000..731b07f
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image=/mnt/emmc/linuximage
+global.bootm.oftree=/mnt/emmc/oftree
+
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rw rootwait"
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/mmc new file +6 -0
new file mode 100644
index 0000000..5b19dba
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image=/mnt/sdmmc/linuximage
+global.bootm.oftree=/mnt/sdmmc/oftree
+
+global.linux.bootargs.dyn.root="root=/dev/mmcblk1p2 rw rootwait"
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount new file +0 -0
new file mode 100644
index 0000000..2f9d78a

arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount line 6

Quoted 6 lines
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount new file +6 -0
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	init-menu-add-entry "$0" "Automountpoints"
+	exit
+fi

This is no longer needed.

arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount line 12

Quoted 6 lines
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount new file +6 -0
+
+mkdir -p /mnt/emmc
+automount -d /mnt/emmc 'mshc0.probe=1 && [ -e /dev/mshc0.0 ] && mount /dev/mshc0.0 /mnt/emmc'
+
+mkdir -p /mnt/sdmmc
+automount -d /mnt/sdmmc 'mshc1.probe=1 && [ -e /dev/mshc1.0 ] && mount /dev/mshc1.0 /mnt/sdmmc'

Maybe rename this to automount-mmc or similar to not overwrite the generic automount file? You'll probably want to have the generic automountpoints once you get network support.

arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource line 3

Quoted 9 lines
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource new file +3 -0
new file mode 100644
index 0000000..36d34e3
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+global.boot.default="emmc mmc"

This should go to defaultenv-physom-rk3288/nv/boot.default

Quoted 21 lines

+&emmc {

arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource new file +20 -0
+	broken-cd;
+	bus-width = <8>;
+	cap-mmc-highspeed;
+	disable-wp;
+	non-removable;
+	num-slots = <1>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>;
+	vmmc-supply = <&vcc33>;
+	vqmmc-supply = <&vcc18>;
+	status = "okay";
+
+	#size-cells = <1>;
+	#address-cells = <1>;
+
+	partition@8000 {
+		label = "spl";
+		reg = <0x8000 0x8000>;
+	};
+

arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource

Quoted 10 lines
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource new file +10 -0
+	partition@20000 {
+		label = "barebox";
+		reg = <0x20000 0xe0000>;
+	};
+
+	partition@e0000 {
+		label = "barebox-environment";
+		reg = <0xe0000 0x20000>;
+	};
+};

The reg property is <start size>, so it seems the barebox partition and the barebox-environment partition overlap.

Quoted 21 lines
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource new file +21 -0
+
+&sdmmc {
+	bus-width = <4>;
+	cap-mmc-highspeed;
+	cap-sd-highspeed;
+	card-detect-delay = <200>;
+	disable-wp;
+	num-slots = <1>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
+	vmmc-supply = <&vcc33>;
+	status = "okay";
+
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	partition@8000 {
+		label = "spl";
+		reg = <0x8000 0x8000>;
+	};
+

arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource

Quoted 10 lines
arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/bootsource new file +10 -0
+	partition@20000 {
+		label = "barebox";
+		reg = <0x20000 0xe0000>;
+	};
+
+	partition@e0000 {
+		label = "barebox-environment";
+		reg = <0xe0000 0x20000>;
+	};
+};

Same here.

The rest of the series looks fine to me, enough to resend this patch.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox