1 From 60856fa8f9866f292df740ea98752a70738eb59a Mon Sep 17 00:00:00 2001
2 From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 Date: Fri, 9 Aug 2013 18:11:07 +0200
4 Subject: MIPS: add board support for Arcadyan Easybox 904
6 Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 +++ b/board/arcadyan/easybox904/Makefile
12 +# Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
14 +# SPDX-License-Identifier: GPL-2.0+
17 +include $(TOPDIR)/config.mk
19 +LIB = $(obj)lib$(BOARD).o
23 +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
24 +OBJS := $(addprefix $(obj),$(COBJS))
25 +SOBJS := $(addprefix $(obj),$(SOBJS))
27 +$(LIB): $(obj).depend $(OBJS) $(SOBJS)
28 + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
30 +#########################################################################
32 +# defines $(obj).depend target
33 +include $(SRCTREE)/rules.mk
35 +sinclude $(obj).depend
37 +#########################################################################
39 +++ b/board/arcadyan/easybox904/config.mk
42 +# Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
44 +# SPDX-License-Identifier: GPL-2.0+
47 +PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(BOARDDIR)
49 +++ b/board/arcadyan/easybox904/ddr_settings.h
52 + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
54 + * SPDX-License-Identifier: GPL-2.0+
57 +#define MC_CCR00_VALUE 0x101
58 +#define MC_CCR01_VALUE 0x1000100
59 +#define MC_CCR02_VALUE 0x1010000
60 +#define MC_CCR03_VALUE 0x101
61 +#define MC_CCR04_VALUE 0x1000000
62 +#define MC_CCR05_VALUE 0x1000101
63 +#define MC_CCR06_VALUE 0x1000100
64 +#define MC_CCR07_VALUE 0x1010000
65 +#define MC_CCR08_VALUE 0x1000101
66 +#define MC_CCR09_VALUE 0x1000000
67 +#define MC_CCR10_VALUE 0x2000100
68 +#define MC_CCR11_VALUE 0x2000300
69 +#define MC_CCR12_VALUE 0x30000
70 +#define MC_CCR13_VALUE 0x202
71 +#define MC_CCR14_VALUE 0x7080A0F
72 +#define MC_CCR15_VALUE 0x2040F
73 +#define MC_CCR16_VALUE 0x40000
74 +#define MC_CCR17_VALUE 0x70102
75 +#define MC_CCR18_VALUE 0x4020002
76 +#define MC_CCR19_VALUE 0x30302
77 +#define MC_CCR20_VALUE 0x8000700
78 +#define MC_CCR21_VALUE 0x40F020A
79 +#define MC_CCR22_VALUE 0x0
80 +#define MC_CCR23_VALUE 0xC020000
81 +#define MC_CCR24_VALUE 0x4401503
82 +#define MC_CCR25_VALUE 0x0
83 +#define MC_CCR26_VALUE 0x0
84 +#define MC_CCR27_VALUE 0x6420000
85 +#define MC_CCR28_VALUE 0x0
86 +#define MC_CCR29_VALUE 0x0
87 +#define MC_CCR30_VALUE 0x798
88 +#define MC_CCR31_VALUE 0x0
89 +#define MC_CCR32_VALUE 0x0
90 +#define MC_CCR33_VALUE 0x650000
91 +#define MC_CCR34_VALUE 0x200C8
92 +#define MC_CCR35_VALUE 0x1536B0
93 +#define MC_CCR36_VALUE 0xC8
94 +#define MC_CCR37_VALUE 0xC351
95 +#define MC_CCR38_VALUE 0x0
96 +#define MC_CCR39_VALUE 0x142404
97 +#define MC_CCR40_VALUE 0x142604
98 +#define MC_CCR41_VALUE 0x141B42
99 +#define MC_CCR42_VALUE 0x141B42
100 +#define MC_CCR43_VALUE 0x566504
101 +#define MC_CCR44_VALUE 0x566504
102 +#define MC_CCR45_VALUE 0x565F17
103 +#define MC_CCR46_VALUE 0x565F17
104 +#define MC_CCR47_VALUE 0x0
105 +#define MC_CCR48_VALUE 0x0
106 +#define MC_CCR49_VALUE 0x0
107 +#define MC_CCR50_VALUE 0x0
108 +#define MC_CCR51_VALUE 0x0
109 +#define MC_CCR52_VALUE 0x133
110 +#define MC_CCR53_VALUE 0xF3014B27
111 +#define MC_CCR54_VALUE 0xF3014B27
112 +#define MC_CCR55_VALUE 0xF3014B27
113 +#define MC_CCR56_VALUE 0xF3014B27
114 +#define MC_CCR57_VALUE 0x7C00301
115 +#define MC_CCR58_VALUE 0x7C00301
116 +#define MC_CCR59_VALUE 0x7C00301
117 +#define MC_CCR60_VALUE 0x7C00301
118 +#define MC_CCR61_VALUE 0x4
120 +++ b/board/arcadyan/easybox904/easybox904.c
123 + * Copyright (C) 2012-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
125 + * SPDX-License-Identifier: GPL-2.0+
130 +#include <asm/gpio.h>
131 +#include <asm/lantiq/eth.h>
132 +#include <asm/lantiq/chipid.h>
133 +#include <asm/lantiq/cpu.h>
134 +#include <asm/arch/gphy.h>
136 +#if defined(CONFIG_SPL_BUILD)
137 +#define do_gpio_init 1
138 +#define do_pll_init 1
139 +#define do_dcdc_init 0
140 +#elif defined(CONFIG_SYS_BOOT_RAM)
141 +#define do_gpio_init 1
142 +#define do_pll_init 0
143 +#define do_dcdc_init 1
145 +#define do_gpio_init 0
146 +#define do_pll_init 0
147 +#define do_dcdc_init 1
150 +static inline void gpio_init(void)
152 + /* EBU.FL_CS1 as output for NAND CE */
153 + gpio_set_altfunc(23, GPIO_ALTSEL_SET, GPIO_ALTSEL_CLR, GPIO_DIR_OUT);
154 + /* EBU.FL_A23 as output for NAND CLE */
155 + gpio_set_altfunc(24, GPIO_ALTSEL_SET, GPIO_ALTSEL_CLR, GPIO_DIR_OUT);
156 + /* EBU.FL_A24 as output for NAND ALE */
157 + gpio_set_altfunc(13, GPIO_ALTSEL_SET, GPIO_ALTSEL_CLR, GPIO_DIR_OUT);
158 + /* GPIO 3.0 as input for NAND Ready Busy */
159 + gpio_set_altfunc(48, GPIO_ALTSEL_SET, GPIO_ALTSEL_CLR, GPIO_DIR_IN);
160 + /* GPIO 3.1 as output for NAND Read */
161 + gpio_set_altfunc(49, GPIO_ALTSEL_SET, GPIO_ALTSEL_CLR, GPIO_DIR_OUT);
164 +int board_early_init_f(void)
173 + ltq_dcdc_init(0x7F);
178 +int checkboard(void)
180 + puts("Board: " CONFIG_BOARD_NAME "\n");
181 + ltq_chip_print_info();
186 +static const struct ltq_eth_port_config eth_port_config[] = {
188 + { 0, 0x0, LTQ_ETH_PORT_NONE, LTQ_ETH_PORT_NONE },
190 + { 1, 0x1, LTQ_ETH_PORT_NONE, LTQ_ETH_PORT_NONE },
192 + { 2, 0x11, LTQ_ETH_PORT_NONE, LTQ_ETH_PORT_NONE },
193 + /* GMAC3: unused */
194 + { 3, 0x0, LTQ_ETH_PORT_NONE, LTQ_ETH_PORT_NONE },
195 + /* GMAC4: internal GPHY1 with 10/100/1000 firmware for WANoE port */
196 + { 4, 0x13, LTQ_ETH_PORT_PHY, PHY_INTERFACE_MODE_GMII },
198 + { 5, 0x5, LTQ_ETH_PORT_NONE, LTQ_ETH_PORT_NONE },
201 +static const struct ltq_eth_board_config eth_board_config = {
202 + .ports = eth_port_config,
203 + .num_ports = ARRAY_SIZE(eth_port_config),
206 +int board_eth_init(bd_t * bis)
208 + const enum ltq_gphy_clk clk = LTQ_GPHY_CLK_25MHZ_PLL0;
209 + const ulong fw_ge_addr = 0x80FE0000;
211 + ltq_gphy_phy11g_a2x_load(fw_ge_addr);
213 + ltq_cgu_gphy_clk_src(clk);
215 + ltq_rcu_gphy_boot(0, fw_ge_addr);
216 + ltq_rcu_gphy_boot(1, fw_ge_addr);
218 + return ltq_eth_initialize(ð_board_config);
222 @@ -529,6 +529,7 @@ Active mips mips32 incai
223 Active mips mips32 incaip - incaip incaip_100MHz incaip:CPU_CLOCK_RATE=100000000 Wolfgang Denk <wd@denx.de>
224 Active mips mips32 incaip - incaip incaip_133MHz incaip:CPU_CLOCK_RATE=133000000 Wolfgang Denk <wd@denx.de>
225 Active mips mips32 incaip - incaip incaip_150MHz incaip:CPU_CLOCK_RATE=150000000 Wolfgang Denk <wd@denx.de>
226 +Active mips mips32 vrx200 arcadyan easybox904 easybox904_ram easybox904:SYS_BOOT_RAM Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
227 Active mips mips32 vrx200 avm fb3370 fb3370_eva fb3370:SYS_BOOT_EVA Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
228 Active mips mips32 vrx200 avm fb3370 fb3370_ram fb3370:SYS_BOOT_RAM Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
229 Active mips mips32 vrx200 avm fb3370 fb3370_sfspl fb3370:SYS_BOOT_SFSPL Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
231 +++ b/include/configs/easybox904.h
234 + * Copyright (C) 2012-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
236 + * SPDX-License-Identifier: GPL-2.0+
242 +#define CONFIG_MACH_TYPE "EASYBOX904"
243 +#define CONFIG_IDENT_STRING " "CONFIG_MACH_TYPE
244 +#define CONFIG_BOARD_NAME "Arcadyan EasyBox 904"
247 +#define CONFIG_LTQ_SUPPORT_UART /* Enable ASC and UART */
249 +#define CONFIG_LTQ_SUPPORT_ETHERNET /* Enable ethernet */
251 +#define CONFIG_LTQ_SUPPORT_NAND_FLASH
253 +#define CONFIG_SYS_DRAM_PROBE
256 +#define CONFIG_ENV_IS_NOWHERE
258 +#define CONFIG_ENV_SIZE (8 * 1024)
259 +#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
262 +#define CONFIG_LTQ_ADVANCED_CONSOLE
263 +#define CONFIG_BAUDRATE 115200
264 +#define CONFIG_CONSOLE_ASC 1
265 +#define CONFIG_CONSOLE_DEV "ttyLTQ1"
267 +/* Pull in default board configs for Lantiq XWAY VRX200 */
268 +#include <asm/lantiq/config.h>
269 +#include <asm/arch/config.h>
271 +/* Pull in default OpenWrt configs for Lantiq SoC */
272 +#include "openwrt-lantiq-common.h"
274 +#define CONFIG_EXTRA_ENV_SETTINGS \
275 + CONFIG_ENV_LANTIQ_DEFAULTS
277 +#endif /* __CONFIG_H */