diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/MCD_tasks.c | 6 | ||||
-rw-r--r-- | drivers/mtd/dataflash.c | 2 | ||||
-rw-r--r-- | drivers/mtd/jedec_flash.c | 4 | ||||
-rw-r--r-- | drivers/net/cs8900.c | 4 | ||||
-rw-r--r-- | drivers/net/lan91c96.c | 20 | ||||
-rw-r--r-- | drivers/net/netarm_eth.c | 4 | ||||
-rw-r--r-- | drivers/net/rtl8019.c | 7 | ||||
-rw-r--r-- | drivers/net/rtl8169.c | 2 | ||||
-rw-r--r-- | drivers/qe/Makefile | 3 | ||||
-rw-r--r-- | drivers/qe/fdt.c | 90 | ||||
-rw-r--r-- | drivers/qe/qe.h | 1 | ||||
-rw-r--r-- | drivers/rtc/rx8025.c | 5 | ||||
-rw-r--r-- | drivers/serial/ns16550.c | 16 | ||||
-rw-r--r-- | drivers/spi/mpc8xxx_spi.c | 4 |
14 files changed, 129 insertions, 39 deletions
diff --git a/drivers/dma/MCD_tasks.c b/drivers/dma/MCD_tasks.c index 694e780..06a2d53 100644 --- a/drivers/dma/MCD_tasks.c +++ b/drivers/dma/MCD_tasks.c @@ -22,6 +22,10 @@ /* Contains task code and structures for Multi-channel DMA */ +#include <common.h> + +#ifdef CONFIG_FSLDMAFEC + #include <MCD_dma.h> u32 MCD_varTab0[]; @@ -2426,3 +2430,5 @@ u32 MCD_ENetXmit_TDT[] = { #ifdef MCD_INCLUDE_EU MCD_bufDesc MCD_singleBufDescs[NCHANNELS]; #endif + +#endif /* CONFIG_FSLDMAFEC */ diff --git a/drivers/mtd/dataflash.c b/drivers/mtd/dataflash.c index 91903c8..3ebb706 100644 --- a/drivers/mtd/dataflash.c +++ b/drivers/mtd/dataflash.c @@ -304,7 +304,7 @@ AT91PS_DataFlash AT91F_DataflashSelect (AT91PS_DataFlash pFlash, for (i = 0; i < CFG_MAX_DATAFLASH_BANKS; i++) if ( dataflash_info[i].id - && ((((int) addr) & 0xFF000000) == + && ((((int) *addr) & 0xFF000000) == dataflash_info[i].logical_address)) { addr_valid = 1; break; diff --git a/drivers/mtd/jedec_flash.c b/drivers/mtd/jedec_flash.c index 94e87cb..41aad3b 100644 --- a/drivers/mtd/jedec_flash.c +++ b/drivers/mtd/jedec_flash.c @@ -218,10 +218,6 @@ static const struct amd_flash_info jedec_table[] = { #endif }; - -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - - static inline void fill_info(flash_info_t *info, const struct amd_flash_info *jedec_entry, ulong base) { int i,j; diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index 80c4ba2..55ef346 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -165,7 +165,7 @@ void cs8900_get_enetaddr (uchar * addr) addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]) ; - debug ("### Set environment from HW MAC addr = \"%s\"\n", ethaddr); + debug ("### Set environment from HW MAC addr = \"%s\"\n", ethaddr); setenv ("ethaddr", ethaddr); } @@ -317,6 +317,6 @@ int cs8900_e2prom_write(unsigned char addr, unsigned short value) return 0; } -#endif /* COMMANDS & CFG_NET */ +#endif /* CONFIG_CMD_NET */ #endif /* CONFIG_DRIVER_CS8900 */ diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c index ecdcbd9..51cfb7e 100644 --- a/drivers/net/lan91c96.c +++ b/drivers/net/lan91c96.c @@ -36,12 +36,12 @@ * AUI/TP selection ( mine has 10Base2/10BaseT select ) * * Arguments: - * io = for the base address + * io = for the base address * irq = for the IRQ * * author: - * Erik Stahlman ( erik@vt.edu ) - * Daris A Nevil ( dnevil@snmc.com ) + * Erik Stahlman ( erik@vt.edu ) + * Daris A Nevil ( dnevil@snmc.com ) * * * Hardware multicast code from Peter Cammaert ( pc@denkart.be ) @@ -53,7 +53,7 @@ * o lan91c96.c (Intel Diagnostic Manager driver) * * History: - * 04/30/03 Mathijs Haarman Modified smc91111.c (u-boot version) + * 04/30/03 Mathijs Haarman Modified smc91111.c (u-boot version) * for lan91c96 *--------------------------------------------------------------------------- */ @@ -296,8 +296,8 @@ static int poll4int (byte mask, int timeout) /* * Function: smc_reset( void ) * Purpose: - * This sets the SMC91111 chip to its normal state, hopefully from whatever - * mess that any other DOS driver has put it in. + * This sets the SMC91111 chip to its normal state, hopefully from whatever + * mess that any other DOS driver has put it in. * * Maybe I should reset more registers to defaults in here? SOFTRST should * do that for me. @@ -397,7 +397,7 @@ static void smc_shutdown () * This sends the actual packet to the SMC9xxx chip. * * Algorithm: - * First, see if a saved_skb is available. + * First, see if a saved_skb is available. * ( this should NOT be called if there is no 'saved_skb' * Now, find the packet number that the chip allocated * Point the data pointers at it in memory @@ -405,9 +405,9 @@ static void smc_shutdown () * Dump the packet to chip memory * Check if a last byte is needed ( odd length packet ) * if so, set the control flag right - * Tell the card to send it + * Tell the card to send it * Enable the transmit interrupt, so I know if it failed - * Free the kernel data if I actually sent it. + * Free the kernel data if I actually sent it. */ static int smc_send_packet (volatile void *packet, int packet_length) { @@ -865,7 +865,7 @@ static int smc_hw_init () } #endif /* 0 */ -#endif /* COMMANDS & CFG_NET */ +#endif /* CONFIG_CMD_NET */ /* smc_get_ethaddr (bd_t * bd) diff --git a/drivers/net/netarm_eth.c b/drivers/net/netarm_eth.c index a99ee5d..ecf45dc 100644 --- a/drivers/net/netarm_eth.c +++ b/drivers/net/netarm_eth.c @@ -29,7 +29,6 @@ #include "netarm_eth.h" #include <asm/arch/netarm_registers.h> - #if defined(CONFIG_CMD_NET) static int na_mii_poll_busy (void); @@ -56,7 +55,6 @@ static void na_get_mac_addr (void) setenv ("ethaddr", ethaddr); } - static void na_mii_write (int reg, int value) { int mii_addr; @@ -355,6 +353,6 @@ extern int eth_send (volatile void *packet, int length) return 1; } -#endif /* COMMANDS & CFG_NET */ +#endif /* CONFIG_CMD_NET */ #endif /* CONFIG_DRIVER_NETARMETH */ diff --git a/drivers/net/rtl8019.c b/drivers/net/rtl8019.c index 409a69f..9d62cab 100644 --- a/drivers/net/rtl8019.c +++ b/drivers/net/rtl8019.c @@ -36,16 +36,13 @@ #if defined(CONFIG_CMD_NET) - /* packet page register access functions */ - static unsigned char get_reg (unsigned int regno) { return (*(unsigned char *) regno); } - static void put_reg (unsigned int regno, unsigned char val) { *(volatile unsigned char *) regno = val; @@ -91,7 +88,6 @@ void rtl8019_get_enetaddr (uchar * addr) put_reg (RTL8019_COMMAND, RTL8019_PAGE0); } - void eth_halt (void) { put_reg (RTL8019_COMMAND, 0x01); @@ -134,7 +130,6 @@ int eth_init (bd_t * bd) return 0; } - static unsigned char nic_to_pc (void) { unsigned char rec_head_status; @@ -277,6 +272,6 @@ extern int eth_send (volatile void *packet, int length) return 0; } -#endif /* COMMANDS & CFG_NET */ +#endif /* CONFIG_CMD_NET */ #endif /* CONFIG_DRIVER_RTL8019 */ diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index 57ccbd9..d71323f 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -352,8 +352,6 @@ int mdio_read(int RegAddr) return value; } -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - static int rtl8169_init_board(struct eth_device *dev) { int i; diff --git a/drivers/qe/Makefile b/drivers/qe/Makefile index 4844181..ec5aa73 100644 --- a/drivers/qe/Makefile +++ b/drivers/qe/Makefile @@ -24,7 +24,8 @@ include $(TOPDIR)/config.mk LIB := $(obj)qe.a -COBJS := qe.o uccf.o uec.o uec_phy.o +COBJS-$(CONFIG_OF_LIBFDT) += fdt.o +COBJS := qe.o uccf.o uec.o uec_phy.o $(COBJS-y) SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/drivers/qe/fdt.c b/drivers/qe/fdt.c new file mode 100644 index 0000000..5307488 --- /dev/null +++ b/drivers/qe/fdt.c @@ -0,0 +1,90 @@ +/* + * Copyright 2008 Freescale Semiconductor, Inc. + * + * (C) Copyright 2000 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <libfdt.h> +#include <fdt_support.h> +#include "qe.h" + +DECLARE_GLOBAL_DATA_PTR; + +/* + * If a QE firmware has been uploaded, then add the 'firmware' node under + * the 'qe' node. + */ +void fdt_fixup_qe_firmware(void *blob) +{ + struct qe_firmware_info *qe_fw_info; + int node, ret; + + qe_fw_info = qe_get_firmware_info(); + if (!qe_fw_info) + return; + + node = fdt_path_offset(blob, "/qe"); + if (node < 0) + return; + + /* We assume the node doesn't exist yet */ + node = fdt_add_subnode(blob, node, "firmware"); + if (node < 0) + return; + + ret = fdt_setprop(blob, node, "extended-modes", + &qe_fw_info->extended_modes, sizeof(u64)); + if (ret < 0) + goto error; + + ret = fdt_setprop_string(blob, node, "id", qe_fw_info->id); + if (ret < 0) + goto error; + + ret = fdt_setprop(blob, node, "virtual-traps", qe_fw_info->vtraps, + sizeof(qe_fw_info->vtraps)); + if (ret < 0) + goto error; + + return; + +error: + fdt_del_node(blob, node); +} + +void ft_qe_setup(void *blob) +{ +#ifdef CONFIG_QE + do_fixup_by_prop_u32(blob, "device_type", "qe", 4, + "bus-frequency", gd->qe_clk, 1); + do_fixup_by_prop_u32(blob, "device_type", "qe", 4, + "brg-frequency", gd->brg_clk, 1); + do_fixup_by_compat_u32(blob, "fsl,qe", + "clock-frequency", gd->qe_clk, 1); + do_fixup_by_compat_u32(blob, "fsl,qe", + "bus-frequency", gd->qe_clk, 1); + do_fixup_by_compat_u32(blob, "fsl,qe", + "brg-frequency", gd->brg_clk, 1); + fdt_fixup_qe_firmware(blob); +#endif +} diff --git a/drivers/qe/qe.h b/drivers/qe/qe.h index 4c96c67..741ed7f 100644 --- a/drivers/qe/qe.h +++ b/drivers/qe/qe.h @@ -289,5 +289,6 @@ int qe_set_brg(uint brg, uint rate); int qe_set_mii_clk_src(int ucc_num); int qe_upload_firmware(const struct qe_firmware *firmware); struct qe_firmware_info *qe_get_firmware_info(void); +void ft_qe_setup(void *blob); #endif /* __QE_H__ */ diff --git a/drivers/rtc/rx8025.c b/drivers/rtc/rx8025.c index 6c94ae1..9122f12 100644 --- a/drivers/rtc/rx8025.c +++ b/drivers/rtc/rx8025.c @@ -142,7 +142,6 @@ void rtc_get (struct rtc_time *tmp) tmp->tm_hour, tmp->tm_min, tmp->tm_sec); } - /* * Set the RTC */ @@ -166,7 +165,6 @@ void rtc_set (struct rtc_time *tmp) rtc_write (RTC_CTL1_REG_ADDR, RTC_CTL1_BIT_2412); } - /* * Reset the RTC. We setting the date back to 1970-01-01. */ @@ -200,7 +198,6 @@ void rtc_reset (void) return; } - /* * Helper functions */ @@ -224,4 +221,4 @@ static unsigned char bin2bcd (unsigned int n) return (((n / 10) << 4) | (n % 10)); } -#endif /* CONFIG_RTC_RX8025 && (CFG_COMMANDS & CFG_CMD_DATE) */ +#endif /* CONFIG_RTC_RX8025 && CONFIG_CMD_DATE */ diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 2429464..6b3f60e 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -21,11 +21,15 @@ void NS16550_init (NS16550_t com_port, int baud_divisor) com_port->mdr1 = 0x7; /* mode select reset TL16C750*/ #endif com_port->lcr = LCR_BKSE | LCRVAL; - com_port->dll = baud_divisor & 0xff; - com_port->dlm = (baud_divisor >> 8) & 0xff; + com_port->dll = 0; + com_port->dlm = 0; com_port->lcr = LCRVAL; com_port->mcr = MCRVAL; com_port->fcr = FCRVAL; + com_port->lcr = LCR_BKSE | LCRVAL; + com_port->dll = baud_divisor & 0xff; + com_port->dlm = (baud_divisor >> 8) & 0xff; + com_port->lcr = LCRVAL; #if defined(CONFIG_OMAP) #if defined(CONFIG_APTIX) com_port->mdr1 = 3; /* /13 mode so Aptix 6MHz can hit 115200 */ @@ -38,12 +42,16 @@ void NS16550_init (NS16550_t com_port, int baud_divisor) void NS16550_reinit (NS16550_t com_port, int baud_divisor) { com_port->ier = 0x00; + com_port->lcr = LCR_BKSE | LCRVAL; + com_port->dll = 0; + com_port->dlm = 0; + com_port->lcr = LCRVAL; + com_port->mcr = MCRVAL; + com_port->fcr = FCRVAL; com_port->lcr = LCR_BKSE; com_port->dll = baud_divisor & 0xff; com_port->dlm = (baud_divisor >> 8) & 0xff; com_port->lcr = LCRVAL; - com_port->mcr = MCRVAL; - com_port->fcr = FCRVAL; } void NS16550_putc (NS16550_t com_port, char c) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index a3d1c95..2fe838c 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -22,11 +22,11 @@ */ #include <common.h> +#if defined(CONFIG_MPC8XXX_SPI) && defined(CONFIG_HARD_SPI) + #include <spi.h> #include <asm/mpc8xxx_spi.h> -#ifdef CONFIG_HARD_SPI - #define SPI_EV_NE (0x80000000 >> 22) /* Receiver Not Empty */ #define SPI_EV_NF (0x80000000 >> 23) /* Transmitter Not Full */ |