2 * board/mx1ads/mx1ads.c
5 * Techware Information Technology, Inc.
6 * http://www.techware.com.tw/
8 * Ming-Len Wu <minglen_wu@techware.com.tw>
10 * SPDX-License-Identifier: GPL-2.0+
15 /*#include <mc9328.h>*/
16 #include <asm/arch/imx-regs.h>
19 DECLARE_GLOBAL_DATA_PTR;
23 #if FCLK_SPEED==0 /* Fout = 203MHz, Fin = 12MHz for Audio */
27 #elif FCLK_SPEED==1 /* Fout = 202.8MHz */
47 static inline void delay (unsigned long loops)
49 __asm__ volatile ("1:\n"
51 "bne 1b":"=r" (loops):"0" (loops));
57 * Miscellaneous platform dependent initialisations
60 void SetAsynchMode (void)
62 __asm__ ("mrc p15,0,r0,c1,c0,0 \n"
63 "mov r2, #0xC0000000 \n"
64 "orr r0,r2,r0 \n" "mcr p15,0,r0,c1,c0,0 \n");
69 int board_early_init_f(void)
73 GPCR = 0x000003AB; /* I/O pad driving strength */
75 /* MX1_CS1U = 0x00000A00; */ /* SRAM initialization */
76 /* MX1_CS1L = 0x11110601; */
78 MPCTL0 = 0x04632410; /* setting for 150 MHz MCU PLL CLK */
80 /* set FCLK divider 1 (i.e. FCLK to MCU PLL CLK) and
81 * BCLK divider to 2 (i.e. BCLK to 48 MHz)
85 CSCR |= 0x00200000; /* Trigger the restart bit(bit 21) */
86 CSCR &= 0xFFFF7FFF; /* Program PRESC bit(bit 15) to 0 to divide-by-1 */
88 /* setup cs4 for cs8900 ethernet */
90 CS4U = 0x00000F00; /* Initialize CS4 for CS8900 ethernet */
93 GIUS (0) &= 0xFF3FFFFF;
94 GPR (0) &= 0xFF3FFFFF;
105 PCDR = 0x00000055; /* set PERCLKS */
107 /* PERCLK3 is only used by SSI so the SSI driver can set it any value it likes
108 * PERCLK1 and PERCLK2 are shared so DO NOT change it in any other place
109 * all sources selected as normal interrupt
120 gd->bd->bi_arch_number = MACH_TYPE_MX1ADS;
122 gd->bd->bi_boot_params = 0x08000100; /* adress of boot parameters */
127 int board_late_init (void)
130 setenv ("stdout", "serial");
131 setenv ("stderr", "serial");
135 printf ("MX1ADS board with MC9328 MX1 (0L44N), Silicon ID 0x%08x \n\n",
139 printf ("MX1ADS board with MC9328 MXL (1L45N), Silicon ID 0x%08x \n\n",
143 printf ("MX1ADS board with MC9328 MXL (2L45N), Silicon ID 0x%08x \n\n",
148 printf ("MX1ADS board with UNKNOWN MC9328 cpu, Silicon ID 0x%08x \n",
157 /* dram_init must store complete ramsize in gd->ram_size */
158 gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1,
163 void dram_init_banksize(void)
165 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
166 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
169 #ifdef CONFIG_CMD_NET
170 int board_eth_init(bd_t *bis)
174 rc = cs8900_initialize(0, CONFIG_CS8900_BASE);