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
6 Signed-off-by: Daniel Golle <dgolle@allnet.de>
8 diff --git a/board/audiocodes/acmp252/Makefile b/board/audiocodes/acmp252/Makefile
10 index 0000000..3a547c2
12 +++ b/board/audiocodes/acmp252/Makefile
15 +# Copyright (C) 2000-2011 Wolfgang Denk, DENX Software Engineering, wd@denx.de
17 +# SPDX-License-Identifier: GPL-2.0+
20 +include $(TOPDIR)/config.mk
22 +LIB = $(obj)lib$(BOARD).o
26 +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
27 +OBJS := $(addprefix $(obj),$(COBJS))
28 +SOBJS := $(addprefix $(obj),$(SOBJS))
30 +$(LIB): $(obj).depend $(OBJS) $(SOBJS)
31 + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
33 +#########################################################################
35 +# defines $(obj).depend target
36 +include $(SRCTREE)/rules.mk
38 +sinclude $(obj).depend
40 +#########################################################################
41 diff --git a/board/audiocodes/acmp252/acmp252.c b/board/audiocodes/acmp252/acmp252.c
43 index 0000000..3368506
45 +++ b/board/audiocodes/acmp252/acmp252.c
48 + * Copyright (C) 2013 Daniel Golle <daniel.golle@gmail.com>
49 + * Copyright (C) 2011 Luka Perkov <luka@openwrt.org>
51 + * SPDX-License-Identifier: GPL-2.0+
56 +#include <asm/gpio.h>
57 +#include <asm/lantiq/eth.h>
58 +#include <asm/lantiq/reset.h>
59 +#include <asm/lantiq/chipid.h>
61 +static void gpio_init(void)
63 + /* Activate reset line of ADM6996I switch */
64 + gpio_direction_output(19, 0);
67 +int board_early_init_f(void)
76 + puts("Board: " CONFIG_BOARD_NAME "\n");
77 + ltq_chip_print_info();
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 },
87 +static const struct ltq_eth_board_config eth_board_config = {
88 + .ports = eth_port_config,
89 + .num_ports = ARRAY_SIZE(eth_port_config),
92 +int board_eth_init(bd_t *bis)
94 + return ltq_eth_initialize(ð_board_config);
97 +static struct switch_device adm6996i_dev = {
103 +int board_switch_init(void)
105 + /* Deactivate reset line of ADM6996I switch */
106 + gpio_set_value(19, 1);
108 + /* ADM6996I needs some time to come out of reset */
111 + return switch_device_register(&adm6996i_dev);
113 diff --git a/board/audiocodes/acmp252/config.mk b/board/audiocodes/acmp252/config.mk
115 index 0000000..9d8953b
117 +++ b/board/audiocodes/acmp252/config.mk
120 +# Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
122 +# SPDX-License-Identifier: GPL-2.0+
125 +PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(BOARDDIR)
126 diff --git a/board/audiocodes/acmp252/ddr_settings.h b/board/audiocodes/acmp252/ddr_settings.h
128 index 0000000..d0b4f20
130 +++ b/board/audiocodes/acmp252/ddr_settings.h
133 + * Copyright (C) 2011-2013 Luka Perkov <luka@openwrt.org>
135 + * This file has been generated with lantiq_ram_extract_magic.awk script.
137 + * SPDX-License-Identifier: GPL-2.0+
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
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
202 index 0000000..2c9ab19
204 +++ b/include/configs/acmp252.h
207 + * Copyright (C) 2013 Daniel Golle <daniel.golle@gmail.com>
208 + * Copyright (C) 2011 Luka Perkov <luka@openwrt.org>
210 + * SPDX-License-Identifier: GPL-2.0+
216 +#define CONFIG_MACH_TYPE "ACMP252"
217 +#define CONFIG_IDENT_STRING " "CONFIG_MACH_TYPE
218 +#define CONFIG_BOARD_NAME "AudioCodes MP-252"
221 +#define CONFIG_LTQ_SUPPORT_UART /* Enable ASC and UART */
223 +#define CONFIG_LTQ_SUPPORT_ETHERNET /* Enable ethernet */
225 +#define CONFIG_LTQ_SUPPORT_NOR_FLASH /* Have a parallel NOR flash */
227 +/* Switch devices */
228 +#define CONFIG_SWITCH_MULTI
229 +#define CONFIG_SWITCH_ADM6996I
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)
238 +#define CONFIG_ENV_IS_NOWHERE
241 +#define CONFIG_ENV_SIZE (8 * 1024)
242 +#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
245 +#define CONFIG_LTQ_ADVANCED_CONSOLE
246 +#define CONFIG_BAUDRATE 115200
247 +#define CONFIG_CONSOLE_ASC 1
248 +#define CONFIG_CONSOLE_DEV "ttyLTQ1"
250 +/* Pull in default board configs for Lantiq XWAY Danube */
251 +#include <asm/lantiq/config.h>
252 +#include <asm/arch/config.h>
254 +/* Pull in default OpenWrt configs for Lantiq SoC */
255 +#include "openwrt-lantiq-common.h"
257 +#define CONFIG_ENV_UPDATE_UBOOT_NOR \
258 + "update-uboot-nor=run load-uboot-nor write-uboot-nor\0"
260 +#define CONFIG_EXTRA_ENV_SETTINGS \
261 + CONFIG_ENV_LANTIQ_DEFAULTS \
262 + CONFIG_ENV_UPDATE_UBOOT_NOR \
263 + "kernel_addr=0xB0040000\0"
265 +#endif /* __CONFIG_H */