3 * Marek Vasut <marek.vasut@gmail.com>
5 * Heavily based on pxa255_idp platform
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 #include <asm/arch/hardware.h>
33 DECLARE_GLOBAL_DATA_PTR;
38 inline void lcd_start(void) {};
42 * Miscelaneous platform dependent initialisations
47 /* memory and cpu-speed are setup before relocation */
48 /* so we do _nothing_ here */
50 /* arch number of Lubbock-Board */
51 gd->bd->bi_arch_number = MACH_TYPE_ZIPIT2;
53 /* adress of boot parameters */
54 gd->bd->bi_boot_params = 0xa0000100;
62 int board_late_init(void)
64 setenv("stdout", "serial");
65 setenv("stderr", "serial");
69 struct serial_device *default_serial_console (void)
71 return &serial_stuart_device;
76 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
77 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
96 { 0x13, 0x0070, 200 },
122 { 0x07, 0x0015, 30 },
129 void zipitz2_spi_sda(int set)
133 writel((1 << 13), GPSR0);
135 writel((1 << 13), GPCR0);
138 void zipitz2_spi_scl(int set)
142 writel((1 << 22), GPCR0);
144 writel((1 << 22), GPSR0);
147 unsigned char zipitz2_spi_read(void)
150 return !!(readl(GPLR1) & (1 << 8));
153 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
159 void spi_cs_activate(struct spi_slave *slave)
162 writel((1 << 24), GPCR2);
165 void spi_cs_deactivate(struct spi_slave *slave)
168 writel((1 << 24), GPSR2);
175 unsigned char reg[3] = { 0x74, 0x00, 0 };
176 unsigned char data[3] = { 0x76, 0, 0 };
177 unsigned char dummy[3] = { 0, 0, 0 };
180 writel(readl(GAFR0_L) | 0x00800000, GAFR0_L);
181 /* Enable clock to all PWM */
182 writel(readl(CKEN) | 0x3, CKEN);
184 writel(0x4f, PWM_CTRL2);
185 writel(0x2ff, PWM_PWDUTY2);
186 writel(792, PWM_PERVAL2);
188 /* Toggle the reset pin to reset the LCD */
189 writel((1 << 19), GPSR0);
191 writel((1 << 19), GPCR0);
193 writel((1 << 19), GPSR0);
196 /* Program the LCD init sequence */
197 for (i = 0; i < sizeof(lcd_data) / sizeof(lcd_data[0]); i++) {
200 reg[2] = lcd_data[i].reg;
201 spi_xfer(NULL, 24, reg, dummy, SPI_XFER_BEGIN | SPI_XFER_END);
204 data[1] = lcd_data[i].data >> 8;
205 data[2] = lcd_data[i].data & 0xff;
206 spi_xfer(NULL, 24, data, dummy, SPI_XFER_BEGIN | SPI_XFER_END);
208 if (lcd_data[i].mdelay)
209 udelay(lcd_data[i].mdelay * 1000);
212 writel((1 << 11), GPSR0);