标签:
看我的内容很乱,想有序的操作,去看《嵌入式Linux学习笔记(基于S5PV210、TQ210)》
添加s5pv210配置
1 board/samsung/下
将smdkc100复制为smdkv210
将smdkv210/下的smdkc100.c重命名为smdkv210.c
修改smdkv210/下的Kconfig
if TARGET_SMDKV210
config SYS_BOARD
default "smdkv210"
config SYS_VENDOR
default "samsung"
config SYS_SOC
default "s5pv210"
config SYS_CONFIG_NAME
default "smdkv210"
endif
修改smdkv210/下的Makefile
obj-y := smdkv210.o
obj-$(CONFIG_SAMSUNG_ONENAND) += onenand.o
obj-y += lowlevel_init.o
查看smdkv210/下的MAINTAINERS
SMDKC100 BOARD
M: Minkyu Kang <mk7.kang@samsung.com>
S: Maintained
F: board/samsung/smdkc100/
F: include/configs/smdkc100.h
F: configs/smdkc100_defconfig
也要添加两个东西,先修改这个AINTAINERS
2 include/configs下
将smdkc100.h复制为smdkv210.h,先不修改
3 configs下
将smdkc100_defconfig复制为smdkv210_defconfig
接下来,先make smdkv210_defconfig, make menuconfig看下会不会出错,不过这样不会出错,肯定是在make时出错。
make menuconfig,由于还没修改,所以可以看到很多s5pc100
ARM architecture --->
Target select (Samsung S5PC1XX) --->
[*] S5PC1XX board select (Support smdkc100 board) --->
然后就是修改,一些关键词
S5PC1XX s5pc1xx
s5pc100 S5PC100
S5PC110 s5pc110
smdkc100 SMDKC100
grep "S5PC1XX" -n -r . ./.config.old:104:CONFIG_ARCH_S5PC1XX=y ./.config:104:CONFIG_ARCH_S5PC1XX=y ./board/samsung/goni/lowlevel_init.S:286: str r1, [r0, #0x200] @ S5PC1XX_CLK_SRC0 ./board/samsung/goni/lowlevel_init.S:335: str r1, [r0, #0x200] @ S5PC1XX_CLK_SRC0 ./board/samsung/goni/lowlevel_init.S:409: ldr r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET ./board/samsung/goni/lowlevel_init.S:412: str r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET ./board/samsung/goni/lowlevel_init.S:414: ldr r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET ./board/samsung/goni/lowlevel_init.S:417: str r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET ./board/samsung/goni/lowlevel_init.S:419: ldr r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET ./board/samsung/goni/lowlevel_init.S:421: str r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET ./board/samsung/goni/lowlevel_init.S:431: ldr r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET ./board/samsung/goni/lowlevel_init.S:434: str r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET ./board/samsung/goni/lowlevel_init.S:436: ldr r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET ./board/samsung/goni/lowlevel_init.S:439: str r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET ./board/samsung/goni/lowlevel_init.S:441: ldr r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET ./board/samsung/goni/lowlevel_init.S:443: str r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET ./include/generated/autoconf.h:51:#define CONFIG_ARCH_S5PC1XX 1 ./include/config/auto.conf:49:CONFIG_ARCH_S5PC1XX=y ./configs/s5p_goni_defconfig:2:CONFIG_ARCH_S5PC1XX=y ./configs/smdkv210_defconfig:2:CONFIG_ARCH_S5PC1XX=y ./configs/smdkc100_defconfig:2:CONFIG_ARCH_S5PC1XX=y ./arch/arm/Makefile:58:machine-$(CONFIG_ARCH_S5PC1XX) += s5pc1xx ./arch/arm/mach-s5pc1xx/include/mach/cpu.h:9:#ifndef _S5PC1XX_CPU_H ./arch/arm/mach-s5pc1xx/include/mach/cpu.h:10:#define _S5PC1XX_CPU_H ./arch/arm/mach-s5pc1xx/include/mach/cpu.h:13:#define S5PC1XX_ADDR_BASE 0xE0000000 ./arch/arm/mach-s5pc1xx/include/mach/cpu.h:103:#endif /* _S5PC1XX_CPU_H */ ./arch/arm/mach-s5pc1xx/include/mach/sromc.h:8: * (SROM, NAND Flash, OneNand, DDR, OneDRAM) on S5PC1XX. ./arch/arm/mach-s5pc1xx/Kconfig:1:if ARCH_S5PC1XX ./arch/arm/mach-s5pc1xx/Kconfig:4: prompt "S5PC1XX board select" ./arch/arm/Kconfig:487:config ARCH_S5PC1XX ./arch/arm/Kconfig:488: bool "Samsung S5PC1XX"
4 arch/arm/下
还是三个,Kconfig、Makefile、mach-s5pc1xx
修改Kconfig,复制项并修改为
config ARCH_S5PV210
bool "Samsung S5PV210"
select CPU_V7
select DM
select DM_SERIAL
select DM_GPIO
修改Makefile,添加machine-$(CONFIG_ARCH_S5PV210) += s5pv210
mach-s5pc1xx复制为mach-s5pv210
修改mach-s5pv210下的Kconfig
if ARCH_S5PV210 choice prompt "S5PV210 board select" optional config TARGET_S5P_GONI bool "S5P Goni board" select OF_CONTROL config TARGET_SMDKV210 bool "Support smdkv210 board" select OF_CONTROL endchoice config SYS_SOC default "s5pv210" source "board/samsung/goni/Kconfig" source "board/samsung/smdkv210/Kconfig" endif不知道goni是什么,先放着
修改arch/arm/mach-s5pv210/include/mach下cpu.h
他们没有直说,因而他们认为你应该知道要怎么去做,但是对于一个什么都不懂的人,他怎么会知道。
看cpu.h头部有一堆S5PC100_PRO_ID这样的定义,这些怎么改,当然看芯片手册。
从S5PC100和S5PC110可以看出,S5PC100_PRO_ID是0xE0000000,这是内存地址,就要先看下内存分布图。
在2.1 MEMORY ADDRESS MAP的图中,0xE0000000~0xFFFFFFFF是SFRS部分。那么就看下面的2.1.2 SPECIAL FUNCTION REGISTER MAP。但这里有三页这么多的寄存器,全写吗,暂时不需要,先把必要的几个写上,以后缺什么或者用什么驱动时再来添加。那么添加哪些呢,留给后面添加。
5 configs/smdkv210_defconfig
CONFIG_ARM=y CONFIG_ARCH_S5PV210=y CONFIG_TARGET_SMDKV210=y CONFIG_DEFAULT_DEVICE_TREE="s5pv210-smdkv210" CONFIG_BOOTDELAY=3 CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="SMDKV210 # " # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_CACHE=y CONFIG_CMD_FAT=y
现在修改,需要注意的是,不修改实际功能,只是修改相应的变量及宏定义的名称而已,实际功能的修改是后面的事。看lowlevel_init.S,用到了
S5PC100_GPIO_BASE
S5PC100_WATCHDOG_BASE
S5PC100_SROMC_BASE
S5PC100_VIC0_BASE
S5PC100_VIC1_BASE
S5PC100_VIC2_BASE
S5PC100_CLOCK_BASE
目前就这几个,都修改,然后在刚才的cpu.h中添加
make distclean
make smdkv210_defconfig
grep "S5PV210" -n -r .
./.config:101:CONFIG_ARCH_S5PV210=y ./board/samsung/smdkv210/lowlevel_init.S:26: ldr r8, =S5PV210_GPIO_BASE ./board/samsung/smdkv210/lowlevel_init.S:29: ldr r0, =S5PV210_WATCHDOG_BASE @0xEA200000 ./board/samsung/smdkv210/lowlevel_init.S:34: ldr r0, =S5PV210_SROMC_BASE ./board/samsung/smdkv210/lowlevel_init.S:39: ldr r0, =S5PV210_VIC0_BASE @0xE4000000 ./board/samsung/smdkv210/lowlevel_init.S:40: ldr r1, =S5PV210_VIC1_BASE @0xE4000000 ./board/samsung/smdkv210/lowlevel_init.S:41: ldr r2, =S5PV210_VIC2_BASE @0xE4000000 ./board/samsung/smdkv210/lowlevel_init.S:74: ldr r8, =S5PV210_CLOCK_BASE @ 0xE0100000 ./configs/smdkv210_defconfig:2:CONFIG_ARCH_S5PV210=y ./arch/arm/Makefile:59:machine-$(CONFIG_ARCH_S5PV210) += s5pv210 ./arch/arm/mach-s5pv210/include/mach/cpu.h:9:#ifndef _S5PV210_CPU_H ./arch/arm/mach-s5pv210/include/mach/cpu.h:10:#define _S5PV210_CPU_H ./arch/arm/mach-s5pv210/include/mach/cpu.h:13:#define S5PV210_ADDR_BASE 0xE0000000 ./arch/arm/mach-s5pv210/include/mach/cpu.h:49:/* S5PV210 */ ./arch/arm/mach-s5pv210/include/mach/cpu.h:50:#define S5PV210_CHIPID 0xE0000000 ./arch/arm/mach-s5pv210/include/mach/cpu.h:51:#define S5PV210_CLOCK_BASE 0xE0100000 ./arch/arm/mach-s5pv210/include/mach/cpu.h:52:#define S5PV210_GPIO_BASE 0xE0200000 ./arch/arm/mach-s5pv210/include/mach/cpu.h:54:#define S5PV210_SROMC_BASE 0xE8000000 ./arch/arm/mach-s5pv210/include/mach/cpu.h:55:#define S5PV210_VIC0_BASE 0xF2000000 ./arch/arm/mach-s5pv210/include/mach/cpu.h:56:#define S5PV210_VIC1_BASE 0xF2100000 ./arch/arm/mach-s5pv210/include/mach/cpu.h:57:#define S5PV210_VIC2_BASE 0xF2200000 ./arch/arm/mach-s5pv210/include/mach/cpu.h:112:#endif /* _S5PV210_CPU_H */ ./arch/arm/mach-s5pv210/include/mach/sromc.h:8: * (SROM, NAND Flash, OneNand, DDR, OneDRAM) on S5PV210. ./arch/arm/mach-s5pv210/Kconfig:1:if ARCH_S5PV210 ./arch/arm/mach-s5pv210/Kconfig:4: prompt "S5PV210 board select" ./arch/arm/Kconfig:494:config ARCH_S5PV210 ./arch/arm/Kconfig:495: bool "Samsung S5PV210"
grep "s5pc1xx" -n -r . ./MAINTAINERS:140:F: arch/arm/mach-s5pc1xx/ ./board/samsung/smdkc100/Kconfig:10: default "s5pc1xx" ./board/samsung/goni/goni.c:149:static int s5pc1xx_phy_control(int on) ./board/samsung/goni/goni.c:187: .phy_control = s5pc1xx_phy_control, ./board/samsung/goni/Kconfig:10: default "s5pc1xx" ./include/config/auto.conf.cmd:473: arch/arm/mach-s5pc1xx/Kconfig ./configs/s5p_goni_defconfig:4:CONFIG_DEFAULT_DEVICE_TREE="s5pc1xx-goni" ./configs/smdkc100_defconfig:4:CONFIG_DEFAULT_DEVICE_TREE="s5pc1xx-smdkc100" ./arch/arm/Makefile:58:machine-$(CONFIG_ARCH_S5PC1XX) += s5pc1xx ./arch/arm/dts/Makefile:10:dtb-$(CONFIG_S5PC100) += s5pc1xx-smdkc100.dtb ./arch/arm/dts/Makefile:11:dtb-$(CONFIG_S5PC110) += s5pc1xx-goni.dtb ./arch/arm/mach-s5pv210/clock.c:280:/* s5pc1xx: return uart clock frequency */ ./arch/arm/mach-s5pv210/clock.c:281:static unsigned long s5pc1xx_get_uart_clk(int dev_index) ./arch/arm/mach-s5pv210/clock.c:289:/* s5pc1xx: return pwm clock frequency */ ./arch/arm/mach-s5pv210/clock.c:290:static unsigned long s5pc1xx_get_pwm_clk(void) ./arch/arm/mach-s5pv210/clock.c:316: return s5pc1xx_get_pwm_clk(); ./arch/arm/mach-s5pv210/clock.c:321: return s5pc1xx_get_uart_clk(dev_index); ./arch/arm/mach-s5pc1xx/Kconfig:18: default "s5pc1xx" ./arch/arm/mach-s5pc1xx/clock.c:280:/* s5pc1xx: return uart clock frequency */ ./arch/arm/mach-s5pc1xx/clock.c:281:static unsigned long s5pc1xx_get_uart_clk(int dev_index) ./arch/arm/mach-s5pc1xx/clock.c:289:/* s5pc1xx: return pwm clock frequency */ ./arch/arm/mach-s5pc1xx/clock.c:290:static unsigned long s5pc1xx_get_pwm_clk(void) ./arch/arm/mach-s5pc1xx/clock.c:316: return s5pc1xx_get_pwm_clk(); ./arch/arm/mach-s5pc1xx/clock.c:321: return s5pc1xx_get_uart_clk(dev_index); ./arch/arm/Kconfig:895:source "arch/arm/mach-s5pc1xx/Kconfig" ./arch/arm/cpu/armv7/Makefile:29:ifneq (,$(filter s5pc1xx exynos,$(SOC)))
7 arch/arm/cpu/armv7/Makefile
ifneq (,$(filter s5pv210 s5pc1xx exynos,$(SOC)))
obj-y += s5p-common/
endif
8 arch/arm/Kconfig
source "arch/arm/mach-s5pv210/Kconfig"
9 arch/arm/dts
暂时不管它,看下会怎样
10 arch/arm/mach-s5pv210/clock.c
grep "s5pv210" -n -r . ./board/samsung/smdkv210/Kconfig:10: default "s5pv210" ./configs/smdkv210_defconfig:4:CONFIG_DEFAULT_DEVICE_TREE="s5pv210-smdkv210" ./arch/arm/Makefile:59:machine-$(CONFIG_ARCH_S5PV210) += s5pv210 ./arch/arm/dts/exynos4210.dtsi:119: compatible = "samsung,s5pv210-g2d"; ./arch/arm/mach-s5pv210/Kconfig:18: default "s5pv210" ./arch/arm/mach-s5pv210/clock.c:280:/* s5pv210: return uart clock frequency */ ./arch/arm/mach-s5pv210/clock.c:281:static unsigned long s5pv210_get_uart_clk(int dev_index) ./arch/arm/mach-s5pv210/clock.c:283: if (cpu_is_s5pv210()) ./arch/arm/mach-s5pv210/clock.c:284: return s5pv210_get_pclk(); ./arch/arm/mach-s5pv210/clock.c:286: return s5pv210_get_pclk(); ./arch/arm/mach-s5pv210/clock.c:289:/* s5pv210: return pwm clock frequency */ ./arch/arm/mach-s5pv210/clock.c:290:static unsigned long s5pv210_get_pwm_clk(void) ./arch/arm/mach-s5pv210/clock.c:292: if (cpu_is_s5pv210()) ./arch/arm/mach-s5pv210/clock.c:293: return s5pv210_get_pclk(); ./arch/arm/mach-s5pv210/clock.c:295: return s5pv210_get_pclk(); ./arch/arm/mach-s5pv210/clock.c:316: return s5pv210_get_pwm_clk(); ./arch/arm/mach-s5pv210/clock.c:321: return s5pv210_get_uart_clk(dev_index); ./arch/arm/Kconfig:897:source "arch/arm/mach-s5pv210/Kconfig" ./arch/arm/cpu/armv7/Makefile:29:ifneq (,$(filter s5pv210 s5pc1xx exynos,$(SOC)))
grep "s5pc100" -n -r . ./doc/README.s5pc1xx:35: if (cpu_is_s5pc100()) ./doc/README.s5pc1xx:36: printf("cpu is s5pc100\n"); ./doc/README.s5pc1xx:45: struct s5pc100_gpio *gpio = (struct s5pc100_gpio*)S5PC100_GPIO_BASE; ./drivers/gpio/s5p_gpio.c:355: { .compatible = "samsung,s5pc100-pinctrl" }, ./board/samsung/smdkc100/onenand.c:22: struct s5pc100_clock *clk = ./board/samsung/smdkc100/onenand.c:23: (struct s5pc100_clock *)samsung_get_base_clock(); ./board/samsung/goni/lowlevel_init.S:65: /* Don't setup at s5pc100 */ ./board/samsung/smdkv210/onenand.c:22: struct s5pc100_clock *clk = ./board/samsung/smdkv210/onenand.c:23: (struct s5pc100_clock *)samsung_get_base_clock(); ./include/configs/s5p_goni.h:6: * Configuation settings for the SAMSUNG Universal (s5pc100) board. ./arch/arm/dts/s5pc1xx-smdkc100.dts:12:#include "s5pc100-pinctrl.dtsi" ./arch/arm/dts/s5pc1xx-smdkc100.dts:16: compatible = "samsung,smdkc100", "samsung,s5pc100"; ./arch/arm/dts/s5pc1xx-smdkc100.dts:25: compatible = "samsung,s5pc100-pinctrl"; ./arch/arm/mach-s5pv210/include/mach/cpu.h:88:IS_SAMSUNG_TYPE(s5pc100, 0xc100) ./arch/arm/mach-s5pv210/include/mach/cpu.h:94: if (cpu_is_s5pc100()) ./arch/arm/mach-s5pv210/include/mach/clock.h:13:struct s5pc100_clock { ./arch/arm/mach-s5pv210/include/mach/gpio.h:23:enum s5pc100_gpio_pin { ./arch/arm/mach-s5pv210/include/mach/gpio.h:727:static struct gpio_info s5pc100_gpio_data[S5PC100_GPIO_NUM_PARTS] = { ./arch/arm/mach-s5pv210/include/mach/gpio.h:738: if (cpu_is_s5pc100()) ./arch/arm/mach-s5pv210/include/mach/gpio.h:739: return s5pc100_gpio_data; ./arch/arm/mach-s5pv210/include/mach/gpio.h:748: if (cpu_is_s5pc100()) ./arch/arm/mach-s5pv210/include/mach/gpio.h:783:static const struct gpio_name_num_table s5pc100_gpio_table[] = { ./arch/arm/mach-s5pv210/clock.c:26:static unsigned long s5pc100_get_pll_clk(int pllreg) ./arch/arm/mach-s5pv210/clock.c:28: struct s5pc100_clock *clk = ./arch/arm/mach-s5pv210/clock.c:29: (struct s5pc100_clock *)samsung_get_base_clock(); ./arch/arm/mach-s5pv210/clock.c:76:/* s5pc100: return pll clock frequency */ ./arch/arm/mach-s5pv210/clock.c:153:/* s5pc100: return ARM clock frequency */ ./arch/arm/mach-s5pv210/clock.c:154:static unsigned long s5pc100_get_arm_clk(void) ./arch/arm/mach-s5pv210/clock.c:156: struct s5pc100_clock *clk = ./arch/arm/mach-s5pv210/clock.c:157: (struct s5pc100_clock *)samsung_get_base_clock(); ./arch/arm/mach-s5pv210/clock.c:175:/* s5pc100: return HCLKD0 frequency */ ./arch/arm/mach-s5pv210/clock.c:178: struct s5pc100_clock *clk = ./arch/arm/mach-s5pv210/clock.c:179: (struct s5pc100_clock *)samsung_get_base_clock(); ./arch/arm/mach-s5pv210/clock.c:192:/* s5pc100: return PCLKD1 frequency */ ./arch/arm/mach-s5pv210/clock.c:195: struct s5pc100_clock *clk = ./arch/arm/mach-s5pv210/clock.c:196: (struct s5pc100_clock *)samsung_get_base_clock(); ./arch/arm/mach-s5pv210/clock.c:274:/* s5pc100: return peripheral clock frequency */ ./arch/arm/mach-s5pv210/clock.c:275:static unsigned long s5pc100_get_pclk(void) ./arch/arm/mach-s5pv210/clock.c:303: return s5pc100_get_pll_clk(pllreg); ./arch/arm/mach-s5pv210/clock.c:311: return s5pc100_get_arm_clk(); ./arch/arm/include/asm/mach-types.h:7526:# define machine_is_fs_s5pc100() (machine_arch_type == MACH_TYPE_FS_S5PC100) ./arch/arm/include/asm/mach-types.h:7528:# define machine_is_fs_s5pc100() (0) ./arch/arm/mach-s5pc1xx/include/mach/cpu.h:79:IS_SAMSUNG_TYPE(s5pc100, 0xc100) ./arch/arm/mach-s5pc1xx/include/mach/cpu.h:85: if (cpu_is_s5pc100()) ./arch/arm/mach-s5pc1xx/include/mach/clock.h:13:struct s5pc100_clock { ./arch/arm/mach-s5pc1xx/include/mach/gpio.h:23:enum s5pc100_gpio_pin { ./arch/arm/mach-s5pc1xx/include/mach/gpio.h:727:static struct gpio_info s5pc100_gpio_data[S5PC100_GPIO_NUM_PARTS] = { ./arch/arm/mach-s5pc1xx/include/mach/gpio.h:738: if (cpu_is_s5pc100()) ./arch/arm/mach-s5pc1xx/include/mach/gpio.h:739: return s5pc100_gpio_data; ./arch/arm/mach-s5pc1xx/include/mach/gpio.h:748: if (cpu_is_s5pc100()) ./arch/arm/mach-s5pc1xx/include/mach/gpio.h:783:static const struct gpio_name_num_table s5pc100_gpio_table[] = { ./arch/arm/mach-s5pc1xx/clock.c:26:static unsigned long s5pc100_get_pll_clk(int pllreg) ./arch/arm/mach-s5pc1xx/clock.c:28: struct s5pc100_clock *clk = ./arch/arm/mach-s5pc1xx/clock.c:29: (struct s5pc100_clock *)samsung_get_base_clock(); ./arch/arm/mach-s5pc1xx/clock.c:76:/* s5pc100: return pll clock frequency */ ./arch/arm/mach-s5pc1xx/clock.c:153:/* s5pc100: return ARM clock frequency */ ./arch/arm/mach-s5pc1xx/clock.c:154:static unsigned long s5pc100_get_arm_clk(void) ./arch/arm/mach-s5pc1xx/clock.c:156: struct s5pc100_clock *clk = ./arch/arm/mach-s5pc1xx/clock.c:157: (struct s5pc100_clock *)samsung_get_base_clock(); ./arch/arm/mach-s5pc1xx/clock.c:175:/* s5pc100: return HCLKD0 frequency */ ./arch/arm/mach-s5pc1xx/clock.c:178: struct s5pc100_clock *clk = ./arch/arm/mach-s5pc1xx/clock.c:179: (struct s5pc100_clock *)samsung_get_base_clock(); ./arch/arm/mach-s5pc1xx/clock.c:192:/* s5pc100: return PCLKD1 frequency */ ./arch/arm/mach-s5pc1xx/clock.c:195: struct s5pc100_clock *clk = ./arch/arm/mach-s5pc1xx/clock.c:196: (struct s5pc100_clock *)samsung_get_base_clock(); ./arch/arm/mach-s5pc1xx/clock.c:274:/* s5pc100: return peripheral clock frequency */ ./arch/arm/mach-s5pc1xx/clock.c:275:static unsigned long s5pc100_get_pclk(void) ./arch/arm/mach-s5pc1xx/clock.c:286: return s5pc100_get_pclk(); ./arch/arm/mach-s5pc1xx/clock.c:295: return s5pc100_get_pclk(); ./arch/arm/mach-s5pc1xx/clock.c:303: return s5pc100_get_pll_clk(pllreg); ./arch/arm/mach-s5pc1xx/clock.c:311: return s5pc100_get_arm_clk(); ./arch/arm/cpu/armv7/s5p-common/cpu_info.c:14:/* Default is s5pc100 */
原来是* Default is s5pc100 */unsigned int s5p_cpu_id = 0xC100;,但现在要修改为S5PV210,但是V并不在十六进制表示的数里,因此按照《嵌入式Linux学习笔记(基于S5PV210、TQ210)》的方法做。可以变通一下。
/* Default is s5pc100 */
//unsigned int s5p_cpu_id = 0xC100;
/* Default is s5pv210 */
unsigned int s5p_cpu_id = 0x56210;
arch/arm/mach-s5pv210/include/mach/cpu.h
static inline void s5p_set_cpu_id(void)
{
s5p_cpu_id = readl(S5PC100_PRO_ID);
s5p_cpu_rev = s5p_cpu_id & 0x000000FF;
s5p_cpu_id = 0xC000 | ((s5p_cpu_id & 0x00FFF000) >> 12);
}
用到了S5PC100_PRO_ID,在上面定义#define S5PV210_PRO_ID 0xE0000000
读寄存器的值,然后解析,那么要看下数据格式
1.1 OVERVIEW OF CHIP ID
The S5PV210 includes a Chip ID block for the software (SW) that sends and receives APB interface signals to the
bus system. Chip ID is placed on the first address of the SFR region (0xE000_0000).
The product ID register supplies product ID, revision number and device ID.
很清楚了,寄存器的值为0x43110020,其中S5PV210是0x43110,Revision num 0x2
Device ID 0x0 "V210",查下ASCII码表就可以知道0x43 = ‘C‘,为什么不用‘V‘=0x56呢
arch/arm/mach-s5pv210/include/mach/cpu.h
static inline void s5p_set_cpu_id(void) { int id = 0; s5p_cpu_id = readl(S5PV210_PRO_ID); s5p_cpu_rev = s5p_cpu_id & 0x000000FF; //The product ID allocated to S5PV210 is “0x43110” id = (s5p_cpu_id & 0xFFFFF000) >> 12; if(0x43110 == id) { //Device ID [3:0] 0x0 = V210 id = s5p_cpu_id & 0x0000000F; switch(id) { case 0x0: //0000 //V210 s5p_cpu_id = 0x56210; break; case 0x1: //0001 //C110 s5p_cpu_id = 0xC110; break; case 0x2: //0010 //C111 s5p_cpu_id = 0xC111; break; default: break; } } } IS_SAMSUNG_TYPE(s5pv210, 0x56210) #define SAMSUNG_BASE(device, base) static inline unsigned int samsung_get_base_##device(void) { if (cpu_is_s5pc100()) return S5PC100_##base; else if (cpu_is_s5pc110()) return S5PC110_##base; else if (cpu_is_s5pv210()) return S5PV210_##base; else return 0; }arch/arm/cpu/armv7/s5p-common/cpu_info.c
#ifdef CONFIG_DISPLAY_CPUINFO int print_cpuinfo(void) { const char *cpu_model; int len; /* For SoC with no real CPU ID in naming convention. */ cpu_model = fdt_getprop(gd->fdt_blob, 0, "cpu-model", &len); if (cpu_model) printf("CPU: %.*s @ ", len, cpu_model); else if(s5p_cpu_id > 0x50000) //s5pv210 printf("CPU: %s%c%X @ ", s5p_get_cpu_name(), (s5p_cpu_id & 0xFF000) >> 12, s5p_cpu_id & 0xFFF); else printf("CPU: %s%X @ ", s5p_get_cpu_name(), s5p_cpu_id); print_freq(get_arm_clk(), "\n"); return 0; } #endif
12 arch/arm/include/asm/mach-types.h
#ifdef CONFIG_MACH_FS_S5PC100
# ifdef machine_arch_type
# undef machine_arch_type
# define machine_arch_type __machine_arch_type
# else
# define machine_arch_type MACH_TYPE_FS_S5PC100
# endif
# define machine_is_fs_s5pc100() (machine_arch_type == MACH_TYPE_FS_S5PC100)
#else
# define machine_is_fs_s5pc100() (0)
#endif
不用管,
13 arch/arm/mach-s5pv210/clock.c
/* s5pv210: return ARM clock frequency */
static unsigned long s5pv210_get_arm_clk(void)
{
struct s5pv210_clock *clk =
(struct s5pv210_clock *)samsung_get_base_clock();
unsigned long div;
unsigned long dout_apll, armclk;
unsigned int apll_ratio;
div = readl(&clk->div0);
/* APLL_RATIO: [2:0] */
apll_ratio = div & 0x7;
dout_apll = get_pll_clk(APLL) / (apll_ratio + 1);
armclk = dout_apll;
return armclk;
}
3.7.4.1 Clock Divider Control Register (CLK_DIV0, R/W, Address = 0xE010_0300)
APLL_RATIO [2:0] DIVAPLL clock divider ratio, ARMCLK = MOUT_MSYS / (APLL_RATIO + 1)
。。。。。。
14 arch/arm/mach-s5pv210/include/mach/clock.h
3.7.1 REGISTER MAP
struct s5pv210_clock {
unsigned int apll_lock; //offset 0x0000
unsigned char res1[0x4];
unsigned int mpll_lock; //offset 0x0008
unsigned char res2[0x4];
unsigned int epll_lock; //offset 0x0010
unsigned char res3[0xc];
unsigned int vpll_lock; //offset 0x0020
unsigned char res4[0xdc];
unsigned int apll_con; //offset 0x0100
unsigned char res5[0x4];
unsigned int mpll_con; //offset 0x0108
。。。。。。
15
arch/arm/mach-s5pv210/include/mach/gpio.h
替换
16 board/samsung/smdkv210/onenand.c
不需要用
17 drivers/gpio/s5p_gpio.c
看情况
18 arch/arm/mach-s5pv210/reset.S
4.9.2.2 Software Reset
Software reset is asserted when CPU write “1” to SWRESET register in NORMAL mode.
During the software reset, the following actions occur:
? All units (except some blocks listed in Table 4-10) go into their pre-defined reset state.
? All pins get their reset state.
? The XnRSTOUT pin is asserted during software reset.
When Software reset is asserted the following sequence occurs.
1. SYSCON requests bus controller to finish current transactions.
2. Bus controller send acknowledge to SYSCON after completed bus transactions.
3. SYSCON request memory controller to enter into self refresh mode.
4. SYSCON wait for self refresh acknowledge from memory controller.
5. Internal reset signals and XnRSTOUT are asserted and reset counter is activated.
6. Reset counter is expired, then internal reset signals and XnRSTOUT are deasserted.
3.7.9 OTHER SFRS
3.7.9.1 Other SFRs (SWRESET, R/W, Address = 0xE010_2000)
SWRESET [0] Software reset (0: no effect, 1: reset)
一样的,不用改
make smdkv210_defconfig
make
lib/asm-offsets.c:1:0: error: bad value (armv5) for -march= switch
使用make CROSS_COMPILE=arm-linux-,也可以修改Makefile
board/samsung/smdkv210/smdkv210.c:25:15: error: ‘S5PC100_GPIO_K00‘ undeclared (first use in this function)
S5PV210没有GPIOK的,
/* * Miscellaneous platform dependent initialisations */ static void smc9115_pre_init(void) { u32 smc_bw_conf, smc_bc_conf; /* gpio configuration GPK0CON */ gpio_cfg_pin(S5PV210_GPIO_K00 + CONFIG_ENV_SROM_BANK, S5P_GPIO_FUNC(2)); /* Ethernet needs bus width of 16 bits */ smc_bw_conf = SMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK); smc_bc_conf = SMC_BC_TACS(0x0) | SMC_BC_TCOS(0x4) | SMC_BC_TACC(0xe) | SMC_BC_TCOH(0x1) | SMC_BC_TAH(0x4) | SMC_BC_TACP(0x6) | SMC_BC_PMC(0x0); /* Select and configure the SROMC bank */ s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf); } int board_init(void) { smc9115_pre_init(); gd->bd->bi_arch_number = MACH_TYPE_SMDKC100; gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; return 0; }
这里,按照我自己的想法在操作,没有章法,但至少可以了解新版U-Boot的一些东西。
先记录一下,后面再认真按照《嵌入式Linux学习笔记(基于S5PV210、TQ210)》做一下
make spl/u-boot-spl.bin
./scripts/dtc-version.sh: 行 17: dtc: 未找到命令
./scripts/dtc-version.sh: 行 18: dtc: 未找到命令
*** Your dtc is too old, please upgrade to dtc 1.4 or newer
安装工具sudo apt install device-tree-compiler
u-boot-2016.07 移植 (二) —— 添加s5pv210配置
标签:
原文地址:http://blog.csdn.net/fu851523125/article/details/51925691