]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/zipitz2/zipitz2.c
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>
32 DECLARE_GLOBAL_DATA_PTR
;
37 inline void lcd_start(void) {};
41 * Miscelaneous platform dependent initialisations
46 /* memory and cpu-speed are setup before relocation */
47 /* so we do _nothing_ here */
49 /* arch number of Lubbock-Board */
50 gd
->bd
->bi_arch_number
= MACH_TYPE_ZIPIT2
;
52 /* adress of boot parameters */
53 gd
->bd
->bi_boot_params
= 0xa0000100;
61 int board_late_init(void)
63 setenv("stdout", "serial");
64 setenv("stderr", "serial");
68 struct serial_device
*default_serial_console (void)
70 return &serial_stuart_device
;
75 gd
->bd
->bi_dram
[0].start
= PHYS_SDRAM_1
;
76 gd
->bd
->bi_dram
[0].size
= PHYS_SDRAM_1_SIZE
;
95 { 0x13, 0x0070, 200 },
121 { 0x07, 0x0015, 30 },
128 void zipitz2_spi_sda(int set
)
137 void zipitz2_spi_scl(int set
)
146 unsigned char zipitz2_spi_read(void)
149 return !!(GPLR1
& (1 << 8));
152 int spi_cs_is_valid(unsigned int bus
, unsigned int cs
)
158 void spi_cs_activate(struct spi_slave
*slave
)
164 void spi_cs_deactivate(struct spi_slave
*slave
)
174 unsigned char reg
[3] = { 0x74, 0x00, 0 };
175 unsigned char data
[3] = { 0x76, 0, 0 };
176 unsigned char dummy
[3] = { 0, 0, 0 };
179 GAFR0_L
|= 0x00800000;
180 /* Enable clock to all PWM */
187 /* Toggle the reset pin to reset the LCD */
195 /* Program the LCD init sequence */
196 for (i
= 0; i
< sizeof(lcd_data
) / sizeof(lcd_data
[0]); i
++) {
199 reg
[2] = lcd_data
[i
].reg
;
200 spi_xfer(NULL
, 24, reg
, dummy
, SPI_XFER_BEGIN
| SPI_XFER_END
);
203 data
[1] = lcd_data
[i
].data
>> 8;
204 data
[2] = lcd_data
[i
].data
& 0xff;
205 spi_xfer(NULL
, 24, data
, dummy
, SPI_XFER_BEGIN
| SPI_XFER_END
);
207 if (lcd_data
[i
].mdelay
)
208 udelay(lcd_data
[i
].mdelay
* 1000);