1 // SPDX-License-Identifier: GPL-2.0+
11 #include <asm/arch/cpu.h>
12 #include <asm/arch/clk.h>
13 #include <asm/arch/wdt.h>
14 #include <asm/arch/sys_proto.h>
17 static struct clk_pm_regs *clk = (struct clk_pm_regs *)CLK_PM_BASE;
18 static struct wdt_regs *wdt = (struct wdt_regs *)WDT_BASE;
20 void reset_cpu(ulong addr)
22 /* Enable watchdog clock */
23 setbits_le32(&clk->timclk_ctrl, CLK_TIMCLK_WATCHDOG);
25 /* To be compatible with the original U-Boot code:
26 * addr: - 0: perform hard reset.
27 * - !=0: perform a soft reset; i.e. "RESOUT_N" not asserted). */
29 /* Reset pulse length is 13005 peripheral clock frames */
30 writel(13000, &wdt->pulse);
32 /* Force WDOG_RESET2 and RESOUT_N signal active */
33 writel(WDTIM_MCTRL_RESFRC2 | WDTIM_MCTRL_RESFRC1
34 | WDTIM_MCTRL_M_RES2, &wdt->mctrl);
36 /* Force match output active */
37 writel(0x01, &wdt->emr);
39 /* Internal reset on match output (no pulse on "RESOUT_N") */
40 writel(WDTIM_MCTRL_M_RES1, &wdt->mctrl);
47 #if defined(CONFIG_ARCH_CPU_INIT)
48 int arch_cpu_init(void)
51 * It might be necessary to flush data cache, if U-Boot is loaded
52 * from kickstart bootloader, e.g. from S1L loader
59 #error "You have to select CONFIG_ARCH_CPU_INIT"
62 #if defined(CONFIG_DISPLAY_CPUINFO)
63 int print_cpuinfo(void)
65 printf("CPU: NXP LPC32XX\n");
66 printf("CPU clock: %uMHz\n", get_hclk_pll_rate() / 1000000);
67 printf("AHB bus clock: %uMHz\n", get_hclk_clk_rate() / 1000000);
68 printf("Peripheral clock: %uMHz\n", get_periph_clk_rate() / 1000000);
74 #ifdef CONFIG_LPC32XX_ETH
75 int cpu_eth_init(struct bd_info *bis)
77 lpc32xx_eth_initialize(bis);