diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/MAI/AmigaOneG3SE/enet.c | 16 | ||||
-rw-r--r-- | board/MAI/AmigaOneG3SE/flash_new.c | 10 | ||||
-rw-r--r-- | board/MAI/AmigaOneG3SE/serial.c | 6 | ||||
-rw-r--r-- | board/MAI/AmigaOneG3SE/via686.c | 2 | ||||
-rw-r--r-- | board/ids8247/ids8247.c | 92 | ||||
-rw-r--r-- | board/trab/vfd.c | 2 |
6 files changed, 102 insertions, 26 deletions
diff --git a/board/MAI/AmigaOneG3SE/enet.c b/board/MAI/AmigaOneG3SE/enet.c index ac969a9..b9df55c 100644 --- a/board/MAI/AmigaOneG3SE/enet.c +++ b/board/MAI/AmigaOneG3SE/enet.c @@ -297,50 +297,50 @@ static void eth_3com_halt(struct eth_device* dev); static inline int ETH_INL(struct eth_device* dev, u_long addr) { - __asm volatile ("eieio"); + __asm__ volatile ("eieio"); return le32_to_cpu(*(volatile u32 *)io_to_phys(addr + dev->iobase)); } static inline int ETH_INW(struct eth_device* dev, u_long addr) { - __asm volatile ("eieio"); + __asm__ volatile ("eieio"); return le16_to_cpu(*(volatile u16 *)io_to_phys(addr + dev->iobase)); } static inline int ETH_INB(struct eth_device* dev, u_long addr) { - __asm volatile ("eieio"); + __asm__ volatile ("eieio"); return *(volatile u8 *)io_to_phys(addr + dev->iobase); } static inline void ETH_OUTB(struct eth_device* dev, int command, u_long addr) { *(volatile u8 *)io_to_phys(addr + dev->iobase) = command; - __asm volatile ("eieio"); + __asm__ volatile ("eieio"); } static inline void ETH_OUTW(struct eth_device* dev, int command, u_long addr) { *(volatile u16 *)io_to_phys(addr + dev->iobase) = cpu_to_le16(command); - __asm volatile ("eieio"); + __asm__ volatile ("eieio"); } static inline void ETH_OUTL(struct eth_device* dev, int command, u_long addr) { *(volatile u32 *)io_to_phys(addr + dev->iobase) = cpu_to_le32(command); - __asm volatile ("eieio"); + __asm__ volatile ("eieio"); } static inline int ETH_STATUS(struct eth_device* dev) { - __asm volatile ("eieio"); + __asm__ volatile ("eieio"); return le16_to_cpu(*(volatile u16 *)io_to_phys(EL3_STATUS + dev->iobase)); } static inline void ETH_CMD(struct eth_device* dev, int command) { *(volatile u16 *)io_to_phys(EL3_CMD + dev->iobase) = cpu_to_le16(command); - __asm volatile ("eieio"); + __asm__ volatile ("eieio"); } /* Command register is always in the same spot in all the register windows */ diff --git a/board/MAI/AmigaOneG3SE/flash_new.c b/board/MAI/AmigaOneG3SE/flash_new.c index 7b7ea16..9beb048 100644 --- a/board/MAI/AmigaOneG3SE/flash_new.c +++ b/board/MAI/AmigaOneG3SE/flash_new.c @@ -153,14 +153,14 @@ static ulong flash_get_size (ulong addr, flash_info_t *info) /* Write auto select command: read Manufacturer ID */ x[0x0555] = 0xAA; - __asm volatile ("sync\n eieio"); + __asm__ volatile ("sync\n eieio"); x[0x02AA] = 0x55; - __asm volatile ("sync\n eieio"); + __asm__ volatile ("sync\n eieio"); x[0x0555] = 0x90; - __asm volatile ("sync\n eieio"); + __asm__ volatile ("sync\n eieio"); value = x[0]; - __asm volatile ("sync\n eieio"); + __asm__ volatile ("sync\n eieio"); DEBUGF("Manuf. ID @ 0x%08lx: 0x%08x\n", (ulong)addr, value); @@ -186,7 +186,7 @@ static ulong flash_get_size (ulong addr, flash_info_t *info) } value = x[1]; - __asm volatile ("sync\n eieio"); + __asm__ volatile ("sync\n eieio"); DEBUGF("Device ID @ 0x%08lx: 0x%08x\n", addr+1, value); diff --git a/board/MAI/AmigaOneG3SE/serial.c b/board/MAI/AmigaOneG3SE/serial.c index 88039f3..84a913e 100644 --- a/board/MAI/AmigaOneG3SE/serial.c +++ b/board/MAI/AmigaOneG3SE/serial.c @@ -75,17 +75,17 @@ void serial_init (void) /* COM_WRITE_BYTE(LINE_CONTROL, 0x83); */ /* COM_WRITE_BYTE(DIVISOR_LATCH_LSB, (uint8)(clock_divisor & 0xFF)); */ /* COM_WRITE_BYTE(DIVISOR_LATCH_MSB, (uint8)(clock_divisor >> 8)); */ - /* __asm("eieio"); */ + /* __asm__("eieio"); */ /* Set 8-N-1 */ COM_WRITE_BYTE (LINE_CONTROL, 0x03); - __asm ("eieio"); + __asm__ ("eieio"); /* Disable FIFO */ COM_WRITE_BYTE (MODEM_CONTROL, 0x03); COM_WRITE_BYTE (FIFO_CONTROL, 0x07); - __asm ("eieio"); + __asm__ ("eieio"); serial_init_done = 1; } diff --git a/board/MAI/AmigaOneG3SE/via686.c b/board/MAI/AmigaOneG3SE/via686.c index 2427ce5..752a464 100644 --- a/board/MAI/AmigaOneG3SE/via686.c +++ b/board/MAI/AmigaOneG3SE/via686.c @@ -211,7 +211,7 @@ void via_cfgfunc_via686(struct pci_controller *host, pci_dev_t dev, struct pci_c } } -__asm (" .globl via_calibrate_time_base \n" +__asm__ (" .globl via_calibrate_time_base \n" "via_calibrate_time_base: \n" " lis 9, 0xfe00 \n" " li 0, 0x00 \n" diff --git a/board/ids8247/ids8247.c b/board/ids8247/ids8247.c index 68b7070..79fe9da 100644 --- a/board/ids8247/ids8247.c +++ b/board/ids8247/ids8247.c @@ -304,21 +304,97 @@ phys_size_t initdram (int board_type) int misc_init_r (void) { gd->bd->bi_flashstart = 0xff800000; + return 0; } #if defined(CONFIG_CMD_NAND) -extern ulong -nand_probe (ulong physadr); +#include <nand.h> +#include <linux/mtd/mtd.h> +#include <asm/io.h> + +static u8 hwctl; + +static void ids_nand_hwctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) +{ + struct nand_chip *this = mtd->priv; + + if (ctrl & NAND_CTRL_CHANGE) { + if ( ctrl & NAND_CLE ) { + hwctl |= 0x1; + writeb(0x00, (this->IO_ADDR_W + 0x0a)); + } else { + hwctl &= ~0x1; + writeb(0x00, (this->IO_ADDR_W + 0x08)); + } + if ( ctrl & NAND_ALE ) { + hwctl |= 0x2; + writeb(0x00, (this->IO_ADDR_W + 0x09)); + } else { + hwctl &= ~0x2; + writeb(0x00, (this->IO_ADDR_W + 0x08)); + } + if ( (ctrl & NAND_NCE) != NAND_NCE) + writeb(0x00, (this->IO_ADDR_W + 0x0c)); + else + writeb(0x00, (this->IO_ADDR_W + 0x08)); + } + if (cmd != NAND_CMD_NONE) + writeb(cmd, this->IO_ADDR_W); + +} -void -nand_init (void) +static u_char ids_nand_read_byte(struct mtd_info *mtd) { - ulong totlen = 0; + struct nand_chip *this = mtd->priv; - debug ("Probing at 0x%.8x\n", CONFIG_SYS_NAND0_BASE); - totlen += nand_probe (CONFIG_SYS_NAND0_BASE); + return readb(this->IO_ADDR_R); +} + +static void ids_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) +{ + struct nand_chip *nand = mtd->priv; + int i; + + for (i = 0; i < len; i++) { + if (hwctl & 0x1) + writeb(buf[i], (nand->IO_ADDR_W + 0x02)); + else if (hwctl & 0x2) + writeb(buf[i], (nand->IO_ADDR_W + 0x01)); + else + writeb(buf[i], nand->IO_ADDR_W); + } +} - printf ("%4lu MB\n", totlen >>20); +static void ids_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) +{ + struct nand_chip *this = mtd->priv; + int i; + + for (i = 0; i < len; i++) { + buf[i] = readb(this->IO_ADDR_R); + } +} + +static int ids_nand_dev_ready(struct mtd_info *mtd) +{ + /* constant delay (see also tR in the datasheet) */ + udelay(12); + return 1; +} + +int board_nand_init(struct nand_chip *nand) +{ + nand->ecc.mode = NAND_ECC_SOFT; + + /* Reference hardware control function */ + nand->cmd_ctrl = ids_nand_hwctrl; + nand->read_byte = ids_nand_read_byte; + nand->write_buf = ids_nand_write_buf; + nand->read_buf = ids_nand_read_buf; + nand->dev_ready = ids_nand_dev_ready; + nand->chip_delay = 12; + + return 0; } #endif /* CONFIG_CMD_NAND */ diff --git a/board/trab/vfd.c b/board/trab/vfd.c index eb506f3..37d3aa4 100644 --- a/board/trab/vfd.c +++ b/board/trab/vfd.c @@ -369,7 +369,7 @@ int vfd_init_clocks (void) gpio->PCCON = (gpio->PCCON & 0xFFFFFF00); /* configure GPC0...GPC3 as inputs */ /* allow signals to settle */ for (i=0; i<10000; i++) /* udelay isn't working yet at this point! */ - __asm("NOP"); + __asm__("NOP"); vfd_board_id = (~gpio->PCDAT) & 0x000F; /* read GPC0...GPC3 port pins */ VFD_DISABLE; /* activate blank for the vfd */ |