summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/mpc5xxx/fec.c4
-rw-r--r--cpu/mpc5xxx/i2c.c13
-rw-r--r--cpu/mpc8220/fec.c2
-rw-r--r--cpu/mpc8220/i2c.c14
-rw-r--r--cpu/mpc824x/drivers/i2c/i2c.c4
-rw-r--r--cpu/mpc8260/i2c.c2
-rw-r--r--cpu/mpc83xx/cpu.c2
-rw-r--r--cpu/mpc83xx/i2c.c8
-rw-r--r--cpu/mpc83xx/pci.c4
-rw-r--r--cpu/mpc83xx/speed.c112
-rw-r--r--cpu/mpc85xx/i2c.c4
-rw-r--r--cpu/mpc8xx/config.mk2
-rw-r--r--cpu/mpc8xx/i2c.c2
-rw-r--r--cpu/mpc8xx/spi.c4
-rw-r--r--cpu/mpc8xx/video.c6
-rw-r--r--cpu/ppc4xx/i2c.c2
-rw-r--r--cpu/ppc4xx/spd_sdram.c2
17 files changed, 68 insertions, 119 deletions
diff --git a/cpu/mpc5xxx/fec.c b/cpu/mpc5xxx/fec.c
index c3d30a049d..eadb7ecd34 100644
--- a/cpu/mpc5xxx/fec.c
+++ b/cpu/mpc5xxx/fec.c
@@ -320,7 +320,7 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
* Set individual address filter for unicast address
* and set physical address registers.
*/
- mpc5xxx_fec_set_hwaddr(fec, dev->enetaddr);
+ mpc5xxx_fec_set_hwaddr(fec, (char *)dev->enetaddr);
/*
* Set multicast address filter
@@ -785,7 +785,7 @@ static int mpc5xxx_fec_recv(struct eth_device *dev)
unsigned long ievent;
int frame_length, len = 0;
NBUF *frame;
- char buff[FEC_MAX_PKT_SIZE];
+ uchar buff[FEC_MAX_PKT_SIZE];
#if (DEBUG & 0x1)
printf ("mpc5xxx_fec_recv %d Start...\n", fec->rbdIndex);
diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c
index 845f7c05ef..044db46f6f 100644
--- a/cpu/mpc5xxx/i2c.c
+++ b/cpu/mpc5xxx/i2c.c
@@ -55,8 +55,9 @@ static int mpc_get_fdr (int);
static int mpc_reg_in(volatile u32 *reg)
{
- return *reg >> 24;
+ int ret = *reg >> 24;
__asm__ __volatile__ ("eieio");
+ return ret;
}
static void mpc_reg_out(volatile u32 *reg, int val, int mask)
@@ -298,7 +299,7 @@ int i2c_probe(uchar chip)
int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
{
- uchar xaddr[4];
+ char xaddr[4];
struct mpc5xxx_i2c * regs = (struct mpc5xxx_i2c *)I2C_BASE;
int ret = -1;
@@ -329,7 +330,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
goto Done;
}
- if (receive_bytes(chip, buf, len)) {
+ if (receive_bytes(chip, (char *)buf, len)) {
printf("i2c_read: receive_bytes failed\n");
goto Done;
}
@@ -342,7 +343,7 @@ Done:
int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
{
- uchar xaddr[4];
+ char xaddr[4];
struct mpc5xxx_i2c *regs = (struct mpc5xxx_i2c *)I2C_BASE;
int ret = -1;
@@ -367,7 +368,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
goto Done;
}
- if (send_bytes(chip, buf, len)) {
+ if (send_bytes(chip, (char *)buf, len)) {
printf("i2c_write: send_bytes failed\n");
goto Done;
}
@@ -380,7 +381,7 @@ Done:
uchar i2c_reg_read(uchar chip, uchar reg)
{
- char buf;
+ uchar buf;
i2c_read(chip, reg, 1, &buf, 1);
diff --git a/cpu/mpc8220/fec.c b/cpu/mpc8220/fec.c
index e974ab3494..d5cd22e542 100644
--- a/cpu/mpc8220/fec.c
+++ b/cpu/mpc8220/fec.c
@@ -330,7 +330,7 @@ static int mpc8220_fec_init (struct eth_device *dev, bd_t * bis)
* Set individual address filter for unicast address
* and set physical address registers.
*/
- mpc8220_fec_set_hwaddr (fec, dev->enetaddr);
+ mpc8220_fec_set_hwaddr (fec, (char *)(dev->enetaddr));
/*
* Set multicast address filter
diff --git a/cpu/mpc8220/i2c.c b/cpu/mpc8220/i2c.c
index e9d077178b..62f7c0f5d3 100644
--- a/cpu/mpc8220/i2c.c
+++ b/cpu/mpc8220/i2c.c
@@ -73,8 +73,10 @@ static int mpc_get_fdr (int);
static int mpc_reg_in (volatile u32 * reg)
{
- return *reg >> 24;
+ int ret;
+ ret = *reg >> 24;
__asm__ __volatile__ ("eieio");
+ return ret;
}
static void mpc_reg_out (volatile u32 * reg, int val, int mask)
@@ -324,7 +326,7 @@ int i2c_read (uchar chip, uint addr, int alen, uchar * buf, int len)
goto Done;
}
- if (send_bytes (chip, &xaddr[4 - alen], alen)) {
+ if (send_bytes (chip, (char *)&xaddr[4 - alen], alen)) {
printf ("i2c_read: send_bytes failed\n");
goto Done;
}
@@ -335,7 +337,7 @@ int i2c_read (uchar chip, uint addr, int alen, uchar * buf, int len)
goto Done;
}
- if (receive_bytes (chip, buf, len)) {
+ if (receive_bytes (chip, (char *)buf, len)) {
printf ("i2c_read: receive_bytes failed\n");
goto Done;
}
@@ -368,12 +370,12 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buf, int len)
goto Done;
}
- if (send_bytes (chip, &xaddr[4 - alen], alen)) {
+ if (send_bytes (chip, (char *)&xaddr[4 - alen], alen)) {
printf ("i2c_write: send_bytes failed\n");
goto Done;
}
- if (send_bytes (chip, buf, len)) {
+ if (send_bytes (chip, (char *)buf, len)) {
printf ("i2c_write: send_bytes failed\n");
goto Done;
}
@@ -386,7 +388,7 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buf, int len)
uchar i2c_reg_read (uchar chip, uchar reg)
{
- char buf;
+ uchar buf;
i2c_read (chip, reg, 1, &buf, 1);
diff --git a/cpu/mpc824x/drivers/i2c/i2c.c b/cpu/mpc824x/drivers/i2c/i2c.c
index 7445a1ce31..3add687514 100644
--- a/cpu/mpc824x/drivers/i2c/i2c.c
+++ b/cpu/mpc824x/drivers/i2c/i2c.c
@@ -264,12 +264,12 @@ int i2c_probe (uchar chip)
* and looking for an <ACK> back.
*/
udelay (10000);
- return i2c_read (chip, 0, 1, (char *) &tmp, 1);
+ return i2c_read (chip, 0, 1, (uchar *) &tmp, 1);
}
uchar i2c_reg_read (uchar i2c_addr, uchar reg)
{
- char buf[1];
+ uchar buf[1];
i2c_read (i2c_addr, reg, 1, buf, 1);
diff --git a/cpu/mpc8260/i2c.c b/cpu/mpc8260/i2c.c
index e0ac684081..ea97ab85fb 100644
--- a/cpu/mpc8260/i2c.c
+++ b/cpu/mpc8260/i2c.c
@@ -752,7 +752,7 @@ i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
uchar
i2c_reg_read(uchar chip, uchar reg)
{
- char buf;
+ uchar buf;
i2c_read(chip, reg, 1, &buf, 1);
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
index c84aeb4df0..7a1f939ba0 100644
--- a/cpu/mpc83xx/cpu.c
+++ b/cpu/mpc83xx/cpu.c
@@ -50,7 +50,7 @@ int checkcpu(void)
return -1;
}
- puts("CPU: MPC83xx, ");
+ puts("CPU: MPC83xx, ");
switch(pvr) {
case PVR_8349_REV10:
break;
diff --git a/cpu/mpc83xx/i2c.c b/cpu/mpc83xx/i2c.c
index 3db7d2cbcd..4e70f808a4 100644
--- a/cpu/mpc83xx/i2c.c
+++ b/cpu/mpc83xx/i2c.c
@@ -41,7 +41,7 @@
#include <i2c.h>
#include <asm/i2c.h>
-#ifdef CONFIG_MPC8349ADS
+#if defined(CONFIG_MPC8349ADS) || defined(CONFIG_TQM834X)
i2c_t * mpc8349_i2c = (i2c_t*)(CFG_IMMRBAR + CFG_I2C_OFFSET);
#endif
@@ -109,7 +109,9 @@ i2c_wait (int write)
return 0;
} while (get_timer (timeval) < I2C_TIMEOUT);
+
debug("i2c_wait: timed out\n");
+ return -1;
}
static __inline__ int
@@ -231,12 +233,12 @@ int i2c_probe (uchar chip)
* and looking for an <ACK> back.
*/
udelay(10000);
- return i2c_read (chip, 0, 1, (char *)&tmp, 1);
+ return i2c_read (chip, 0, 1, (uchar *)&tmp, 1);
}
uchar i2c_reg_read (uchar i2c_addr, uchar reg)
{
- char buf[1];
+ uchar buf[1];
i2c_read (i2c_addr, reg, 1, buf, 1);
diff --git a/cpu/mpc83xx/pci.c b/cpu/mpc83xx/pci.c
index d5fa811edf..df7a540bb6 100644
--- a/cpu/mpc83xx/pci.c
+++ b/cpu/mpc83xx/pci.c
@@ -35,7 +35,7 @@
#include <common.h>
#include <pci.h>
-#ifdef CONFIG_MPC8349ADS
+#if defined(CONFIG_MPC8349ADS) || defined(CONFIG_TQM834X)
#include <asm/i2c.h>
#endif
@@ -114,7 +114,7 @@ pci_mpc83xx_init(volatile struct pci_controller *hose)
/*
* Assign PIB PMC slot to desired PCI bus
*/
-#ifdef CONFIG_MPC8349ADS
+#if defined(CONFIG_MPC8349ADS) || defined(CONFIG_TQM834X)
mpc8349_i2c = (i2c_t*)(CFG_IMMRBAR + CFG_I2C2_OFFSET);
i2c_init(CFG_I2C_SPEED,CFG_I2C_SLAVE);
#endif
diff --git a/cpu/mpc83xx/speed.c b/cpu/mpc83xx/speed.c
index 260137da82..eb3e2c6902 100644
--- a/cpu/mpc83xx/speed.c
+++ b/cpu/mpc83xx/speed.c
@@ -118,41 +118,50 @@ int get_clocks (void)
return -1;
#ifndef CFG_HRCW_HIGH
-# error "CFG_HRCW_HIGH must be defined in include/configs/MCP83XXADS.h"
+# error "CFG_HRCW_HIGH must be defined in board config file"
#endif /* CFG_HCWD_HIGH */
#if (CFG_HRCW_HIGH & HRCWH_PCI_HOST)
+
# ifndef CONFIG_83XX_CLKIN
-# error "In PCI Host Mode, CONFIG_83XX_CLKIN must be defined in include/configs/MCP83XXADS.h"
+# error "In PCI Host Mode, CONFIG_83XX_CLKIN must be defined in board config file"
# endif /* CONFIG_83XX_CLKIN */
# ifdef CONFIG_83XX_PCICLK
-# warning "In PCI Host Mode, CONFIG_83XX_PCICLK in include/configs/MCP83XXADS.h is igonred."
+# warning "In PCI Host Mode, CONFIG_83XX_PCICLK in board config file is igonred"
# endif /* CONFIG_83XX_PCICLK */
-/* PCI Host Mode */
+
+ /* PCI Host Mode */
if (!(im->reset.rcwh & RCWH_PCIHOST)) {
- /* though RCWH_PCIHOST is defined in CFG_HRCW_HIGH the im->reset.rcwhr PCI Host Mode is disabled */
- /* FIXME: findout if there is a way to issue some warning */
+ /* though RCWH_PCIHOST is defined in CFG_HRCW_HIGH
+ * the im->reset.rcwhr PCI Host Mode is disabled
+ * FIXME: findout if there is a way to issue some warning */
return -2;
}
if (im->clk.spmr & SPMR_CKID) {
- pci_sync_in = CONFIG_83XX_CLKIN / 2; /* PCI Clock is half CONFIG_83XX_CLKIN */
+ /* PCI Clock is half CONFIG_83XX_CLKIN */
+ pci_sync_in = CONFIG_83XX_CLKIN / 2;
}
else {
pci_sync_in = CONFIG_83XX_CLKIN;
}
-#else
+
+#else /* (CFG_HRCW_HIGH & HRCWH_PCI_HOST) */
+
# ifdef CONFIG_83XX_CLKIN
-# warning "In PCI Agent Mode, CONFIG_83XX_CLKIN in include/configs/MCP83XXADS.h is igonred."
+# warning "In PCI Agent Mode, CONFIG_83XX_CLKIN in board config file is igonred"
# endif /* CONFIG_83XX_CLKIN */
# ifndef CONFIG_83XX_PCICLK
-# error "In PCI Agent Mode, CONFIG_83XX_PCICLK must be defined in include/configs/MCP83XXADS.h"
+# error "In PCI Agent Mode, CONFIG_83XX_PCICLK must be defined in board config file"
# endif /* CONFIG_83XX_PCICLK */
-/* PCI Agent Mode */
+
+ /* PCI Agent Mode */
if (im->reset.rcwh & RCWH_PCIHOST) {
- /* though RCWH_PCIHOST is not defined in CFG_HRCW_HIGH the im->reset.rcwhr PCI Host Mode is enabled */
+ /* though RCWH_PCIHOST is not defined in CFG_HRCW_HIGH
+ * the im->reset.rcwhr PCI Host Mode is enabled */
return -3;
}
pci_sync_in = CONFIG_83XX_PCICLK;
+
#endif /* (CFG_HRCW_HIGH | RCWH_PCIHOST) */
/* we have up to date pci_sync_in */
@@ -343,79 +352,14 @@ int print_clock_conf (void)
printf("Clock configuration:\n");
printf(" Coherent System Bus: %4d MHz\n",gd->csb_clk/1000000);
printf(" Core: %4d MHz\n",gd->core_clk/1000000);
- printf(" Local Bus Controller:%4d MHz\n",gd->lbiu_clk/1000000);
+ debug(" Local Bus Controller:%4d MHz\n",gd->lbiu_clk/1000000);
printf(" Local Bus: %4d MHz\n",gd->lclk_clk/1000000);
- printf(" DDR: %4d MHz\n",gd->ddr_clk/1000000);
- printf(" I2C: %4d MHz\n",gd->i2c_clk/1000000);
- printf(" TSEC1: %4d MHz\n",gd->tsec1_clk/1000000);
- printf(" TSEC2: %4d MHz\n",gd->tsec2_clk/1000000);
- printf(" USB MPH: %4d MHz\n",gd->usbmph_clk/1000000);
- printf(" USB DR: %4d MHz\n",gd->usbdr_clk/1000000);
-
-#if 0
- DECLARE_GLOBAL_DATA_PTR;
-
- volatile immap_t *immap = (immap_t *) CFG_IMMR;
- ulong sccr, dfbrg;
- ulong scmr, corecnf, busdf, cpmdf, plldf, pllmf;
- corecnf_t *cp;
-
- sccr = immap->im_clkrst.car_sccr;
- dfbrg = (sccr & SCCR_DFBRG_MSK) >> SCCR_DFBRG_SHIFT;
-
- scmr = immap->im_clkrst.car_scmr;
- corecnf = (scmr & SCMR_CORECNF_MSK) >> SCMR_CORECNF_SHIFT;
- busdf = (scmr & SCMR_BUSDF_MSK) >> SCMR_BUSDF_SHIFT;
- cpmdf = (scmr & SCMR_CPMDF_MSK) >> SCMR_CPMDF_SHIFT;
- plldf = (scmr & SCMR_PLLDF) ? 1 : 0;
- pllmf = (scmr & SCMR_PLLMF_MSK) >> SCMR_PLLMF_SHIFT;
-
- cp = &corecnf_tab[corecnf];
-
- puts (CPU_ID_STR " Clock Configuration\n - Bus-to-Core Mult ");
-
- switch (cp->b2c_mult) {
- case _byp:
- puts ("BYPASS");
- break;
+ debug(" DDR: %4d MHz\n",gd->ddr_clk/1000000);
+ debug(" I2C: %4d MHz\n",gd->i2c_clk/1000000);
+ debug(" TSEC1: %4d MHz\n",gd->tsec1_clk/1000000);
+ debug(" TSEC2: %4d MHz\n",gd->tsec2_clk/1000000);
+ debug(" USB MPH: %4d MHz\n",gd->usbmph_clk/1000000);
+ debug(" USB DR: %4d MHz\n",gd->usbdr_clk/1000000);
- case _off:
- puts ("OFF");
- break;
-
- case _unk:
- puts ("UNKNOWN");
- break;
-
- default:
- printf ("%d%sx",
- cp->b2c_mult / 2,
- (cp->b2c_mult % 2) ? ".5" : "");
- break;
- }
-
- printf (", VCO Div %d, 60x Bus Freq %s, Core Freq %s\n",
- cp->vco_div, cp->freq_60x, cp->freq_core);
-
- printf (" - dfbrg %ld, corecnf 0x%02lx, busdf %ld, cpmdf %ld, "
- "plldf %ld, pllmf %ld\n", dfbrg, corecnf, busdf, cpmdf, plldf,
- pllmf);
-
- printf (" - vco_out %10ld, scc_clk %10ld, brg_clk %10ld\n",
- gd->vco_out, gd->scc_clk, gd->brg_clk);
-
- printf (" - cpu_clk %10ld, cpm_clk %10ld, bus_clk %10ld\n",
- gd->cpu_clk, gd->cpm_clk, gd->bus_clk);
-
- if (sccr & SCCR_PCI_MODE) {
- uint pci_div;
-
- pci_div = ( (sccr & SCCR_PCI_MODCK) ? 2 : 1) *
- ( ( (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT) + 1);
-
- printf (" - pci_clk %10ld\n", (gd->cpm_clk * 2) / pci_div);
- }
- putc ('\n');
-#endif
return 0;
}
diff --git a/cpu/mpc85xx/i2c.c b/cpu/mpc85xx/i2c.c
index 2d08487995..32dcf5d47e 100644
--- a/cpu/mpc85xx/i2c.c
+++ b/cpu/mpc85xx/i2c.c
@@ -245,12 +245,12 @@ int i2c_probe (uchar chip)
* and looking for an <ACK> back.
*/
udelay(10000);
- return i2c_read (chip, 0, 1, (char *)&tmp, 1);
+ return i2c_read (chip, 0, 1, (uchar *)&tmp, 1);
}
uchar i2c_reg_read (uchar i2c_addr, uchar reg)
{
- char buf[1];
+ uchar buf[1];
i2c_read (i2c_addr, reg, 1, buf, 1);
diff --git a/cpu/mpc8xx/config.mk b/cpu/mpc8xx/config.mk
index bfa6625fa8..5fa150e915 100644
--- a/cpu/mpc8xx/config.mk
+++ b/cpu/mpc8xx/config.mk
@@ -21,6 +21,6 @@
# MA 02111-1307 USA
#
-PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -fno-strict-aliasing
+PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi -fno-strict-aliasing
PLATFORM_CPPFLAGS += -DCONFIG_8xx -ffixed-r2 -ffixed-r29 -mstring -mcpu=860 -msoft-float
diff --git a/cpu/mpc8xx/i2c.c b/cpu/mpc8xx/i2c.c
index baa3552b07..682db53edb 100644
--- a/cpu/mpc8xx/i2c.c
+++ b/cpu/mpc8xx/i2c.c
@@ -724,7 +724,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
uchar
i2c_reg_read(uchar i2c_addr, uchar reg)
{
- char buf;
+ uchar buf;
i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
diff --git a/cpu/mpc8xx/spi.c b/cpu/mpc8xx/spi.c
index 9213d101a7..e318ed0d29 100644
--- a/cpu/mpc8xx/spi.c
+++ b/cpu/mpc8xx/spi.c
@@ -525,11 +525,11 @@ int spi_post_test (int flags)
for (i = 0; i < TEST_NUM; i++) {
for (l = TEST_MIN_LENGTH; l <= TEST_MAX_LENGTH; l += 8) {
- packet_fill (txbuf, l);
+ packet_fill ((char *)txbuf, l);
spi_xfer (l);
- if (packet_check (rxbuf, l) < 0) {
+ if (packet_check ((char *)rxbuf, l) < 0) {
goto Done;
}
}
diff --git a/cpu/mpc8xx/video.c b/cpu/mpc8xx/video.c
index f2b8814c83..ee60477ab8 100644
--- a/cpu/mpc8xx/video.c
+++ b/cpu/mpc8xx/video.c
@@ -447,9 +447,9 @@ static void video_drawchars (int xx, int yy, unsigned char *s, int count)
}
}
-static inline void video_drawstring (int xx, int yy, unsigned char *s)
+static inline void video_drawstring (int xx, int yy, char *s)
{
- video_drawchars (xx, yy, s, strlen (s));
+ video_drawchars (xx, yy, (unsigned char *)s, strlen (s));
}
/* Relative to console plotting functions */
@@ -474,7 +474,7 @@ static void video_putchar (int xx, int yy, unsigned char c)
static inline void video_putstring (int xx, int yy, unsigned char *s)
{
- video_putchars (xx, yy, s, strlen (s));
+ video_putchars (xx, yy, (unsigned char *)s, strlen ((char *)s));
}
/************************************************************************/
diff --git a/cpu/ppc4xx/i2c.c b/cpu/ppc4xx/i2c.c
index 3a644a4cc4..be94b571ff 100644
--- a/cpu/ppc4xx/i2c.c
+++ b/cpu/ppc4xx/i2c.c
@@ -428,7 +428,7 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buffer, int len)
*/
uchar i2c_reg_read(uchar i2c_addr, uchar reg)
{
- char buf;
+ uchar buf;
i2c_read(i2c_addr, reg, 1, &buf, 1);
diff --git a/cpu/ppc4xx/spd_sdram.c b/cpu/ppc4xx/spd_sdram.c
index 48102efcff..7c9ac25e21 100644
--- a/cpu/ppc4xx/spd_sdram.c
+++ b/cpu/ppc4xx/spd_sdram.c
@@ -456,7 +456,7 @@ long int spd_sdram(int(read_spd)(uint addr))
int spd_read(uint addr)
{
- char data[2];
+ uchar data[2];
if (i2c_read(SPD_EEPROM_ADDRESS, addr, 1, data, 1) == 0)
return (int)data[0];