summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG108
-rw-r--r--README4
-rw-r--r--board/sc3/sc3.c2
-rw-r--r--board/ssv/common/cmd_sled.c4
-rw-r--r--common/cmd_bmp.c134
-rw-r--r--common/cmd_mii.c144
-rw-r--r--common/env_nand.c2
-rw-r--r--cpu/mpc8xx/fec.c107
-rw-r--r--cpu/ppc4xx/4xx_pci.c2
-rw-r--r--cpu/pxa/start.S38
-rw-r--r--doc/README.generic_usb_ohci2
-rw-r--r--doc/README.modnet504
-rw-r--r--doc/README.nand2
-rw-r--r--drivers/mtd/nand/nand_util.c2
-rw-r--r--drivers/net/ne2000.c7
-rw-r--r--drivers/net/rtl8169.c100
-rw-r--r--drivers/net/sk98lin/Makefile2
-rw-r--r--drivers/usb/isp116x-hcd.c2
-rw-r--r--drivers/usb/usbdcore_mpc8xx.c3
-rw-r--r--drivers/video/cfb_console.c8
-rw-r--r--fs/jffs2/jffs2_1pass.c2
-rw-r--r--include/configs/CATcenter.h2
-rw-r--r--include/configs/M54455EVB.h1
-rw-r--r--include/configs/MPC8313ERDB.h2
-rw-r--r--include/configs/PPChameleonEVB.h2
-rw-r--r--include/configs/SX1.h2
-rw-r--r--include/configs/integratorcp.h2
-rw-r--r--include/configs/omap1510inn.h2
-rw-r--r--include/configs/omap2420h4.h2
-rw-r--r--include/configs/omap5912osk.h2
-rw-r--r--include/linux/mtd/nand.h2
-rw-r--r--nand_spl/board/amcc/acadia/Makefile2
-rw-r--r--nand_spl/board/amcc/bamboo/Makefile2
-rw-r--r--nand_spl/board/amcc/sequoia/Makefile2
-rw-r--r--nand_spl/nand_boot.c2
-rw-r--r--tools/Makefile3
-rw-r--r--tools/easylogo/Makefile10
-rw-r--r--tools/easylogo/easylogo.c626
38 files changed, 683 insertions, 662 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 548139a..43c0bd5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,111 @@
+commit fc6414eca55f1fc108fb12fc8cdc43bd8b4463f9
+Author: Mike Frysinger <vapier@gentoo.org>
+Date: Tue Dec 18 04:29:55 2007 -0500
+
+ fix easylogo on big endian dev systems
+
+ didnt realize how out of shape easylogo actually was until i tried using it.
+ this patch does byte swapping as need be on the input tga header since the tga
+ is in little endian but the host could just as well be big endian. i didnt
+ bother using bswap macros or such stuff from system headers as nothing in
+ POSIX dictates byte swapping functionality.
+
+ Signed-Off-By: Mike Frysinger <vapier@gentoo.org>
+
+commit 38d299c2db81bd889c601b5dfc12c4e83ef83333
+Author: Mike Frysinger <vapier@gentoo.org>
+Date: Tue Dec 18 03:23:25 2007 -0500
+
+ cleanup easylogo
+
+ - make the Makefile not suck
+ - include proper headers for prototypes
+ - fix obvious broken handling of strchr() when handling '.' in filenames
+
+ Signed-Off-By: Mike Frysinger <vapier@gentoo.org>
+
+commit 883e3925d99a8dd69c5b0201cba5b1887f88f95c
+Author: raptorbrino@aim.com <raptorbrino@aim.com>
+Date: Thu Dec 13 21:23:28 2007 -0500
+
+ Fix build problems under Cygwin
+
+ This patch allows u-boot to build without error in a cygwin
+ environment. Cygwin does not define __u64 in it's
+ include/asm/types.h file. The -idirafter flag in the u-boot
+ build causes the inclusion of the cygwin types.h file as opposed
+ to u-bot/include/asm/types.h file which does define __u64.
+ Subsequently, sha1.c compile fails due to unknown symbol.
+
+ Signed-off-by: Brian Miller <raptorbrino@netscape.net>
+
+commit 43ef1c381f9195504a2488f5cb909227eb97d475
+Author: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
+Date: Fri Nov 30 17:29:59 2007 +0100
+
+ cmd_bmp: Add support for displaying gzip compressed bmps
+
+ The existing code can show information about a gzip compressed BMP
+ image, but can't actually display it.
+
+ Therefore, move the decompression code out of bmp_info() and use it in
+ bmp_display() as well in order to display a compressed BMP image.
+
+ Also, clean things up a bit and fix a memory leak while we're at it.
+
+ [hskinnemoen@atmel.com: a bit of refactoring]
+ Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
+
+commit d197ffd8172c6fdef38733424640a9a47295d6e9
+Author: Guennadi Liakhovetski <lg@denx.de>
+Date: Thu Nov 29 21:15:56 2007 +0100
+
+ Fix and optimize MII operations on FEC (MPC8xx) controllers
+
+ This patch fixes several issues at least on a MPC885 based system with two
+ FEC interfaces used in MII mode.
+
+ 1. PHY discovery should first read PHY_PHYIDR2 register and only then
+ PHY_PHYIDR1 like cpu/mpc8xx/fec.c::mii_discover_phy() does it,
+ otherwise the values read are wrong. Also notice, that PHY discovery
+ cannot work on MPC88x / MPC87x in setups with both FECs active at all
+ in its present form, because for both interfaces the registers from FEC
+ 1 are used to communicate over MII.
+
+ 2. Remove code duplication for resetting the FEC by isolating it into a
+ separate function.
+
+ 3. Initialize MII on FEC 1 when communicating over FEC 2 in fec_init().
+
+ 4. Optimize mii_init() to only reset the FEC 1 controller once.
+
+ 5. Fix a typo in mii_init() using index i instead of j thus potentially
+ leading to unpredictable results.
+
+ Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 6a5e1d75bf106fa157e9ce68bcaf4b13e8a1d214
+Author: Guennadi Liakhovetski <lg@denx.de>
+Date: Tue Nov 20 13:14:20 2007 +0100
+
+ Fix endianness conversions in rtl8169 driver
+
+ It is unclear on what platforms this driver has been tested, since
+ noone up to now defines CONFIG_RTL8169 in the board configuration
+ header. Now it has been fixed for a big-endian mpc8241 based
+ linkstation platform. This patch presents the necessary endianness
+ conversion fixes.
+
+ Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 07eb02687f008721974a2fb54cd7fdc28033ab3c
+Author: Wolfgang Denk <wd@denx.de>
+Date: Wed Jan 9 13:43:38 2008 +0100
+
+ Coding Style clenaup; update CHANGELOG
+
+ Signed-off-by: Wolfgang Denk <wd@denx.de>
+
commit c26acc1a43b31ddca5add42fd0360ff0eee90c80
Author: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
Date: Thu Dec 27 17:13:11 2007 +0100
diff --git a/README b/README
index 9a8b3b9..57fc01a 100644
--- a/README
+++ b/README
@@ -924,7 +924,7 @@ The following options need to be configured:
(i.e. setenv videomode 317; saveenv; reset;)
- "videomode=bootargs" all the video parameters are parsed
- from the bootargs. (See drivers/videomodes.c)
+ from the bootargs. (See drivers/video/videomodes.c)
CONFIG_VIDEO_SED13806
@@ -1353,7 +1353,7 @@ The following options need to be configured:
CONFIG_FSL_I2C
Define this option if you want to use Freescale's I2C driver in
- drivers/fsl_i2c.c.
+ drivers/i2c/fsl_i2c.c.
- SPI Support: CONFIG_SPI
diff --git a/board/sc3/sc3.c b/board/sc3/sc3.c
index 363a77d..0940764 100644
--- a/board/sc3/sc3.c
+++ b/board/sc3/sc3.c
@@ -757,7 +757,7 @@ static struct pci_config_table pci_solidcard3_config_table[] =
};
/*-------------------------------------------------------------------------+
- | pci_init_board (Called from pci_init() in drivers/pci.c)
+ | pci_init_board (Called from pci_init() in drivers/pci/pci.c)
|
| Init the PCI part of the SolidCard III
|
diff --git a/board/ssv/common/cmd_sled.c b/board/ssv/common/cmd_sled.c
index 713ed65..2208580 100644
--- a/board/ssv/common/cmd_sled.c
+++ b/board/ssv/common/cmd_sled.c
@@ -32,8 +32,8 @@
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!! !!!!!
* !!!!! Next type definition was coming from original !!!!!
- * !!!!! status LED driver drivers/status_led.c and !!!!!
- * !!!!! should exported for using here. !!!!!
+ * !!!!! status LED driver drivers/misc/status_led.c !!!!!
+ * !!!!! and should be exported for using it here. !!!!!
* !!!!! !!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c
index 907f9a2..2437e22 100644
--- a/common/cmd_bmp.c
+++ b/common/cmd_bmp.c
@@ -37,6 +37,62 @@ static int bmp_display (ulong addr, int x, int y);
int gunzip(void *, int, unsigned char *, unsigned long *);
/*
+ * Allocate and decompress a BMP image using gunzip().
+ *
+ * Returns a pointer to the decompressed image data. Must be freed by
+ * the caller after use.
+ *
+ * Returns NULL if decompression failed, or if the decompressed data
+ * didn't contain a valid BMP signature.
+ */
+#ifdef CONFIG_VIDEO_BMP_GZIP
+static bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp)
+{
+ void *dst;
+ unsigned long len;
+ bmp_image_t *bmp;
+
+ /*
+ * Decompress bmp image
+ */
+ len = CFG_VIDEO_LOGO_MAX_SIZE;
+ dst = malloc(CFG_VIDEO_LOGO_MAX_SIZE);
+ if (dst == NULL) {
+ puts("Error: malloc in gunzip failed!\n");
+ return NULL;
+ }
+ if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE, (uchar *)addr, &len) != 0) {
+ free(dst);
+ return NULL;
+ }
+ if (len == CFG_VIDEO_LOGO_MAX_SIZE)
+ puts("Image could be truncated"
+ " (increase CFG_VIDEO_LOGO_MAX_SIZE)!\n");
+
+ bmp = dst;
+
+ /*
+ * Check for bmp mark 'BM'
+ */
+ if (!((bmp->header.signature[0] == 'B') &&
+ (bmp->header.signature[1] == 'M'))) {
+ free(dst);
+ return NULL;
+ }
+
+ puts("Gzipped BMP image detected!\n");
+
+ return bmp;
+}
+#else
+static bmp_image_t *gunzip_bmp(unsigned long addr)
+{
+ return NULL;
+}
+#endif
+
+
+/*
* Subroutine: do_bmp
*
* Description: Handler for 'bmp' command..
@@ -101,63 +157,24 @@ U_BOOT_CMD(
static int bmp_info(ulong addr)
{
bmp_image_t *bmp=(bmp_image_t *)addr;
-#ifdef CONFIG_VIDEO_BMP_GZIP
- unsigned char *dst = NULL;
- ulong len;
-#endif /* CONFIG_VIDEO_BMP_GZIP */
+ unsigned long len;
if (!((bmp->header.signature[0]=='B') &&
- (bmp->header.signature[1]=='M'))) {
+ (bmp->header.signature[1]=='M')))
+ bmp = gunzip_bmp(addr, &len);
-#ifdef CONFIG_VIDEO_BMP_GZIP
- /*
- * Decompress bmp image
- */
- len = CFG_VIDEO_LOGO_MAX_SIZE;
- dst = malloc(CFG_VIDEO_LOGO_MAX_SIZE);
- if (dst == NULL) {
- printf("Error: malloc in gunzip failed!\n");
- return(1);
- }
- if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE, (uchar *)addr, &len) != 0) {
- printf("There is no valid bmp file at the given address\n");
- return(1);
- }
- if (len == CFG_VIDEO_LOGO_MAX_SIZE) {
- printf("Image could be truncated (increase CFG_VIDEO_LOGO_MAX_SIZE)!\n");
- }
-
- /*
- * Set addr to decompressed image
- */
- bmp = (bmp_image_t *)dst;
-
- /*
- * Check for bmp mark 'BM'
- */
- if (!((bmp->header.signature[0] == 'B') &&
- (bmp->header.signature[1] == 'M'))) {
- printf("There is no valid bmp file at the given address\n");
- free(dst);
- return(1);
- }
-
- printf("Gzipped BMP image detected!\n");
-#else /* CONFIG_VIDEO_BMP_GZIP */
+ if (bmp == NULL) {
printf("There is no valid bmp file at the given address\n");
- return(1);
-#endif /* CONFIG_VIDEO_BMP_GZIP */
+ return 1;
}
+
printf("Image size : %d x %d\n", le32_to_cpu(bmp->header.width),
le32_to_cpu(bmp->header.height));
printf("Bits per pixel: %d\n", le16_to_cpu(bmp->header.bit_count));
printf("Compression : %d\n", le32_to_cpu(bmp->header.compression));
-#ifdef CONFIG_VIDEO_BMP_GZIP
- if (dst) {
- free(dst);
- }
-#endif /* CONFIG_VIDEO_BMP_GZIP */
+ if ((unsigned long)bmp != addr)
+ free(bmp);
return(0);
}
@@ -174,14 +191,33 @@ static int bmp_info(ulong addr)
*/
static int bmp_display(ulong addr, int x, int y)
{
+ int ret;
+ bmp_image_t *bmp = (bmp_image_t *)addr;
+ unsigned long len;
+
+ if (!((bmp->header.signature[0]=='B') &&
+ (bmp->header.signature[1]=='M')))
+ bmp = gunzip_bmp(addr, &len);
+
+ if (!bmp) {
+ printf("There is no valid bmp file at the given address\n");
+ return 1;
+ }
+
#if defined(CONFIG_LCD)
extern int lcd_display_bitmap (ulong, int, int);
- return (lcd_display_bitmap (addr, x, y));
+ ret = lcd_display_bitmap ((unsigned long)bmp, x, y);
#elif defined(CONFIG_VIDEO)
extern int video_display_bitmap (ulong, int, int);
- return (video_display_bitmap (addr, x, y));
+
+ ret = video_display_bitmap ((unsigned long)bmp, x, y);
#else
# error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO
#endif
+
+ if ((unsigned long)bmp != addr)
+ free(bmp);
+
+ return ret;
}
diff --git a/common/cmd_mii.c b/common/cmd_mii.c
index f530a38..31ac43d 100644
--- a/common/cmd_mii.c
+++ b/common/cmd_mii.c
@@ -29,143 +29,6 @@
#include <command.h>
#include <miiphy.h>
-#ifdef CONFIG_TERSE_MII
-/*
- * Display values from last command.
- */
-uint last_op;
-uint last_addr;
-uint last_data;
-uint last_reg;
-
-/*
- * MII device/info/read/write
- *
- * Syntax:
- * mii device {devname}
- * mii info {addr}
- * mii read {addr} {reg}
- * mii write {addr} {reg} {data}
- */
-int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
-{
- char op;
- unsigned char addr, reg;
- unsigned short data;
- int rcode = 0;
- char *devname;
-
- if (argc < 2) {
- printf ("Usage:\n%s\n", cmdtp->usage);
- return 1;
- }
-
-#if defined(CONFIG_8xx) || defined(CONFIG_MCF52x2)
- mii_init ();
-#endif
-
- /*
- * We use the last specified parameters, unless new ones are
- * entered.
- */
- op = last_op;
- addr = last_addr;
- data = last_data;
- reg = last_reg;
-
- if ((flag & CMD_FLAG_REPEAT) == 0) {
- op = argv[1][0];
- if (argc >= 3)
- addr = simple_strtoul (argv[2], NULL, 16);
- if (argc >= 4)
- reg = simple_strtoul (argv[3], NULL, 16);
- if (argc >= 5)
- data = simple_strtoul (argv[4], NULL, 16);
- }
-
- /* use current device */
- devname = miiphy_get_current_dev();
-
- /*
- * check device/read/write/list.
- */
- if (op == 'i') {
- unsigned char j, start, end;
- unsigned int oui;
- unsigned char model;
- unsigned char rev;
-
- /*
- * Look for any and all PHYs. Valid addresses are 0..31.
- */
- if (argc >= 3) {
- start = addr; end = addr + 1;
- } else {
- start = 0; end = 31;
- }
-
- for (j = start; j < end; j++) {
- if (miiphy_info (devname, j, &oui, &model, &rev) == 0) {
- printf ("PHY 0x%02X: "
- "OUI = 0x%04X, "
- "Model = 0x%02X, "
- "Rev = 0x%02X, "
- "%3dbase%s, %s\n",
- j, oui, model, rev,
- miiphy_speed (devname, j),
- miiphy_is_1000base_x (devname, j)
- ? "X" : "T",
- (miiphy_duplex (devname, j) == FULL)
- ? "FDX" : "HDX");
- }
- }
- } else if (op == 'r') {
- if (miiphy_read (devname, addr, reg, &data) != 0) {
- puts ("Error reading from the PHY\n");
- rcode = 1;
- } else {
- printf ("%04X\n", data & 0x0000FFFF);
- }
- } else if (op == 'w') {
- if (miiphy_write (devname, addr, reg, data) != 0) {
- puts ("Error writing to the PHY\n");
- rcode = 1;
- }
- } else if (op == 'd') {
- if (argc == 2)
- miiphy_listdev ();
- else
- miiphy_set_current_dev (argv[2]);
- } else {
- printf ("Usage:\n%s\n", cmdtp->usage);
- return 1;
- }
-
- /*
- * Save the parameters for repeats.
- */
- last_op = op;
- last_addr = addr;
- last_data = data;
- last_reg = reg;
-
- return rcode;
-}
-
-/***************************************************/
-
-U_BOOT_CMD(
- mii, 5, 1, do_mii,
- "mii - MII utility commands\n",
- "device - list available devices\n"
- "mii device <devname> - set current device\n"
- "mii info <addr> - display MII PHY info\n"
- "mii read <addr> <reg> - read MII PHY <addr> register <reg>\n"
- "mii write <addr> <reg> <data> - write MII PHY <addr> register <reg>\n"
-);
-
-#else /* ! CONFIG_TERSE_MII ================================================= */
-
typedef struct _MII_reg_desc_t {
ushort regno;
char * name;
@@ -438,6 +301,11 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
int rcode = 0;
char *devname;
+ if (argc < 2) {
+ printf("Usage:\n%s\n", cmdtp->usage);
+ return 1;
+ }
+
#if defined(CONFIG_8xx) || defined(CONFIG_MCF532x)
mii_init ();
#endif
@@ -594,5 +462,3 @@ U_BOOT_CMD(
"mii dump <addr> <reg> - pretty-print <addr> <reg> (0-5 only)\n"
"Addr and/or reg may be ranges, e.g. 2-7.\n"
);
-
-#endif /* CONFIG_TERSE_MII */
diff --git a/common/env_nand.c b/common/env_nand.c
index 38a07f8..ce0a251 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -57,7 +57,7 @@ int nand_legacy_rw (struct nand_chip* nand, int cmd,
size_t start, size_t len,
size_t * retlen, u_char * buf);
-/* info for NAND chips, defined in drivers/nand/nand.c */
+/* info for NAND chips, defined in drivers/mtd/nand/nand.c */
extern nand_info_t nand_info[];
/* references to names in env_common.c */
diff --git a/cpu/mpc8xx/fec.c b/cpu/mpc8xx/fec.c
index 08a3715..da473ca 100644
--- a/cpu/mpc8xx/fec.c
+++ b/cpu/mpc8xx/fec.c
@@ -143,6 +143,7 @@ static int fec_send(struct eth_device* dev, volatile void *packet, int length);
static int fec_recv(struct eth_device* dev);
static int fec_init(struct eth_device* dev, bd_t * bd);
static void fec_halt(struct eth_device* dev);
+static void __mii_init(void);
int fec_initialize(bd_t *bis)
{
@@ -539,6 +540,30 @@ static void fec_pin_init(int fecidx)
}
}
+static int fec_reset(volatile fec_t *fecp)
+{
+ int i;
+
+ /* Whack a reset.
+ * A delay is required between a reset of the FEC block and
+ * initialization of other FEC registers because the reset takes
+ * some time to complete. If you don't delay, subsequent writes
+ * to FEC registers might get killed by the reset routine which is
+ * still in progress.
+ */
+
+ fecp->fec_ecntrl = FEC_ECNTRL_PINMUX | FEC_ECNTRL_RESET;
+ for (i = 0;
+ (fecp->fec_ecntrl & FEC_ECNTRL_RESET) && (i < FEC_RESET_DELAY);
+ ++i) {
+ udelay (1);
+ }
+ if (i == FEC_RESET_DELAY)
+ return -1;
+
+ return 0;
+}
+
static int fec_init (struct eth_device *dev, bd_t * bd)
{
struct ether_fcc_info_s *efis = dev->priv;
@@ -573,23 +598,17 @@ static int fec_init (struct eth_device *dev, bd_t * bd)
#endif /* CONFIG_FADS */
}
- /* Whack a reset.
- * A delay is required between a reset of the FEC block and
- * initialization of other FEC registers because the reset takes
- * some time to complete. If you don't delay, subsequent writes
- * to FEC registers might get killed by the reset routine which is
- * still in progress.
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+ /* the MII interface is connected to FEC1
+ * so for the miiphy_xxx function to work we must
+ * call mii_init since fec_halt messes the thing up
*/
- fecp->fec_ecntrl = FEC_ECNTRL_PINMUX | FEC_ECNTRL_RESET;
- for (i = 0;
- (fecp->fec_ecntrl & FEC_ECNTRL_RESET) && (i < FEC_RESET_DELAY);
- ++i) {
- udelay (1);
- }
- if (i == FEC_RESET_DELAY) {
+ if (efis->ether_index != 0)
+ __mii_init();
+#endif
+
+ if (fec_reset(fecp) < 0)
printf ("FEC_RESET_DELAY timeout\n");
- return 0;
- }
/* We use strictly polling mode only
*/
@@ -603,7 +622,7 @@ static int fec_init (struct eth_device *dev, bd_t * bd)
/* Set station address
*/
-#define ea eth_get_dev()->enetaddr
+#define ea dev->enetaddr
fecp->fec_addr_low = (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]);
fecp->fec_addr_high = (ea[4] << 8) | (ea[5]);
#undef ea
@@ -716,15 +735,8 @@ static int fec_init (struct eth_device *dev, bd_t * bd)
} else {
efis->actual_phy_addr = efis->phy_addr;
}
-#if defined(CONFIG_MII) && defined(CONFIG_RMII)
-
- /* the MII interface is connected to FEC1
- * so for the miiphy_xxx function to work we must
- * call mii_init since fec_halt messes the thing up
- */
- if (efis->ether_index != 0)
- mii_init();
+#if defined(CONFIG_MII) && defined(CONFIG_RMII)
/*
* adapt the RMII speed to the speed of the phy
*/
@@ -874,15 +886,14 @@ static int mii_discover_phy(struct eth_device *dev)
udelay(10000); /* wait 10ms */
}
for (phyno = 0; phyno < 32 && phyaddr < 0; ++phyno) {
- phytype = mii_send(mk_mii_read(phyno, PHY_PHYIDR1));
+ phytype = mii_send(mk_mii_read(phyno, PHY_PHYIDR2));
#ifdef ET_DEBUG
printf("PHY type 0x%x pass %d type ", phytype, pass);
#endif
if (phytype != 0xffff) {
phyaddr = phyno;
- phytype <<= 16;
phytype |= mii_send(mk_mii_read(phyno,
- PHY_PHYIDR2));
+ PHY_PHYIDR1)) << 16;
#ifdef ET_DEBUG
printf("PHY @ 0x%x pass %d type ",phyno,pass);
@@ -929,36 +940,17 @@ static int mii_discover_phy(struct eth_device *dev)
#if (defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) && !defined(CONFIG_BITBANGMII)
/****************************************************************************
- * mii_init -- Initialize the MII for MII command without ethernet
+ * mii_init -- Initialize the MII via FEC 1 for MII command without ethernet
* This function is a subset of eth_init
****************************************************************************
*/
-void mii_init (void)
+static void __mii_init(void)
{
volatile immap_t *immr = (immap_t *) CFG_IMMR;
volatile fec_t *fecp = &(immr->im_cpm.cp_fec);
- int i, j;
- for (j = 0; j < sizeof(ether_fcc_info) / sizeof(ether_fcc_info[0]); j++) {
-
- /* Whack a reset.
- * A delay is required between a reset of the FEC block and
- * initialization of other FEC registers because the reset takes
- * some time to complete. If you don't delay, subsequent writes
- * to FEC registers might get killed by the reset routine which is
- * still in progress.
- */
-
- fecp->fec_ecntrl = FEC_ECNTRL_PINMUX | FEC_ECNTRL_RESET;
- for (i = 0;
- (fecp->fec_ecntrl & FEC_ECNTRL_RESET) && (i < FEC_RESET_DELAY);
- ++i) {
- udelay (1);
- }
- if (i == FEC_RESET_DELAY) {
+ if (fec_reset(fecp) < 0)
printf ("FEC_RESET_DELAY timeout\n");
- return;
- }
/* We use strictly polling mode only
*/
@@ -968,14 +960,21 @@ void mii_init (void)
*/
fecp->fec_ievent = 0xffc0;
- /* Setup the pin configuration of the FEC(s)
- */
- fec_pin_init(ether_fcc_info[i].ether_index);
-
/* Now enable the transmit and receive processing
*/
fecp->fec_ecntrl = FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN;
- }
+}
+
+void mii_init (void)
+{
+ int i;
+
+ __mii_init();
+
+ /* Setup the pin configuration of the FEC(s)
+ */
+ for (i = 0; i < sizeof(ether_fcc_info) / sizeof(ether_fcc_info[0]); i++)
+ fec_pin_init(ether_fcc_info[i].ether_index);
}
/*****************************************************************************
diff --git a/cpu/ppc4xx/4xx_pci.c b/cpu/ppc4xx/4xx_pci.c
index a68c419..a5b9690 100644
--- a/cpu/ppc4xx/4xx_pci.c
+++ b/cpu/ppc4xx/4xx_pci.c
@@ -339,7 +339,7 @@ void pci_405gp_init(struct pci_controller *hose)
}
/*
- * drivers/pci.c skips every host bridge but the 405GP since it could
+ * drivers/pci/pci.c skips every host bridge but the 405GP since it could
* be set as an Adapter.
*
* I (Andrew May) don't know what we should do here, but I don't want
diff --git a/cpu/pxa/start.S b/cpu/pxa/start.S
index b922485..31f408d 100644
--- a/cpu/pxa/start.S
+++ b/cpu/pxa/start.S
@@ -57,7 +57,7 @@ _fiq: .word fiq
* Startup Code (reset vector)
*
* do important init only if we don't start from RAM!
- * - relocate armboot to ram
+ * - relocate armboot to RAM
* - setup stack
* - jump to second stage
*/
@@ -90,7 +90,7 @@ IRQ_STACK_START:
.globl FIQ_STACK_START
FIQ_STACK_START:
.word 0x0badc0de
-#endif
+#endif /* CONFIG_USE_IRQ */
/****************************************************************************/
@@ -100,18 +100,18 @@ FIQ_STACK_START:
/****************************************************************************/
reset:
- mrs r0,cpsr /* set the cpu to SVC32 mode */
+ mrs r0,cpsr /* set the CPU to SVC32 mode */
bic r0,r0,#0x1f /* (superviser mode, M=10011) */
orr r0,r0,#0x13
msr cpsr,r0
/*
* we do sys-critical inits only at reboot,
- * not when booting from ram!
+ * not when booting from RAM!
*/
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
bl cpu_init_crit /* we do sys-critical inits */
-#endif
+#endif /* !CONFIG_SKIP_LOWLEVEL_INIT */
#ifndef CONFIG_SKIP_RELOCATE_UBOOT
relocate: /* relocate U-Boot to RAM */
@@ -130,7 +130,7 @@ copy_loop:
stmia r1!, {r3-r10} /* copy to target address [r1] */
cmp r0, r2 /* until source end addreee [r2] */
ble copy_loop
-#endif /* CONFIG_SKIP_RELOCATE_UBOOT */
+#endif /* !CONFIG_SKIP_RELOCATE_UBOOT */
/* Set up the stack */
stack_setup:
@@ -139,7 +139,7 @@ stack_setup:
sub r0, r0, #CFG_GBL_DATA_SIZE /* bdinfo */
#ifdef CONFIG_USE_IRQ
sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
-#endif
+#endif /* CONFIG_USE_IRQ */
sub sp, r0, #12 /* leave 3 words for abort-stack */
clear_bss:
@@ -172,11 +172,11 @@ _start_armboot: .word start_armboot
#undef OSCR
#undef OWER
#undef OIER
-#endif
+#endif /* CONFIG_PXA250 || CONFIG_CPU_MONAHANS */
#ifdef CONFIG_PXA250
#undef RCSR
#undef CCCR
-#endif
+#endif /* CONFIG_PXA250 */
/* Interrupt-Controller base address */
IC_BASE: .word 0x40d00000
@@ -197,18 +197,18 @@ OSTIMER_BASE: .word 0x40a00000
#ifdef CONFIG_CPU_MONAHANS
# ifndef CFG_MONAHANS_RUN_MODE_OSC_RATIO
# error "You have to define CFG_MONAHANS_RUN_MODE_OSC_RATIO!!"
-# endif
+# endif /* !CFG_MONAHANS_RUN_MODE_OSC_RATIO */
# ifndef CFG_MONAHANS_TURBO_RUN_MODE_RATIO
# define CFG_MONAHANS_TURBO_RUN_MODE_RATIO 0x1
-# endif
-#else /* ! CONFIG_CPU_MONAHANS */
+# endif /* !CFG_MONAHANS_TURBO_RUN_MODE_RATIO */
+#else /* !CONFIG_CPU_MONAHANS */
#ifdef CFG_CPUSPEED
CC_BASE: .word 0x41300000
#define CCCR 0x00
cpuspeed: .word CFG_CPUSPEED
-#else
+#else /* !CFG_CPUSPEED */
#error "You have to define CFG_CPUSPEED!!"
-#endif
+#endif /* CFG_CPUSPEED */
#endif /* CONFIG_CPU_MONAHANS */
/* takes care the CP15 update has taken place */
@@ -225,7 +225,7 @@ cpu_init_crit:
ldr r0, IC_BASE
mov r1, #0x00
str r1, [r0, #ICMR]
-#else
+#else /* CONFIG_CPU_MONAHANS */
/* Step 1 - Enable CP6 permission */
mrc p15, 0, r1, c15, c1, 0 @ read CPAR
orr r1, r1, #0x40
@@ -244,14 +244,14 @@ cpu_init_crit:
ldr r1, =CKENB
ldr r2, =(CKENB_6_IRQ)
str r2, [r1]
-#endif
+#endif /* !CONFIG_CPU_MONAHANS */
/* set clock speed */
#ifdef CONFIG_CPU_MONAHANS
ldr r0, =ACCR
ldr r1, =(((CFG_MONAHANS_TURBO_RUN_MODE_RATIO<<8) & ACCR_XN_MASK) | (CFG_MONAHANS_RUN_MODE_OSC_RATIO & ACCR_XL_MASK))
str r1, [r0]
-#else /* ! CONFIG_CPU_MONAHANS */
+#else /* !CONFIG_CPU_MONAHANS */
#ifdef CFG_CPUSPEED
ldr r0, CC_BASE
ldr r1, cpuspeed
@@ -451,7 +451,7 @@ fiq:
bl do_fiq /* effiction fiq_save_user_regs */
irq_restore_user_regs
-#else
+#else /* !CONFIG_USE_IRQ */
.align 5
irq:
@@ -465,7 +465,7 @@ fiq:
bad_save_user_regs
bl do_fiq
-#endif
+#endif /* CONFIG_USE_IRQ */
/****************************************************************************/
/* */
diff --git a/doc/README.generic_usb_ohci b/doc/README.generic_usb_ohci
index 494dd1f..c44c501 100644
--- a/doc/README.generic_usb_ohci
+++ b/doc/README.generic_usb_ohci
@@ -1,7 +1,7 @@
Notes on the the generic USB-OHCI driver
========================================
-This driver (drivers/usb_ohci.[ch]) is the result of the merge of
+This driver (drivers/usb/usb_ohci.[ch]) is the result of the merge of
various existing OHCI drivers that were basically identical beside
cpu/board dependant initalization. This initalization has been moved
into cpu/board directories and are called via the hooks below.
diff --git a/doc/README.modnet50 b/doc/README.modnet50
index 30338ce..f7bb254 100644
--- a/doc/README.modnet50
+++ b/doc/README.modnet50
@@ -51,8 +51,8 @@ board/modnet50/lowlevel_init.S .. memory setup for ModNET50
board/modnet50/flash.c .. flash routines
board/modnet50/modnet50.c .. some board init stuff
-drivers/netarm_eth.c .. ethernet driver for the NET+50 CPU
-drivers/netarm_eth.h .. header for ethernet driver
+drivers/net/netarm_eth.c .. ethernet driver for the NET+50 CPU
+drivers/net/netarm_eth.h .. header for ethernet driver
include/configs/modnet50.h .. configuration file for ModNET50
diff --git a/doc/README.nand b/doc/README.nand
index c5c5ef2..647a6b8 100644
--- a/doc/README.nand
+++ b/doc/README.nand
@@ -79,7 +79,7 @@ Commands:
nand write.jffs2 addr ofs|partition size
Like `write', but blocks that are marked bad are skipped and the
- is written to the next block instead. This allows writing writing
+ data is written to the next block instead. This allows writing
a JFFS2 image, as long as the image is short enough to fit even
after skipping the bad blocks. Compact images, such as those
produced by mkfs.jffs2 should work well, but loading an image copied
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index 4fd4e16..6c5624a 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -1,5 +1,5 @@
/*
- * drivers/nand/nand_util.c
+ * drivers/mtd/nand/nand_util.c
*
* Copyright (C) 2006 by Weiss-Electronic GmbH.
* All rights reserved.
diff --git a/drivers/net/ne2000.c b/drivers/net/ne2000.c
index c978d62..b100657 100644
--- a/drivers/net/ne2000.c
+++ b/drivers/net/ne2000.c
@@ -839,7 +839,7 @@ void uboot_push_packet_len(int len) {
}
dp83902a_recv(&pbuf[0], len);
- /*Just pass it to the upper layer*/
+ /* Just pass it to the upper layer */
NetReceive(&pbuf[0], len);
}
@@ -902,7 +902,6 @@ int eth_init(bd_t *bd) {
}
void eth_halt() {
-
PRINTK("### eth_halt\n");
if(initialized)
dp83902a_stop();
@@ -910,8 +909,8 @@ void eth_halt() {
}
int eth_rx() {
-dp83902a_poll();
-return 1;
+ dp83902a_poll();
+ return 1;
}
int eth_send(volatile void *packet, int length) {
diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index 63ea2cc..1d7f31c 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -48,7 +48,10 @@
*
* Indent Options: indent -kr -i8
***************************************************************************/
-
+/*
+ * 26 August 2006 Mihai Georgian <u-boot@linuxnotincluded.org.uk>
+ * Modified to use le32_to_cpu and cpu_to_le32 properly
+ */
#include <common.h>
#include <malloc.h>
#include <net.h>
@@ -68,12 +71,7 @@
static u32 ioaddr;
/* Condensed operations for readability. */
-#define virt_to_le32desc(addr) cpu_to_le32(virt_to_bus(addr))
-#define le32desc_to_virt(addr) bus_to_virt(le32_to_cpu(addr))
-
#define currticks() get_timer(0)
-#define bus_to_phys(a) pci_mem_to_phys((pci_dev_t)dev->priv, a)
-#define phys_to_bus(a) pci_phys_to_mem((pci_dev_t)dev->priv, a)
/* media options */
#define MAX_UNITS 8
@@ -102,7 +100,7 @@ static int media[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 };
#define RTL_MIN_IO_SIZE 0x80
#define TX_TIMEOUT (6*HZ)
-/* write/read MMIO register */
+/* write/read MMIO register. Notice: {read,write}[wl] do the necessary swapping */
#define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg))
#define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg))
#define RTL_W32(reg, val32) writel ((val32), ioaddr + (reg))
@@ -218,7 +216,7 @@ enum RTL8169_register_content {
PHY_Enable_Auto_Nego = 0x1000,
/* PHY_STAT_REG = 1; */
- PHY_Auto_Neco_Comp = 0x0020,
+ PHY_Auto_Nego_Comp = 0x0020,
/* PHY_AUTO_NEGO_REG = 4; */
PHY_Cap_10_Half = 0x0020,
@@ -413,23 +411,23 @@ static int rtl_recv(struct eth_device *dev)
ioaddr = dev->iobase;
cur_rx = tpc->cur_rx;
- if ((tpc->RxDescArray[cur_rx].status & OWNbit) == 0) {
- if (!(tpc->RxDescArray[cur_rx].status & RxRES)) {
+ if ((le32_to_cpu(tpc->RxDescArray[cur_rx].status) & OWNbit) == 0) {
+ if (!(le32_to_cpu(tpc->RxDescArray[cur_rx].status) & RxRES)) {
unsigned char rxdata[RX_BUF_LEN];
- length = (int) (tpc->RxDescArray[cur_rx].
- status & 0x00001FFF) - 4;
+ length = (int) (le32_to_cpu(tpc->RxDescArray[cur_rx].
+ status) & 0x00001FFF) - 4;
memcpy(rxdata, tpc->RxBufferRing[cur_rx], length);
NetReceive(rxdata, length);
if (cur_rx == NUM_RX_DESC - 1)
tpc->RxDescArray[cur_rx].status =
- (OWNbit | EORbit) + RX_BUF_SIZE;
+ cpu_to_le32((OWNbit | EORbit) + RX_BUF_SIZE);
else
tpc->RxDescArray[cur_rx].status =
- OWNbit + RX_BUF_SIZE;
+ cpu_to_le32(OWNbit + RX_BUF_SIZE);
tpc->RxDescArray[cur_rx].buf_addr =
- virt_to_bus(tpc->RxBufferRing[cur_rx]);
+ cpu_to_le32(tpc->RxBufferRing[cur_rx]);
} else {
puts("Error Rx");
}
@@ -454,6 +452,7 @@ static int rtl_send(struct eth_device *dev, volatile void *packet, int length)
u8 *ptxb;
int entry = tpc->cur_tx % NUM_TX_DESC;
u32 len = length;
+ int ret;
#ifdef DEBUG_RTL8169_TX
int stime = currticks();
@@ -470,34 +469,38 @@ static int rtl_send(struct eth_device *dev, volatile void *packet, int length)
while (len < ETH_ZLEN)
ptxb[len++] = '\0';
- tpc->TxDescArray[entry].buf_addr = virt_to_bus(ptxb);
+ tpc->TxDescArray[entry].buf_addr = cpu_to_le32(ptxb);
if (entry != (NUM_TX_DESC - 1)) {
tpc->TxDescArray[entry].status =
- (OWNbit | FSbit | LSbit) | ((len > ETH_ZLEN) ?
- len : ETH_ZLEN);
+ cpu_to_le32((OWNbit | FSbit | LSbit) |
+ ((len > ETH_ZLEN) ? len : ETH_ZLEN));
} else {
tpc->TxDescArray[entry].status =
- (OWNbit | EORbit | FSbit | LSbit) |
- ((len > ETH_ZLEN) ? length : ETH_ZLEN);
+ cpu_to_le32((OWNbit | EORbit | FSbit | LSbit) |
+ ((len > ETH_ZLEN) ? len : ETH_ZLEN));
}
RTL_W8(TxPoll, 0x40); /* set polling bit */
tpc->cur_tx++;
to = currticks() + TX_TIMEOUT;
- while ((tpc->TxDescArray[entry].status & OWNbit) && (currticks() < to)); /* wait */
+ while ((le32_to_cpu(tpc->TxDescArray[entry].status) & OWNbit)
+ && (currticks() < to)); /* wait */
if (currticks() >= to) {
#ifdef DEBUG_RTL8169_TX
puts ("tx timeout/error\n");
printf ("%s elapsed time : %d\n", __FUNCTION__, currticks()-stime);
#endif
- return 0;
+ ret = 0;
} else {
#ifdef DEBUG_RTL8169_TX
puts("tx done\n");
#endif
- return length;
+ ret = length;
}
+ /* Delay to make net console (nc) work properly */
+ udelay(20);
+ return ret;
}
static void rtl8169_set_rx_mode(struct eth_device *dev)
@@ -564,8 +567,8 @@ static void rtl8169_hw_start(struct eth_device *dev)
tpc->cur_rx = 0;
- RTL_W32(TxDescStartAddr, virt_to_le32desc(tpc->TxDescArray));
- RTL_W32(RxDescStartAddr, virt_to_le32desc(tpc->RxDescArray));
+ RTL_W32(TxDescStartAddr, tpc->TxDescArray);
+ RTL_W32(RxDescStartAddr, tpc->RxDescArray);
RTL_W8(Cfg9346, Cfg9346_Lock);
udelay(10);
@@ -603,13 +606,14 @@ static void rtl8169_init_ring(struct eth_device *dev)
for (i = 0; i < NUM_RX_DESC; i++) {
if (i == (NUM_RX_DESC - 1))
tpc->RxDescArray[i].status =
- (OWNbit | EORbit) + RX_BUF_SIZE;
+ cpu_to_le32((OWNbit | EORbit) + RX_BUF_SIZE);
else
- tpc->RxDescArray[i].status = OWNbit + RX_BUF_SIZE;
+ tpc->RxDescArray[i].status =
+ cpu_to_le32(OWNbit + RX_BUF_SIZE);
tpc->RxBufferRing[i] = &rxb[i * RX_BUF_SIZE];
tpc->RxDescArray[i].buf_addr =
- virt_to_bus(tpc->RxBufferRing[i]);
+ cpu_to_le32(tpc->RxBufferRing[i]);
}
#ifdef DEBUG_RTL8169
@@ -623,8 +627,6 @@ RESET - Finish setting up the ethernet interface
static void rtl_reset(struct eth_device *dev, bd_t *bis)
{
int i;
- u8 diff;
- u32 TxPhyAddr, RxPhyAddr;
#ifdef DEBUG_RTL8169
int stime = currticks();
@@ -632,25 +634,14 @@ static void rtl_reset(struct eth_device *dev, bd_t *bis)
#endif
tpc->TxDescArrays = tx_ring;
- if (tpc->TxDescArrays == 0)
- puts("Allot Error");
/* Tx Desscriptor needs 256 bytes alignment; */
- TxPhyAddr = virt_to_bus(tpc->TxDescArrays);
- diff = 256 - (TxPhyAddr - ((TxPhyAddr >> 8) << 8));
- TxPhyAddr += diff;
- tpc->TxDescArray = (struct TxDesc *) (tpc->TxDescArrays + diff);
+ tpc->TxDescArray = (struct TxDesc *) ((unsigned long)(tpc->TxDescArrays +
+ 255) & ~255);
tpc->RxDescArrays = rx_ring;
/* Rx Desscriptor needs 256 bytes alignment; */
- RxPhyAddr = virt_to_bus(tpc->RxDescArrays);
- diff = 256 - (RxPhyAddr - ((RxPhyAddr >> 8) << 8));
- RxPhyAddr += diff;
- tpc->RxDescArray = (struct RxDesc *) (tpc->RxDescArrays + diff);
-
- if (tpc->TxDescArrays == NULL || tpc->RxDescArrays == NULL) {
- puts("Allocate RxDescArray or TxDescArray failed\n");
- return;
- }
+ tpc->RxDescArray = (struct RxDesc *) ((unsigned long)(tpc->RxDescArrays +
+ 255) & ~255);
rtl8169_init_ring(dev);
rtl8169_hw_start(dev);
@@ -733,7 +724,7 @@ static int rtl_init(struct eth_device *dev, bd_t *bis)
/* Get MAC address. FIXME: read EEPROM */
for (i = 0; i < MAC_ADDR_LEN; i++)
- dev->enetaddr[i] = RTL_R8(MAC0 + i);
+ bis->bi_enetaddr[i] = dev->enetaddr[i] = RTL_R8(MAC0 + i);
#ifdef DEBUG_RTL8169
printf("MAC Address");
@@ -808,7 +799,7 @@ static int rtl_init(struct eth_device *dev, bd_t *bis)
/* wait for auto-negotiation process */
for (i = 10000; i > 0; i--) {
/* check if auto-negotiation complete */
- if (mdio_read(PHY_STAT_REG) & PHY_Auto_Neco_Comp) {
+ if (mdio_read(PHY_STAT_REG) & PHY_Auto_Nego_Comp) {
udelay(100);
option = RTL_R8(PHYstatus);
if (option & _1000bpsF) {
@@ -818,13 +809,12 @@ static int rtl_init(struct eth_device *dev, bd_t *bis)
#endif
} else {
#ifdef DEBUG_RTL8169
- printf
- ("%s: %sMbps %s-duplex operation.\n",
- dev->name,
- (option & _100bps) ? "100" :
- "10",
- (option & FullDup) ? "Full" :
- "Half");
+ printf("%s: %sMbps %s-duplex operation.\n",
+ dev->name,
+ (option & _100bps) ? "100" :
+ "10",
+ (option & FullDup) ? "Full" :
+ "Half");
#endif
}
break;
@@ -869,7 +859,7 @@ int rtl8169_initialize(bd_t *bis)
sprintf (dev->name, "RTL8169#%d", card_number);
dev->priv = (void *) devno;
- dev->iobase = (int)bus_to_phys(iobase);
+ dev->iobase = (int)pci_mem_to_phys(devno, iobase);
dev->init = rtl_reset;
dev->halt = rtl_halt;
diff --git a/drivers/net/sk98lin/Makefile b/drivers/net/sk98lin/Makefile
index a7d4a3b..8b83fae 100644
--- a/drivers/net/sk98lin/Makefile
+++ b/drivers/net/sk98lin/Makefile
@@ -20,7 +20,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
-# File: drivers/sk98lin/Makefile
+# File: drivers/net/sk98lin/Makefile
#
# Makefile for the SysKonnect SK-98xx device driver.
#
diff --git a/drivers/usb/isp116x-hcd.c b/drivers/usb/isp116x-hcd.c
index b21af10..ac67030 100644
--- a/drivers/usb/isp116x-hcd.c
+++ b/drivers/usb/isp116x-hcd.c
@@ -20,7 +20,7 @@
* MA 02111-1307 USA
*
*
- * Derived in part from the SL811 HCD driver "u-boot/drivers/sl811_usb.c"
+ * Derived in part from the SL811 HCD driver "u-boot/drivers/usb/sl811_usb.c"
* (original copyright message follows):
*
* (C) Copyright 2004
diff --git a/drivers/usb/usbdcore_mpc8xx.c b/drivers/usb/usbdcore_mpc8xx.c
index d4c4096..122793c 100644
--- a/drivers/usb/usbdcore_mpc8xx.c
+++ b/drivers/usb/usbdcore_mpc8xx.c
@@ -3,7 +3,8 @@
* bodonoghue@CodeHermit.ie
*
* References
- * DasUBoot/drivers/usbdcore_omap1510.c, for design and implementation ideas.
+ * DasUBoot/drivers/usb/usbdcore_omap1510.c, for design and implementation
+ * ideas.
*
* 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
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index bcf8771..82cc0c7 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -187,9 +187,9 @@ CONFIG_VIDEO_HW_CURSOR: - Uses the hardware cursor capability of the
/*****************************************************************************/
/* Cursor definition: */
-/* CONFIG_CONSOLE_CURSOR: Uses a timer function (see drivers/i8042.c) to */
-/* let the cursor blink. Uses the macros CURSOR_OFF */
-/* and CURSOR_ON. */
+/* CONFIG_CONSOLE_CURSOR: Uses a timer function (see drivers/input/i8042.c) */
+/* to let the cursor blink. Uses the macros */
+/* CURSOR_OFF and CURSOR_ON. */
/* CONFIG_VIDEO_SW_CURSOR: Draws a cursor after the last character. No */
/* blinking is provided. Uses the macros CURSOR_SET */
/* and CURSOR_OFF. */
@@ -217,7 +217,7 @@ void console_cursor (int state);
#define CURSOR_OFF console_cursor(0);
#define CURSOR_SET
#ifndef CONFIG_I8042_KBD
-#warning Cursor drawing on/off needs timer function s.a. drivers/i8042.c
+#warning Cursor drawing on/off needs timer function s.a. drivers/input/i8042.c
#endif
#else
#ifdef CONFIG_CONSOLE_TIME
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index 5316668..69f53ea 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -165,7 +165,7 @@ static struct part_info *current_part;
int read_jffs2_nand(size_t start, size_t len,
size_t * retlen, u_char * buf, int nanddev);
#else
-/* info for NAND chips, defined in drivers/nand/nand.c */
+/* info for NAND chips, defined in drivers/mtd/nand/nand.c */
extern nand_info_t nand_info[];
#endif
diff --git a/include/configs/CATcenter.h b/include/configs/CATcenter.h
index 0321650..1603c9c 100644
--- a/include/configs/CATcenter.h
+++ b/include/configs/CATcenter.h
@@ -473,7 +473,7 @@
#define CONFIG_VGA_AS_SINGLE_DEVICE
/* This is the base address (on 405EP-side) used to generate I/O accesses on PCI bus */
#define CFG_ISA_IO 0xE8000000
-/* see also drivers/videomodes.c */
+/* see also drivers/video/videomodes.c */
#define CFG_DEFAULT_VIDEO_MODE 0x303
#endif
diff --git a/include/configs/M54455EVB.h b/include/configs/M54455EVB.h
index 35637f9..211f11d 100644
--- a/include/configs/M54455EVB.h
+++ b/include/configs/M54455EVB.h
@@ -294,7 +294,6 @@
#endif
/* M54455EVB has one non CFI flash, defined CFG_FLASH_CFI will cause the system
-/* M54455EVB has one non CFI flash, defined CFG_FLASH_CFI will cause the system
keep reset. */
#undef CFG_FLASH_CFI
#ifdef CFG_FLASH_CFI
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index c9a9c83..7bc4e27 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -192,7 +192,7 @@
#define CFG_LBC_MRTPR 0x20000000 /*TODO */ /* LB refresh timer prescal, 266MHz/32 */
-/* drivers/nand/nand.c */
+/* drivers/mtd/nand/nand.c */
#define CFG_NAND_BASE 0xE2800000 /* 0xF0000000 */
#define CFG_MAX_NAND_DEVICE 1
#define NAND_MAX_CHIPS 1
diff --git a/include/configs/PPChameleonEVB.h b/include/configs/PPChameleonEVB.h
index c2aa2cc..cf98324 100644
--- a/include/configs/PPChameleonEVB.h
+++ b/include/configs/PPChameleonEVB.h
@@ -496,7 +496,7 @@
#define CONFIG_VGA_AS_SINGLE_DEVICE
/* This is the base address (on 405EP-side) used to generate I/O accesses on PCI bus */
#define CFG_ISA_IO 0xE8000000
-/* see also drivers/videomodes.c */
+/* see also drivers/video/videomodes.c */
#define CFG_DEFAULT_VIDEO_MODE 0x303
#endif
diff --git a/include/configs/SX1.h b/include/configs/SX1.h
index 05cef87..50ad7dd 100644
--- a/include/configs/SX1.h
+++ b/include/configs/SX1.h
@@ -181,7 +181,7 @@
* FLASH driver setup
*/
#define CFG_FLASH_CFI 1 /* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER 1 /* Use drivers/cfi_flash.c */
+#define CFG_FLASH_CFI_DRIVER 1 /* Use drivers/mtd/cfi_flash.c */
#define CFG_FLASH_USE_BUFFER_WRITE 1 /* Use buffered writes (~10x faster) */
#define CFG_FLASH_PROTECTION 1 /* Use hardware sector protection */
diff --git a/include/configs/integratorcp.h b/include/configs/integratorcp.h
index 69310d4..e1d1483 100644
--- a/include/configs/integratorcp.h
+++ b/include/configs/integratorcp.h
@@ -168,7 +168,7 @@ SIB at Block62 End Block62 address 0x24f80000
/*
* Move up the U-Boot & monitor area if more flash is fitted.
* If this U-Boot is to be run on Integrators with varying flash sizes,
- * drivers/cfi_flash.c::flash_init() can read the Integrator CP_FLASHPROG
+ * drivers/mtd/cfi_flash.c::flash_init() can read the Integrator CP_FLASHPROG
* register and dynamically assign CFG_ENV_ADDR & CFG_MONITOR_BASE
* - CFG_MONITOR_BASE is set to indicate that the environment is not
* embedded in the boot monitor(s) area
diff --git a/include/configs/omap1510inn.h b/include/configs/omap1510inn.h
index 8623ed3..0be46ea 100644
--- a/include/configs/omap1510inn.h
+++ b/include/configs/omap1510inn.h
@@ -179,7 +179,7 @@
* FLASH driver setup
*/
#define CFG_FLASH_CFI 1 /* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER 1 /* Use drivers/cfi_flash.c */
+#define CFG_FLASH_CFI_DRIVER 1 /* Use drivers/mtd/cfi_flash.c */
#define CFG_FLASH_USE_BUFFER_WRITE 1 /* Use buffered writes (~10x faster) */
#define CFG_FLASH_PROTECTION 1 /* Use hardware sector protection */
diff --git a/include/configs/omap2420h4.h b/include/configs/omap2420h4.h
index 8ae8efe..88a3f6e 100644
--- a/include/configs/omap2420h4.h
+++ b/include/configs/omap2420h4.h
@@ -283,7 +283,7 @@
* CFI FLASH driver setup
*/
#define CFG_FLASH_CFI 1 /* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER 1 /* Use drivers/cfi_flash.c */
+#define CFG_FLASH_CFI_DRIVER 1 /* Use drivers/mtd/cfi_flash.c */
#define CFG_FLASH_USE_BUFFER_WRITE 1 /* Use buffered writes (~10x faster) */
#define CFG_FLASH_PROTECTION 1 /* Use hardware sector protection */
diff --git a/include/configs/omap5912osk.h b/include/configs/omap5912osk.h
index 16ce2f6..e3bde4f 100644
--- a/include/configs/omap5912osk.h
+++ b/include/configs/omap5912osk.h
@@ -174,7 +174,7 @@
* FLASH driver setup
*/
#define CFG_FLASH_CFI 1 /* Flash memory is CFI compliant */
-#define CFG_FLASH_CFI_DRIVER 1 /* Use drivers/cfi_flash.c */
+#define CFG_FLASH_CFI_DRIVER 1 /* Use drivers/mtd/cfi_flash.c */
#define CFG_FLASH_BANKS_LIST { PHYS_FLASH_1, PHYS_FLASH_2 }
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 49ff80f..4cc4a7d 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -129,7 +129,7 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
#define NAND_ECC_HW3_256 2
/* Hardware ECC 3 byte ECC per 512 Byte data */
#define NAND_ECC_HW3_512 3
-/* Hardware ECC 3 byte ECC per 512 Byte data */
+/* Hardware ECC 6 byte ECC per 512 Byte data */
#define NAND_ECC_HW6_512 4
/* Hardware ECC 8 byte ECC per 512 Byte data */
#define NAND_ECC_HW8_512 6
diff --git a/nand_spl/board/amcc/acadia/Makefile b/nand_spl/board/amcc/acadia/Makefile
index 6e53bea..4272108 100644
--- a/nand_spl/board/amcc/acadia/Makefile
+++ b/nand_spl/board/amcc/acadia/Makefile
@@ -97,7 +97,7 @@ $(obj)nand_boot.c:
@rm -f $(obj)nand_boot.c
ln -s $(SRCTREE)/nand_spl/nand_boot.c $(obj)nand_boot.c
-# from drivers/nand directory
+# from drivers/mtd/nand directory
$(obj)nand_ecc.c:
@rm -f $(obj)nand_ecc.c
ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $(obj)nand_ecc.c
diff --git a/nand_spl/board/amcc/bamboo/Makefile b/nand_spl/board/amcc/bamboo/Makefile
index 3a633fb..aed7960 100644
--- a/nand_spl/board/amcc/bamboo/Makefile
+++ b/nand_spl/board/amcc/bamboo/Makefile
@@ -79,7 +79,7 @@ $(obj)nand_boot.c:
@rm -f $(obj)nand_boot.c
ln -s $(SRCTREE)/nand_spl/nand_boot.c $(obj)nand_boot.c
-# from drivers/nand directory
+# from drivers/mtd/nand directory
$(obj)nand_ecc.c:
@rm -f $(obj)nand_ecc.c
ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $(obj)nand_ecc.c
diff --git a/nand_spl/board/amcc/sequoia/Makefile b/nand_spl/board/amcc/sequoia/Makefile
index dfa0ce3..93150aa 100644
--- a/nand_spl/board/amcc/sequoia/Makefile
+++ b/nand_spl/board/amcc/sequoia/Makefile
@@ -89,7 +89,7 @@ $(obj)nand_boot.c:
@rm -f $(obj)nand_boot.c
ln -s $(SRCTREE)/nand_spl/nand_boot.c $(obj)nand_boot.c
-# from drivers/nand directory
+# from drivers/mtd/nand directory
$(obj)nand_ecc.c:
@rm -f $(obj)nand_ecc.c
ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $(obj)nand_ecc.c
diff --git a/nand_spl/nand_boot.c b/nand_spl/nand_boot.c
index 840a596..e2147cb 100644
--- a/nand_spl/nand_boot.c
+++ b/nand_spl/nand_boot.c
@@ -73,7 +73,7 @@ static int nand_is_bad_block(struct mtd_info *mtd, int block)
nand_command(mtd, block, 0, CFG_NAND_BAD_BLOCK_POS, NAND_CMD_READOOB);
/*
- * Read on byte
+ * Read one byte
*/
if (this->read_byte(mtd) != 0xff)
return 1;
diff --git a/tools/Makefile b/tools/Makefile
index e8e0280..af0de47 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -97,6 +97,7 @@ endif
#
ifeq ($(HOSTOS),cygwin)
SFX = .exe
+HOST_CFLAGS += -ansi
else
SFX =
endif
@@ -136,7 +137,7 @@ $(obj)img2srec$(SFX): $(obj)img2srec.o
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
-$(obj)mkimage$(SFX): $(obj)mkimage.o $(obj)crc32.o $(obj)sha1.o
+$(obj)mkimage$(SFX): $(obj)mkimage.o $(obj)crc32.o
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
diff --git a/tools/easylogo/Makefile b/tools/easylogo/Makefile
index 292344a..566b125 100644
--- a/tools/easylogo/Makefile
+++ b/tools/easylogo/Makefile
@@ -1,2 +1,8 @@
-all: easylogo.c
- gcc easylogo.c -o easylogo
+CFLAGS += -Wall
+
+all: easylogo
+
+clean:
+ rm -f easylogo *.o
+
+.PHONY: all clean
diff --git a/tools/easylogo/easylogo.c b/tools/easylogo/easylogo.c
index 9f1d1ff..080bea9 100644
--- a/tools/easylogo/easylogo.c
+++ b/tools/easylogo/easylogo.c
@@ -8,415 +8,431 @@
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#pragma pack(1)
/*#define ENABLE_ASCII_BANNERS */
typedef struct {
- unsigned char id;
- unsigned char ColorMapType;
- unsigned char ImageTypeCode;
- unsigned short ColorMapOrigin;
- unsigned short ColorMapLenght;
- unsigned char ColorMapEntrySize;
- unsigned short ImageXOrigin;
- unsigned short ImageYOrigin;
- unsigned short ImageWidth;
- unsigned short ImageHeight;
- unsigned char ImagePixelSize;
- unsigned char ImageDescriptorByte;
+ unsigned char id;
+ unsigned char ColorMapType;
+ unsigned char ImageTypeCode;
+ unsigned short ColorMapOrigin;
+ unsigned short ColorMapLenght;
+ unsigned char ColorMapEntrySize;
+ unsigned short ImageXOrigin;
+ unsigned short ImageYOrigin;
+ unsigned short ImageWidth;
+ unsigned short ImageHeight;
+ unsigned char ImagePixelSize;
+ unsigned char ImageDescriptorByte;
} tga_header_t;
typedef struct {
- unsigned char r,g,b ;
-} rgb_t ;
+ unsigned char r, g, b;
+} rgb_t;
typedef struct {
- unsigned char b,g,r ;
-} bgr_t ;
+ unsigned char b, g, r;
+} bgr_t;
typedef struct {
- unsigned char Cb,y1,Cr,y2;
-} yuyv_t ;
+ unsigned char Cb, y1, Cr, y2;
+} yuyv_t;
typedef struct {
- unsigned char *data,
- *palette ;
- int width,
- height,
- pixels,
- bpp,
- pixel_size,
- size,
- palette_size,
- yuyv;
-} image_t ;
+ void *data, *palette;
+ int width, height, pixels, bpp, pixel_size, size, palette_size, yuyv;
+} image_t;
void StringUpperCase (char *str)
{
- int count = strlen(str);
- char c ;
-
- while(count--)
- {
- c=*str;
- if ((c >= 'a')&&(c<='z'))
- *str = 'A' + (c-'a');
- str++ ;
- }
+ int count = strlen (str);
+ char c;
+
+ while (count--) {
+ c = *str;
+ if ((c >= 'a') && (c <= 'z'))
+ *str = 'A' + (c - 'a');
+ str++;
+ }
}
void StringLowerCase (char *str)
{
- int count = strlen(str);
- char c ;
-
- while(count--)
- {
- c=*str;
- if ((c >= 'A')&&(c<='Z'))
- *str = 'a' + (c-'A');
- str++ ;
- }
+ int count = strlen (str);
+ char c;
+
+ while (count--) {
+ c = *str;
+ if ((c >= 'A') && (c <= 'Z'))
+ *str = 'a' + (c - 'A');
+ str++;
+ }
}
-void pixel_rgb_to_yuyv (rgb_t *rgb_pixel, yuyv_t *yuyv_pixel)
+void pixel_rgb_to_yuyv (rgb_t * rgb_pixel, yuyv_t * yuyv_pixel)
{
- unsigned int pR, pG, pB ;
+ unsigned int pR, pG, pB;
- /* Transform (0-255) components to (0-100) */
- pR = rgb_pixel->r * 100 / 255 ;
- pG = rgb_pixel->g * 100 / 255 ;
- pB = rgb_pixel->b * 100 / 255 ;
+ /* Transform (0-255) components to (0-100) */
+ pR = rgb_pixel->r * 100 / 255;
+ pG = rgb_pixel->g * 100 / 255;
+ pB = rgb_pixel->b * 100 / 255;
- /* Calculate YUV values (0-255) from RGB beetween 0-100 */
- yuyv_pixel->y1 = yuyv_pixel->y2 = 209 * (pR + pG + pB) / 300 + 16 ;
- yuyv_pixel->Cb = pB - (pR/4) - (pG*3/4) + 128 ;
- yuyv_pixel->Cr = pR - (pG*3/4) - (pB/4) + 128 ;
+ /* Calculate YUV values (0-255) from RGB beetween 0-100 */
+ yuyv_pixel->y1 = yuyv_pixel->y2 = 209 * (pR + pG + pB) / 300 + 16;
+ yuyv_pixel->Cb = pB - (pR / 4) - (pG * 3 / 4) + 128;
+ yuyv_pixel->Cr = pR - (pG * 3 / 4) - (pB / 4) + 128;
- return ;
+ return;
}
-void printlogo_rgb (rgb_t *data, int w, int h)
+void printlogo_rgb (rgb_t * data, int w, int h)
{
- int x,y;
- for (y=0; y<h; y++)
- {
- for (x=0; x<w; x++, data++)
- if ((data->r < 30)/*&&(data->g == 0)&&(data->b == 0)*/)
- printf(" ");
- else
- printf("X");
- printf("\n");
- }
+ int x, y;
+
+ for (y = 0; y < h; y++) {
+ for (x = 0; x < w; x++, data++)
+ if ((data->r <
+ 30) /*&&(data->g == 0)&&(data->b == 0) */ )
+ printf (" ");
+ else
+ printf ("X");
+ printf ("\n");
+ }
}
void printlogo_yuyv (unsigned short *data, int w, int h)
{
- int x,y;
- for (y=0; y<h; y++)
- {
- for (x=0; x<w; x++, data++)
- if (*data == 0x1080) /* Because of inverted on i386! */
- printf(" ");
- else
- printf("X");
- printf("\n");
- }
+ int x, y;
+
+ for (y = 0; y < h; y++) {
+ for (x = 0; x < w; x++, data++)
+ if (*data == 0x1080) /* Because of inverted on i386! */
+ printf (" ");
+ else
+ printf ("X");
+ printf ("\n");
+ }
}
-int image_load_tga (image_t *image, char *filename)
+static inline unsigned short le16_to_cpu (unsigned short val)
{
- FILE *file ;
- tga_header_t header ;
- int i;
- unsigned char app ;
- rgb_t *p ;
+ union {
+ unsigned char pval[2];
+ unsigned short val;
+ } swapped;
- if( ( file = fopen( filename, "rb" ) ) == NULL )
- return -1;
-
- fread(&header, sizeof(header), 1, file);
-
- image->width = header.ImageWidth ;
- image->height = header.ImageHeight ;
+ swapped.val = val;
+ return (swapped.pval[1] << 8) + swapped.pval[0];
+}
- switch (header.ImageTypeCode){
- case 2: /* Uncompressed RGB */
- image->yuyv = 0 ;
- image->palette_size = 0 ;
- image->palette = NULL ;
- break;
+int image_load_tga (image_t * image, char *filename)
+{
+ FILE *file;
+ tga_header_t header;
+ int i;
+ unsigned char app;
+ rgb_t *p;
+
+ if ((file = fopen (filename, "rb")) == NULL)
+ return -1;
+
+ fread (&header, sizeof (header), 1, file);
+
+ /* byte swap: tga is little endian, host is ??? */
+ header.ColorMapOrigin = le16_to_cpu (header.ColorMapOrigin);
+ header.ColorMapLenght = le16_to_cpu (header.ColorMapLenght);
+ header.ImageXOrigin = le16_to_cpu (header.ImageXOrigin);
+ header.ImageYOrigin = le16_to_cpu (header.ImageYOrigin);
+ header.ImageWidth = le16_to_cpu (header.ImageWidth);
+ header.ImageHeight = le16_to_cpu (header.ImageHeight);
+
+ image->width = header.ImageWidth;
+ image->height = header.ImageHeight;
+
+ switch (header.ImageTypeCode) {
+ case 2: /* Uncompressed RGB */
+ image->yuyv = 0;
+ image->palette_size = 0;
+ image->palette = NULL;
+ break;
default:
- printf("Format not supported!\n");
- return -1 ;
- }
+ printf ("Format not supported!\n");
+ return -1;
+ }
- image->bpp = header.ImagePixelSize ;
- image->pixel_size = ((image->bpp-1) / 8) + 1 ;
- image->pixels = image->width * image->height;
- image->size = image->pixels * image->pixel_size ;
- image->data = malloc(image->size) ;
+ image->bpp = header.ImagePixelSize;
+ image->pixel_size = ((image->bpp - 1) / 8) + 1;
+ image->pixels = image->width * image->height;
+ image->size = image->pixels * image->pixel_size;
+ image->data = malloc (image->size);
- if (image->bpp != 24)
- {
- printf("Bpp not supported: %d!\n", image->bpp);
- return -1 ;
- }
+ if (image->bpp != 24) {
+ printf ("Bpp not supported: %d!\n", image->bpp);
+ return -1;
+ }
- fread(image->data, image->size, 1, file);
+ fread (image->data, image->size, 1, file);
/* Swapping R and B values */
- p = image->data ;
- for(i=0; i < image->pixels; i++, p++)
- {
- app = p->r ;
- p->r = p->b ;
- p->b = app ;
- }
+ p = image->data;
+ for (i = 0; i < image->pixels; i++, p++) {
+ app = p->r;
+ p->r = p->b;
+ p->b = app;
+ }
/* Swapping image */
- if(!(header.ImageDescriptorByte & 0x20))
- {
- unsigned char *temp = malloc(image->size);
- int linesize = image->pixel_size * image->width ;
- void *dest = image->data,
- *source = temp + image->size - linesize ;
-
- printf("S");
- if (temp == NULL)
- {
- printf("Cannot alloc temp buffer!\n");
- return -1;
- }
+ if (!(header.ImageDescriptorByte & 0x20)) {
+ unsigned char *temp = malloc (image->size);
+ int linesize = image->pixel_size * image->width;
+ void *dest = image->data,
+ *source = temp + image->size - linesize;
- memcpy(temp, image->data, image->size);
- for(i = 0; i<image->height; i++, dest+=linesize, source-=linesize)
- memcpy(dest, source, linesize);
+ printf ("S");
+ if (temp == NULL) {
+ printf ("Cannot alloc temp buffer!\n");
+ return -1;
+ }
- free( temp );
- }
+ memcpy (temp, image->data, image->size);
+ for (i = 0; i < image->height;
+ i++, dest += linesize, source -= linesize)
+ memcpy (dest, source, linesize);
+ free (temp);
+ }
#ifdef ENABLE_ASCII_BANNERS
- printlogo_rgb (image->data,image->width, image->height);
+ printlogo_rgb (image->data, image->width, image->height);
#endif
- fclose (file);
- return 0;
+ fclose (file);
+ return 0;
}
-int image_free (image_t *image)
+int image_free (image_t * image)
{
- if(image->data != NULL)
- free(image->data);
+ if (image->data != NULL)
+ free (image->data);
- if(image->palette != NULL)
- free(image->palette);
+ if (image->palette != NULL)
+ free (image->palette);
return 0;
}
-int image_rgb_to_yuyv (image_t *rgb_image, image_t *yuyv_image)
+int image_rgb_to_yuyv (image_t * rgb_image, image_t * yuyv_image)
{
- rgb_t *rgb_ptr = (rgb_t *) rgb_image->data ;
- yuyv_t yuyv ;
- unsigned short *dest ;
- int count = 0 ;
-
- yuyv_image->pixel_size = 2 ;
- yuyv_image->bpp = 16 ;
- yuyv_image->yuyv = 1 ;
- yuyv_image->width = rgb_image->width ;
- yuyv_image->height = rgb_image->height ;
- yuyv_image->pixels = yuyv_image->width * yuyv_image->height ;
- yuyv_image->size = yuyv_image->pixels * yuyv_image->pixel_size ;
- dest = (unsigned short *) (yuyv_image->data = malloc(yuyv_image->size)) ;
- yuyv_image->palette = 0 ;
- yuyv_image->palette_size= 0 ;
-
- while((count++) < rgb_image->pixels)
- {
+ rgb_t *rgb_ptr = (rgb_t *) rgb_image->data;
+ yuyv_t yuyv;
+ unsigned short *dest;
+ int count = 0;
+
+ yuyv_image->pixel_size = 2;
+ yuyv_image->bpp = 16;
+ yuyv_image->yuyv = 1;
+ yuyv_image->width = rgb_image->width;
+ yuyv_image->height = rgb_image->height;
+ yuyv_image->pixels = yuyv_image->width * yuyv_image->height;
+ yuyv_image->size = yuyv_image->pixels * yuyv_image->pixel_size;
+ dest = (unsigned short *) (yuyv_image->data =
+ malloc (yuyv_image->size));
+ yuyv_image->palette = 0;
+ yuyv_image->palette_size = 0;
+
+ while ((count++) < rgb_image->pixels) {
pixel_rgb_to_yuyv (rgb_ptr++, &yuyv);
- if ((count & 1)==0) /* Was == 0 */
- memcpy (dest, ((void *)&yuyv) + 2, sizeof(short));
+ if ((count & 1) == 0) /* Was == 0 */
+ memcpy (dest, ((void *) &yuyv) + 2, sizeof (short));
else
- memcpy (dest, (void *)&yuyv, sizeof(short));
+ memcpy (dest, (void *) &yuyv, sizeof (short));
- dest ++ ;
+ dest++;
}
#ifdef ENABLE_ASCII_BANNERS
- printlogo_yuyv (yuyv_image->data, yuyv_image->width, yuyv_image->height);
+ printlogo_yuyv (yuyv_image->data, yuyv_image->width,
+ yuyv_image->height);
#endif
- return 0 ;
+ return 0;
}
-int image_save_header (image_t *image, char *filename, char *varname)
+int image_save_header (image_t * image, char *filename, char *varname)
{
- FILE *file = fopen (filename, "w");
- char app[256], str[256]="", def_name[64] ;
- int count = image->size, col=0;
- unsigned char *dataptr = image->data ;
- if (file==NULL)
- return -1 ;
-
-/* Author information */
- fprintf(file, "/*\n * Generated by EasyLogo, (C) 2000 by Paolo Scaffardi\n *\n");
- fprintf(file, " * To use this, include it and call: easylogo_plot(screen,&%s, width,x,y)\n *\n", varname);
- fprintf(file, " * Where:\t'screen'\tis the pointer to the frame buffer\n");
- fprintf(file, " *\t\t'width'\tis the screen width\n");
- fprintf(file, " *\t\t'x'\t\tis the horizontal position\n");
- fprintf(file, " *\t\t'y'\t\tis the vertical position\n */\n\n");
-
-/* Headers */
- fprintf(file, "#include <video_easylogo.h>\n\n");
-/* Macros */
- strcpy(def_name, varname);
+ FILE *file = fopen (filename, "w");
+ char app[256], str[256] = "", def_name[64];
+ int count = image->size, col = 0;
+ unsigned char *dataptr = image->data;
+
+ if (file == NULL)
+ return -1;
+
+ /* Author information */
+ fprintf (file,
+ "/*\n * Generated by EasyLogo, (C) 2000 by Paolo Scaffardi\n *\n");
+ fprintf (file,
+ " * To use this, include it and call: easylogo_plot(screen,&%s, width,x,y)\n *\n",
+ varname);
+ fprintf (file,
+ " * Where:\t'screen'\tis the pointer to the frame buffer\n");
+ fprintf (file, " *\t\t'width'\tis the screen width\n");
+ fprintf (file, " *\t\t'x'\t\tis the horizontal position\n");
+ fprintf (file, " *\t\t'y'\t\tis the vertical position\n */\n\n");
+
+ /* Headers */
+ fprintf (file, "#include <video_easylogo.h>\n\n");
+ /* Macros */
+ strcpy (def_name, varname);
StringUpperCase (def_name);
- fprintf(file, "#define DEF_%s_WIDTH\t\t%d\n", def_name, image->width);
- fprintf(file, "#define DEF_%s_HEIGHT\t\t%d\n", def_name, image->height);
- fprintf(file, "#define DEF_%s_PIXELS\t\t%d\n", def_name, image->pixels);
- fprintf(file, "#define DEF_%s_BPP\t\t%d\n", def_name, image->bpp);
- fprintf(file, "#define DEF_%s_PIXEL_SIZE\t%d\n", def_name, image->pixel_size);
- fprintf(file, "#define DEF_%s_SIZE\t\t%d\n\n", def_name, image->size);
-/* Declaration */
- fprintf(file, "unsigned char DEF_%s_DATA[DEF_%s_SIZE] = {\n", def_name, def_name);
-
-/* Data */
- while(count)
- switch (col){
- case 0:
- sprintf(str, " 0x%02x", *dataptr++);
- col++;
- count-- ;
- break;
-
- case 16:
- fprintf(file, "%s", str);
- if (count > 0)
- fprintf(file,",");
- fprintf(file, "\n");
-
- col = 0 ;
- break;
-
- default:
- strcpy(app, str);
- sprintf(str, "%s, 0x%02x", app, *dataptr++);
- col++ ;
- count-- ;
- break;
+ fprintf (file, "#define DEF_%s_WIDTH\t\t%d\n", def_name,
+ image->width);
+ fprintf (file, "#define DEF_%s_HEIGHT\t\t%d\n", def_name,
+ image->height);
+ fprintf (file, "#define DEF_%s_PIXELS\t\t%d\n", def_name,
+ image->pixels);
+ fprintf (file, "#define DEF_%s_BPP\t\t%d\n", def_name, image->bpp);
+ fprintf (file, "#define DEF_%s_PIXEL_SIZE\t%d\n", def_name,
+ image->pixel_size);
+ fprintf (file, "#define DEF_%s_SIZE\t\t%d\n\n", def_name,
+ image->size);
+ /* Declaration */
+ fprintf (file, "unsigned char DEF_%s_DATA[DEF_%s_SIZE] = {\n",
+ def_name, def_name);
+
+ /* Data */
+ while (count)
+ switch (col) {
+ case 0:
+ sprintf (str, " 0x%02x", *dataptr++);
+ col++;
+ count--;
+ break;
+
+ case 16:
+ fprintf (file, "%s", str);
+ if (count > 0)
+ fprintf (file, ",");
+ fprintf (file, "\n");
+
+ col = 0;
+ break;
+
+ default:
+ strcpy (app, str);
+ sprintf (str, "%s, 0x%02x", app, *dataptr++);
+ col++;
+ count--;
+ break;
}
if (col)
- fprintf(file, "%s\n", str);
-
-/* End of declaration */
- fprintf(file, "};\n\n");
-/* Variable */
- fprintf(file, "fastimage_t %s = {\n", varname);
- fprintf(file, " DEF_%s_DATA,\n", def_name);
- fprintf(file, " DEF_%s_WIDTH,\n", def_name);
- fprintf(file, " DEF_%s_HEIGHT,\n", def_name);
- fprintf(file, " DEF_%s_BPP,\n", def_name);
- fprintf(file, " DEF_%s_PIXEL_SIZE,\n", def_name);
- fprintf(file, " DEF_%s_SIZE\n};\n", def_name);
+ fprintf (file, "%s\n", str);
+
+ /* End of declaration */
+ fprintf (file, "};\n\n");
+ /* Variable */
+ fprintf (file, "fastimage_t %s = {\n", varname);
+ fprintf (file, " DEF_%s_DATA,\n", def_name);
+ fprintf (file, " DEF_%s_WIDTH,\n", def_name);
+ fprintf (file, " DEF_%s_HEIGHT,\n", def_name);
+ fprintf (file, " DEF_%s_BPP,\n", def_name);
+ fprintf (file, " DEF_%s_PIXEL_SIZE,\n", def_name);
+ fprintf (file, " DEF_%s_SIZE\n};\n", def_name);
fclose (file);
- return 0 ;
+ return 0;
}
#define DEF_FILELEN 256
int main (int argc, char *argv[])
{
- char
- inputfile[DEF_FILELEN],
- outputfile[DEF_FILELEN],
- varname[DEF_FILELEN];
-
- image_t rgb_logo, yuyv_logo ;
-
- switch (argc){
- case 2:
- case 3:
- case 4:
- strcpy (inputfile, argv[1]);
-
- if (argc > 2)
- strcpy (varname, argv[2]);
- else
- {
- int pos = strchr(inputfile, '.');
-
- if (pos >= 0)
- {
- strncpy (varname, inputfile, pos);
- varname[pos] = 0 ;
- }
- }
+ char inputfile[DEF_FILELEN],
+ outputfile[DEF_FILELEN], varname[DEF_FILELEN];
+
+ image_t rgb_logo, yuyv_logo;
+
+ switch (argc) {
+ case 2:
+ case 3:
+ case 4:
+ strcpy (inputfile, argv[1]);
+
+ if (argc > 2)
+ strcpy (varname, argv[2]);
+ else {
+ char *dot = strchr (inputfile, '.');
+ int pos = dot - inputfile;
+
+ if (dot) {
+ strncpy (varname, inputfile, pos);
+ varname[pos] = 0;
+ }
+ }
- if (argc > 3)
- strcpy (outputfile, argv[3]);
- else
- {
- int pos = strchr (varname, '.');
+ if (argc > 3)
+ strcpy (outputfile, argv[3]);
+ else {
+ char *dot = strchr (varname, '.');
+ int pos = dot - varname;
- if (pos > 0)
- {
- char app[DEF_FILELEN] ;
+ if (dot) {
+ char app[DEF_FILELEN];
- strncpy(app, varname, pos);
- sprintf(outputfile, "%s.h", app);
- }
- }
- break;
+ strncpy (app, varname, pos);
+ app[pos] = 0;
+ sprintf (outputfile, "%s.h", app);
+ }
+ }
+ break;
- default:
- printf("EasyLogo 1.0 (C) 2000 by Paolo Scaffardi\n\n");
+ default:
+ printf ("EasyLogo 1.0 (C) 2000 by Paolo Scaffardi\n\n");
- printf("Syntax: easylogo inputfile [outputvar {outputfile}] \n");
- printf("\n");
- printf("Where: 'inputfile' is the TGA image to load\n");
- printf(" 'outputvar' is the variable name to create\n");
- printf(" 'outputfile' is the output header file (default is 'inputfile.h')\n");
+ printf("Syntax: easylogo inputfile [outputvar {outputfile}] \n");
+ printf("\n");
+ printf("Where: 'inputfile' is the TGA image to load\n");
+ printf(" 'outputvar' is the variable name to create\n");
+ printf(" 'outputfile' is the output header file (default is 'inputfile.h')\n");
- return -1 ;
- }
+ return -1;
+ }
- printf("Doing '%s' (%s) from '%s'...",
- outputfile, varname, inputfile);
+ printf ("Doing '%s' (%s) from '%s'...",
+ outputfile, varname, inputfile);
-/* Import TGA logo */
+ /* Import TGA logo */
- printf("L");
- if (image_load_tga (&rgb_logo, inputfile)<0)
- {
- printf("input file not found!\n");
- exit(1);
- }
+ printf ("L");
+ if (image_load_tga (&rgb_logo, inputfile) < 0) {
+ printf ("input file not found!\n");
+ exit (1);
+ }
-/* Convert it to YUYV format */
+ /* Convert it to YUYV format */
- printf("C");
- image_rgb_to_yuyv (&rgb_logo, &yuyv_logo) ;
+ printf ("C");
+ image_rgb_to_yuyv (&rgb_logo, &yuyv_logo);
-/* Save it into a header format */
+ /* Save it into a header format */
- printf("S");
- image_save_header (&yuyv_logo, outputfile, varname) ;
+ printf ("S");
+ image_save_header (&yuyv_logo, outputfile, varname);
-/* Free original image and copy */
+ /* Free original image and copy */
- image_free (&rgb_logo);
- image_free (&yuyv_logo);
+ image_free (&rgb_logo);
+ image_free (&yuyv_logo);
- printf("\n");
+ printf ("\n");
- return 0 ;
+ return 0;
}