uboot-lantiq: update to v2013.10
[openwrt/staging/wigyori.git] / package / boot / uboot-lantiq / patches / 0028-MIPS-add-board-support-for-AudioCodes-MP-252.patch
1 From 4bacfc80eae768be45f9ddf7588ec55281354648 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel.golle@gmail.com>
3 Date: Fri, 8 Mar 2013 13:29:04 +0200
4 Subject: MIPS: add board support for AudioCodes MP-252
5
6 Signed-off-by: Daniel Golle <dgolle@allnet.de>
7
8 diff --git a/board/audiocodes/acmp252/Makefile b/board/audiocodes/acmp252/Makefile
9 new file mode 100644
10 index 0000000..3a547c2
11 --- /dev/null
12 +++ b/board/audiocodes/acmp252/Makefile
13 @@ -0,0 +1,27 @@
14 +#
15 +# Copyright (C) 2000-2011 Wolfgang Denk, DENX Software Engineering, wd@denx.de
16 +#
17 +# SPDX-License-Identifier: GPL-2.0+
18 +#
19 +
20 +include $(TOPDIR)/config.mk
21 +
22 +LIB = $(obj)lib$(BOARD).o
23 +
24 +COBJS = $(BOARD).o
25 +
26 +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
27 +OBJS := $(addprefix $(obj),$(COBJS))
28 +SOBJS := $(addprefix $(obj),$(SOBJS))
29 +
30 +$(LIB): $(obj).depend $(OBJS) $(SOBJS)
31 + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
32 +
33 +#########################################################################
34 +
35 +# defines $(obj).depend target
36 +include $(SRCTREE)/rules.mk
37 +
38 +sinclude $(obj).depend
39 +
40 +#########################################################################
41 diff --git a/board/audiocodes/acmp252/acmp252.c b/board/audiocodes/acmp252/acmp252.c
42 new file mode 100644
43 index 0000000..3368506
44 --- /dev/null
45 +++ b/board/audiocodes/acmp252/acmp252.c
46 @@ -0,0 +1,66 @@
47 +/*
48 + * Copyright (C) 2013 Daniel Golle <daniel.golle@gmail.com>
49 + * Copyright (C) 2011 Luka Perkov <luka@openwrt.org>
50 + *
51 + * SPDX-License-Identifier: GPL-2.0+
52 + */
53 +
54 +#include <common.h>
55 +#include <switch.h>
56 +#include <asm/gpio.h>
57 +#include <asm/lantiq/eth.h>
58 +#include <asm/lantiq/reset.h>
59 +#include <asm/lantiq/chipid.h>
60 +
61 +static void gpio_init(void)
62 +{
63 + /* Activate reset line of ADM6996I switch */
64 + gpio_direction_output(19, 0);
65 +}
66 +
67 +int board_early_init_f(void)
68 +{
69 + gpio_init();
70 +
71 + return 0;
72 +}
73 +
74 +int checkboard(void)
75 +{
76 + puts("Board: " CONFIG_BOARD_NAME "\n");
77 + ltq_chip_print_info();
78 +
79 + return 0;
80 +}
81 +
82 +static const struct ltq_eth_port_config eth_port_config[] = {
83 + /* MAC0: Lantiq ADM6996I switch */
84 + { 0, 0x0, LTQ_ETH_PORT_SWITCH, PHY_INTERFACE_MODE_RMII },
85 +};
86 +
87 +static const struct ltq_eth_board_config eth_board_config = {
88 + .ports = eth_port_config,
89 + .num_ports = ARRAY_SIZE(eth_port_config),
90 +};
91 +
92 +int board_eth_init(bd_t *bis)
93 +{
94 + return ltq_eth_initialize(&eth_board_config);
95 +}
96 +
97 +static struct switch_device adm6996i_dev = {
98 + .name = "adm6996i",
99 + .cpu_port = 5,
100 + .port_mask = 0xF,
101 +};
102 +
103 +int board_switch_init(void)
104 +{
105 + /* Deactivate reset line of ADM6996I switch */
106 + gpio_set_value(19, 1);
107 +
108 + /* ADM6996I needs some time to come out of reset */
109 + __udelay(50000);
110 +
111 + return switch_device_register(&adm6996i_dev);
112 +}
113 diff --git a/board/audiocodes/acmp252/config.mk b/board/audiocodes/acmp252/config.mk
114 new file mode 100644
115 index 0000000..9d8953b
116 --- /dev/null
117 +++ b/board/audiocodes/acmp252/config.mk
118 @@ -0,0 +1,7 @@
119 +#
120 +# Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
121 +#
122 +# SPDX-License-Identifier: GPL-2.0+
123 +#
124 +
125 +PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(BOARDDIR)
126 diff --git a/board/audiocodes/acmp252/ddr_settings.h b/board/audiocodes/acmp252/ddr_settings.h
127 new file mode 100644
128 index 0000000..d0b4f20
129 --- /dev/null
130 +++ b/board/audiocodes/acmp252/ddr_settings.h
131 @@ -0,0 +1,55 @@
132 +/*
133 + * Copyright (C) 2011-2013 Luka Perkov <luka@openwrt.org>
134 + *
135 + * This file has been generated with lantiq_ram_extract_magic.awk script.
136 + *
137 + * SPDX-License-Identifier: GPL-2.0+
138 + */
139 +
140 +#define MC_DC00_VALUE 0x1B1B
141 +#define MC_DC01_VALUE 0x0
142 +#define MC_DC02_VALUE 0x0
143 +#define MC_DC03_VALUE 0x0
144 +#define MC_DC04_VALUE 0x0
145 +#define MC_DC05_VALUE 0x200
146 +#define MC_DC06_VALUE 0x605
147 +#define MC_DC07_VALUE 0x403
148 +#define MC_DC08_VALUE 0x103
149 +#define MC_DC09_VALUE 0x80B
150 +#define MC_DC10_VALUE 0x304
151 +#define MC_DC11_VALUE 0xD03
152 +#define MC_DC12_VALUE 0x2C8
153 +#define MC_DC13_VALUE 0x1
154 +#define MC_DC14_VALUE 0x0
155 +#define MC_DC15_VALUE 0x13C
156 +#define MC_DC16_VALUE 0xC800
157 +#define MC_DC17_VALUE 0xD
158 +#define MC_DC18_VALUE 0x402
159 +#define MC_DC19_VALUE 0x200
160 +#define MC_DC20_VALUE 0xA03
161 +#define MC_DC21_VALUE 0x1700
162 +#define MC_DC22_VALUE 0x1717
163 +#define MC_DC23_VALUE 0x0
164 +#define MC_DC24_VALUE 0x5C
165 +#define MC_DC25_VALUE 0x0
166 +#define MC_DC26_VALUE 0x0
167 +#define MC_DC27_VALUE 0x0
168 +#define MC_DC28_VALUE 0x510
169 +#define MC_DC29_VALUE 0x2D93
170 +#define MC_DC30_VALUE 0x8300
171 +#define MC_DC31_VALUE 0x0
172 +#define MC_DC32_VALUE 0x0
173 +#define MC_DC33_VALUE 0x0
174 +#define MC_DC34_VALUE 0x0
175 +#define MC_DC35_VALUE 0x0
176 +#define MC_DC36_VALUE 0x0
177 +#define MC_DC37_VALUE 0x0
178 +#define MC_DC38_VALUE 0x0
179 +#define MC_DC39_VALUE 0x0
180 +#define MC_DC40_VALUE 0x0
181 +#define MC_DC41_VALUE 0x0
182 +#define MC_DC42_VALUE 0x0
183 +#define MC_DC43_VALUE 0x0
184 +#define MC_DC44_VALUE 0x0
185 +#define MC_DC45_VALUE 0x500
186 +#define MC_DC46_VALUE 0x0
187 diff --git a/boards.cfg b/boards.cfg
188 index e832423..9f407b8 100644
189 --- a/boards.cfg
190 +++ b/boards.cfg
191 @@ -508,6 +508,8 @@ Active mips mips32 danube arcadyan arv4519pw
192 Active mips mips32 danube arcadyan arv7518pw arv7518pw_brn arv7518pw:SYS_BOOT_BRN Luka Perkov <luka@openwrt.org>
193 Active mips mips32 danube arcadyan arv7518pw arv7518pw_nor arv7518pw:SYS_BOOT_NOR Luka Perkov <luka@openwrt.org>
194 Active mips mips32 danube arcadyan arv7518pw arv7518pw_ram arv7518pw:SYS_BOOT_RAM Luka Perkov <luka@openwrt.org>
195 +Active mips mips32 danube audiocodes acmp252 acmp252_nor acmp252:SYS_BOOT_NOR Daniel Golle <daniel.golle@gmail.com>
196 +Active mips mips32 danube audiocodes acmp252 acmp252_ram acmp252:SYS_BOOT_RAM Daniel Golle <daniel.golle@gmail.com>
197 Active mips mips32 danube lantiq easy50712 easy50712_nor easy50712:SYS_BOOT_NOR Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
198 Active mips mips32 danube lantiq easy50712 easy50712_norspl easy50712:SYS_BOOT_NORSPL Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
199 Active mips mips32 danube lantiq easy50712 easy50712_ram easy50712:SYS_BOOT_RAM Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
200 diff --git a/include/configs/acmp252.h b/include/configs/acmp252.h
201 new file mode 100644
202 index 0000000..2c9ab19
203 --- /dev/null
204 +++ b/include/configs/acmp252.h
205 @@ -0,0 +1,60 @@
206 +/*
207 + * Copyright (C) 2013 Daniel Golle <daniel.golle@gmail.com>
208 + * Copyright (C) 2011 Luka Perkov <luka@openwrt.org>
209 + *
210 + * SPDX-License-Identifier: GPL-2.0+
211 + */
212 +
213 +#ifndef __CONFIG_H
214 +#define __CONFIG_H
215 +
216 +#define CONFIG_MACH_TYPE "ACMP252"
217 +#define CONFIG_IDENT_STRING " "CONFIG_MACH_TYPE
218 +#define CONFIG_BOARD_NAME "AudioCodes MP-252"
219 +
220 +/* Configure SoC */
221 +#define CONFIG_LTQ_SUPPORT_UART /* Enable ASC and UART */
222 +
223 +#define CONFIG_LTQ_SUPPORT_ETHERNET /* Enable ethernet */
224 +
225 +#define CONFIG_LTQ_SUPPORT_NOR_FLASH /* Have a parallel NOR flash */
226 +
227 +/* Switch devices */
228 +#define CONFIG_SWITCH_MULTI
229 +#define CONFIG_SWITCH_ADM6996I
230 +
231 +/* Environment */
232 +#if defined(CONFIG_SYS_BOOT_NOR)
233 +#define CONFIG_ENV_IS_IN_FLASH
234 +#define CONFIG_ENV_OVERWRITE
235 +#define CONFIG_ENV_OFFSET (256 * 1024)
236 +#define CONFIG_ENV_SECT_SIZE (128 * 1024)
237 +#else
238 +#define CONFIG_ENV_IS_NOWHERE
239 +#endif
240 +
241 +#define CONFIG_ENV_SIZE (8 * 1024)
242 +#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
243 +
244 +/* Console */
245 +#define CONFIG_LTQ_ADVANCED_CONSOLE
246 +#define CONFIG_BAUDRATE 115200
247 +#define CONFIG_CONSOLE_ASC 1
248 +#define CONFIG_CONSOLE_DEV "ttyLTQ1"
249 +
250 +/* Pull in default board configs for Lantiq XWAY Danube */
251 +#include <asm/lantiq/config.h>
252 +#include <asm/arch/config.h>
253 +
254 +/* Pull in default OpenWrt configs for Lantiq SoC */
255 +#include "openwrt-lantiq-common.h"
256 +
257 +#define CONFIG_ENV_UPDATE_UBOOT_NOR \
258 + "update-uboot-nor=run load-uboot-nor write-uboot-nor\0"
259 +
260 +#define CONFIG_EXTRA_ENV_SETTINGS \
261 + CONFIG_ENV_LANTIQ_DEFAULTS \
262 + CONFIG_ENV_UPDATE_UBOOT_NOR \
263 + "kernel_addr=0xB0040000\0"
264 +
265 +#endif /* __CONFIG_H */
266 --
267 1.8.3.2
268