From 4b9206ed51a3e3dc06dca2a3930a24e4f0025f3d Mon Sep 17 00:00:00 2001 From: wdenk Date: Tue, 23 Mar 2004 22:14:11 +0000 Subject: * Patches by Thomas Viehweger, 16 Mar 2004: - show PCI clock frequency on MPC8260 systems - add FCC_PSMR_RMII flag for HiP7 processors - in do_jffs2_fsload(), take load address from load_addr if not set explicit, update load_addr otherwise - replaced printf by putc/puts when no formatting is needed (smaller code size, faster execution) --- cpu/mpc8260/bedbug_603e.c | 8 ++++---- cpu/mpc8260/cpu.c | 24 ++++++++++++------------ cpu/mpc8260/ether_fcc.c | 12 ++++++------ cpu/mpc8260/ether_scc.c | 4 ++-- cpu/mpc8260/interrupts.c | 4 ++-- cpu/mpc8260/speed.c | 21 ++++++++++++++++----- cpu/mpc8260/traps.c | 24 ++++++++++++------------ 7 files changed, 54 insertions(+), 43 deletions(-) (limited to 'cpu/mpc8260') diff --git a/cpu/mpc8260/bedbug_603e.c b/cpu/mpc8260/bedbug_603e.c index 9c29b351d7..be09cfb5c6 100644 --- a/cpu/mpc8260/bedbug_603e.c +++ b/cpu/mpc8260/bedbug_603e.c @@ -81,7 +81,7 @@ void bedbug603e_do_break (cmd_tbl_t *cmdtp, int flag, int argc, { if( bug_ctx.hw_debug_enabled == 0 ) { - printf( "No breakpoints enabled\n" ); + puts ( "No breakpoints enabled\n" ); return; } @@ -105,7 +105,7 @@ void bedbug603e_do_break (cmd_tbl_t *cmdtp, int flag, int argc, printf( "Breakpoint [%d]: ", which_bp ); if( (addr & 0x00000002) == 0 ) - printf( "NOT SET\n" ); + puts ( "NOT SET\n" ); else disppc( (unsigned char *)(addr & 0xFFFFFFFC), 0, 1, bedbug_puts, F_RADHEX ); } @@ -183,7 +183,7 @@ int bedbug603e_set( int which_bp, unsigned long addr ) if(( addr & 0x00000003 ) != 0 ) { - printf( "Breakpoints must be on a 32 bit boundary\n" ); + puts ( "Breakpoints must be on a 32 bit boundary\n" ); return 0; } @@ -191,7 +191,7 @@ int bedbug603e_set( int which_bp, unsigned long addr ) if(( bug_ctx.find_empty ) && ( !which_bp ) && ( which_bp = (*bug_ctx.find_empty)()) == 0 ) { - printf( "All breakpoints in use\n" ); + puts ( "All breakpoints in use\n" ); return 0; } diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c index db8b89e6bd..2a1c0e13fe 100644 --- a/cpu/mpc8260/cpu.c +++ b/cpu/mpc8260/cpu.c @@ -94,40 +94,40 @@ int checkcpu (void) switch (m) { case 0x0000: - printf ("0.2 2J24M"); + puts ("0.2 2J24M"); break; case 0x0010: - printf ("A.0 K22A"); + puts ("A.0 K22A"); break; case 0x0011: - printf ("A.1 1K22A-XC"); + puts ("A.1 1K22A-XC"); break; case 0x0001: - printf ("B.1 1K23A"); + puts ("B.1 1K23A"); break; case 0x0021: - printf ("B.2 2K23A-XC"); + puts ("B.2 2K23A-XC"); break; case 0x0023: - printf ("B.3 3K23A"); + puts ("B.3 3K23A"); break; case 0x0024: - printf ("C.2 6K23A"); + puts ("C.2 6K23A"); break; case 0x0060: - printf ("A.0(A) 2K25A"); + puts ("A.0(A) 2K25A"); break; case 0x0062: - printf ("B.1 4K25A"); + puts ("B.1 4K25A"); break; case 0x0064: - printf ("C.0 5K25A"); + puts ("C.0 5K25A"); break; case 0x0A00: - printf ("0.0 0K49M"); + puts ("0.0 0K49M"); break; case 0x0A01: - printf ("0.1 1K49M"); + puts ("0.1 1K49M"); break; default: printf ("unknown [immr=0x%04x,k=0x%04x]", m, k); diff --git a/cpu/mpc8260/ether_fcc.c b/cpu/mpc8260/ether_fcc.c index deb8924e5a..82f7390709 100644 --- a/cpu/mpc8260/ether_fcc.c +++ b/cpu/mpc8260/ether_fcc.c @@ -149,7 +149,7 @@ static int fec_send(struct eth_device* dev, volatile void *packet, int length) for(i=0; rtx.txbd[txIdx].cbd_sc & BD_ENET_TX_READY; i++) { if (i >= TOUT_LOOP) { - printf("fec: tx buffer not ready\n"); + puts ("fec: tx buffer not ready\n"); goto out; } } @@ -161,7 +161,7 @@ static int fec_send(struct eth_device* dev, volatile void *packet, int length) for(i=0; rtx.txbd[txIdx].cbd_sc & BD_ENET_TX_READY; i++) { if (i >= TOUT_LOOP) { - printf("fec: tx error\n"); + puts ("fec: tx error\n"); goto out; } } @@ -522,7 +522,7 @@ print_desc (elbt_prdesc descs[], int ndesc, uchar *bases[], int nbase) for (i = 0; i < nbase; i++) printf (" Channel %d", i); - puts ("\n"); + putc ('\n'); while (dp < edp) { @@ -534,7 +534,7 @@ print_desc (elbt_prdesc descs[], int ndesc, uchar *bases[], int nbase) printf (" %10u", val); } - puts ("\n"); + putc ('\n'); dp++; } @@ -1143,7 +1143,7 @@ eth_loopback_test (void) printf ("\tFirst %d rx errs:", nerr); for (i = 0; i < nerr; i++) printf (" %04x", ecp->rxerrs[i]); - puts ("\n"); + putc ('\n'); } if ((nerr = ecp->ntxerr) > 0) { @@ -1152,7 +1152,7 @@ eth_loopback_test (void) printf ("\tFirst %d tx errs:", nerr); for (i = 0; i < nerr; i++) printf (" %04x", ecp->txerrs[i]); - puts ("\n"); + putc ('\n'); } } diff --git a/cpu/mpc8260/ether_scc.c b/cpu/mpc8260/ether_scc.c index 10133fa482..a733b45c01 100644 --- a/cpu/mpc8260/ether_scc.c +++ b/cpu/mpc8260/ether_scc.c @@ -110,7 +110,7 @@ int eth_send(volatile void *packet, int length) for(i=0; rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_READY; i++) { if (i >= TOUT_LOOP) { - printf("scc: tx buffer not ready\n"); + puts ("scc: tx buffer not ready\n"); goto out; } } @@ -122,7 +122,7 @@ int eth_send(volatile void *packet, int length) for(i=0; rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_READY; i++) { if (i >= TOUT_LOOP) { - printf("scc: tx error\n"); + puts ("scc: tx error\n"); goto out; } } diff --git a/cpu/mpc8260/interrupts.c b/cpu/mpc8260/interrupts.c index e2a6c97782..b2e4d83924 100644 --- a/cpu/mpc8260/interrupts.c +++ b/cpu/mpc8260/interrupts.c @@ -262,8 +262,8 @@ do_irqinfo (cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[]) re_enable = disable_interrupts (); - printf ("\nInterrupt-Information:\n"); - printf ("Nr Routine Arg Count\n"); + puts ("\nInterrupt-Information:\n" + "Nr Routine Arg Count\n"); for (irq = 0; irq < 32; irq++) if (irq_handlers[irq].handler != NULL) diff --git a/cpu/mpc8260/speed.c b/cpu/mpc8260/speed.c index a20f61244a..16f4e90b65 100644 --- a/cpu/mpc8260/speed.c +++ b/cpu/mpc8260/speed.c @@ -175,19 +175,19 @@ int prt_8260_clks (void) cp = &corecnf_tab[corecnf]; - printf (CPU_ID_STR " Clock Configuration\n - Bus-to-Core Mult "); + puts (CPU_ID_STR " Clock Configuration\n - Bus-to-Core Mult "); switch (cp->b2c_mult) { case _byp: - printf ("BYPASS"); + puts ("BYPASS"); break; case _off: - printf ("OFF"); + puts ("OFF"); break; case _unk: - printf ("UNKNOWN"); + puts ("UNKNOWN"); break; default: @@ -207,8 +207,19 @@ int prt_8260_clks (void) 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\n", + 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'); + return (0); } diff --git a/cpu/mpc8260/traps.c b/cpu/mpc8260/traps.c index 693db39085..715ef60069 100644 --- a/cpu/mpc8260/traps.c +++ b/cpu/mpc8260/traps.c @@ -58,19 +58,19 @@ print_backtrace(unsigned long *sp) int cnt = 0; unsigned long i; - printf("Call backtrace: "); + puts ("Call backtrace: "); while (sp) { if ((uint)sp > END_OF_MEM) break; i = sp[1]; if (cnt++ % 7 == 0) - printf("\n"); + putc ('\n'); printf("%08lX ", i); if (cnt > 32) break; sp = (unsigned long *)*sp; } - printf("\n"); + putc ('\n'); } void show_regs(struct pt_regs * regs) @@ -85,7 +85,7 @@ void show_regs(struct pt_regs * regs) regs->msr&MSR_IR ? 1 : 0, regs->msr&MSR_DR ? 1 : 0); - printf("\n"); + putc ('\n'); for (i = 0; i < 32; i++) { if ((i % 8) == 0) { printf("GPR%02d: ", i); @@ -93,7 +93,7 @@ void show_regs(struct pt_regs * regs) printf("%08lX ", regs->gpr[i]); if ((i % 8) == 7) { - printf("\n"); + putc ('\n'); } } } @@ -155,25 +155,25 @@ MachineCheckException(struct pt_regs *regs) return; #endif - printf("Machine check in kernel mode.\n"); - printf("Caused by (from msr): "); + puts ("Machine check in kernel mode.\n" + "Caused by (from msr): "); printf("regs %p ",regs); switch( regs->msr & 0x000F0000) { case (0x80000000>>12): - printf("Machine check signal - probably due to mm fault\n" + puts ("Machine check signal - probably due to mm fault\n" "with mmu off\n"); break; case (0x80000000>>13): - printf("Transfer error ack signal\n"); + puts ("Transfer error ack signal\n"); break; case (0x80000000>>14): - printf("Data parity signal\n"); + puts ("Data parity signal\n"); break; case (0x80000000>>15): - printf("Address parity signal\n"); + puts ("Address parity signal\n"); break; default: - printf("Unknown values in msr\n"); + puts ("Unknown values in msr\n"); } show_regs(regs); print_backtrace((unsigned long *)regs->gpr[1]); -- cgit v1.2.1