1 // SPDX-License-Identifier: GPL-2.0+
3 * WORK Microwave work_92105 board support
5 * (C) Copyright 2014 DENX Software Engineering GmbH
6 * Written-by: Albert ARIBAUD <albert.aribaud@3adev.fr>
12 #include <asm/arch/sys_proto.h>
13 #include <asm/arch/cpu.h>
14 #include <asm/arch/clk.h>
15 #include <asm/arch/emc.h>
16 #include <asm/arch/wdt.h>
19 #include <linux/delay.h>
20 #include "work_92105_display.h"
22 DECLARE_GLOBAL_DATA_PTR;
24 static struct clk_pm_regs *clk = (struct clk_pm_regs *)CLK_PM_BASE;
25 static struct wdt_regs *wdt = (struct wdt_regs *)WDT_BASE;
27 void reset_periph(void)
29 setbits_le32(&clk->timclk_ctrl, CLK_TIMCLK_WATCHDOG);
30 writel(WDTIM_MCTRL_RESFRC1, &wdt->mctrl);
32 writel(0, &wdt->mctrl);
33 clrbits_le32(&clk->timclk_ctrl, CLK_TIMCLK_WATCHDOG);
36 int board_early_init_f(void)
38 /* initialize serial port for console */
39 lpc32xx_uart_init(CONFIG_SYS_LPC32XX_UART);
40 /* enable I2C, SSP, MAC, NAND */
41 lpc32xx_i2c_init(1); /* only I2C1 has devices, I2C2 has none */
44 lpc32xx_mlc_nand_init();
45 /* Display must wait until after relocation and devices init */
51 int board_early_init_r(void)
53 /* Set NAND !WP to 1 through GPO_19 */
54 gpio_request(GPO_19, "NAND_nWP");
55 gpio_direction_output(GPO_19, 1);
57 #ifdef CONFIG_DEPRECATED
58 /* initialize display */
59 work_92105_display_init();
68 /* adress of boot parameters */
69 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
76 gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
77 CONFIG_SYS_SDRAM_SIZE);