parent
f35190d65b
commit
98432d3925
|
@ -1,6 +1,7 @@
|
|||
|
||||
CPPFLAGS += -fno-builtin -ffreestanding -nostdinc -Wall \
|
||||
-isystem $(gccincdir) -meabi -Wstrict-prototypes -D __PPC__ -D CONFIG_PPC \
|
||||
-fno-strict-aliasing
|
||||
|
||||
|
||||
machine-$(CONFIG_ARCH_MPC5200) := mpc5200
|
||||
|
|
|
@ -41,25 +41,3 @@ get_ticks:
|
|||
cmp 0,r3,r5
|
||||
bne 1b
|
||||
blr
|
||||
|
||||
/*
|
||||
* Delay for a number of ticks
|
||||
*/
|
||||
.globl wait_ticks
|
||||
wait_ticks:
|
||||
mflr r8 /* save link register */
|
||||
mr r7, r3 /* save tick count */
|
||||
bl get_ticks /* Get start time */
|
||||
|
||||
/* Calculate end time */
|
||||
addc r7, r4, r7 /* Compute end time lower */
|
||||
addze r6, r3 /* and end time upper */
|
||||
|
||||
WATCHDOG_RESET /* Trigger watchdog, if needed */
|
||||
1: bl get_ticks /* Get current time */
|
||||
subfc r4, r4, r7 /* Subtract current time from end time */
|
||||
subfe. r3, r3, r6
|
||||
bge 1b /* Loop until time expired */
|
||||
|
||||
mtlr r8 /* restore link register */
|
||||
blr
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <clock.h>
|
||||
#include <init.h>
|
||||
#include <asm/arch/clocks.h>
|
||||
#include <asm/common.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
|
|
@ -196,9 +196,6 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
|
|||
if (size == 0)
|
||||
return 0;
|
||||
|
||||
/* flush cache */
|
||||
flush_cache(load_addr, size);
|
||||
|
||||
return rcode;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,8 +57,6 @@ uint32_t clocksource_hz2mult(uint32_t hz, uint32_t shift_constant)
|
|||
|
||||
int is_timeout(uint64_t start_ns, uint64_t time_offset_ns)
|
||||
{
|
||||
// if (ctrlc ())
|
||||
// return -1;
|
||||
|
||||
if (start_ns + time_offset_ns < get_time_ns())
|
||||
return 1;
|
||||
|
@ -66,14 +64,11 @@ int is_timeout(uint64_t start_ns, uint64_t time_offset_ns)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int udelay(unsigned long usecs)
|
||||
void udelay(unsigned long usecs)
|
||||
{
|
||||
uint64_t start = get_time_ns();
|
||||
|
||||
while(!is_timeout(start, usecs * 1000));
|
||||
// if (ctrlc ())
|
||||
// return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mdelay(unsigned long msecs)
|
||||
|
|
|
@ -609,11 +609,12 @@ static mbinptr av_[NAV * 2 + 2] = {
|
|||
/* Other static bookkeeping data */
|
||||
|
||||
/* variables holding tunable values */
|
||||
|
||||
#ifndef __U_BOOT__
|
||||
static unsigned long trim_threshold = DEFAULT_TRIM_THRESHOLD;
|
||||
static unsigned long top_pad = DEFAULT_TOP_PAD;
|
||||
static unsigned int n_mmaps_max = DEFAULT_MMAP_MAX;
|
||||
static unsigned long mmap_threshold = DEFAULT_MMAP_THRESHOLD;
|
||||
#endif
|
||||
static unsigned long top_pad = DEFAULT_TOP_PAD;
|
||||
|
||||
/* The first value returned from sbrk */
|
||||
static char* sbrk_base = (char*)(-1);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <environment.h>
|
||||
|
||||
int parse_line (char *line, char *argv[])
|
||||
{
|
||||
|
@ -114,7 +115,8 @@ static void process_macros (const char *input, char *output)
|
|||
case 2: /* Waiting for ) */
|
||||
if (c == ')' || c == '}') {
|
||||
int i;
|
||||
char envname[CONFIG_CBSIZE], *envval;
|
||||
char envname[CONFIG_CBSIZE];
|
||||
const char *envval;
|
||||
int envcnt = input - varname_start - 1; /* Varname # of chars */
|
||||
|
||||
/* Get the varname */
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc5xxx.h>
|
||||
#include <asm/arch/mpc5xxx.h>
|
||||
#include <malloc.h>
|
||||
#include <net.h>
|
||||
#include <init.h>
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#define __MPC5XXX_FEC_H
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc5xxx.h>
|
||||
#include <asm/arch/sdma.h>
|
||||
|
||||
typedef unsigned long uint32;
|
||||
|
|
|
@ -8,13 +8,3 @@ unsigned long get_pci_clock(void);
|
|||
unsigned long get_timebase_clock(void);
|
||||
|
||||
#endif /* __ASM_ARCH_CLOCKS_H */
|
||||
#ifndef __ASM_ARCH_CLOCKS_H
|
||||
#define __ASM_ARCH_CLOCKS_H
|
||||
|
||||
unsigned long get_bus_clock(void);
|
||||
unsigned long get_cpu_clock(void);
|
||||
unsigned long get_ipb_clock(void);
|
||||
unsigned long get_pci_clock(void);
|
||||
unsigned long get_timebase_clock(void);
|
||||
|
||||
#endif /* __ASM_ARCH_CLOCKS_H */
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#define __MPC5XXX_SDMA_H
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc5xxx.h>
|
||||
#include <asm/arch/mpc5xxx.h>
|
||||
|
||||
/* Task number assignment */
|
||||
#define FEC_RECV_TASK_NO 0
|
||||
|
|
|
@ -176,4 +176,20 @@ extern inline void out_be32(volatile unsigned *addr, int val)
|
|||
__asm__ __volatile__("stw%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val));
|
||||
}
|
||||
|
||||
/* these ones were originally in config.h */
|
||||
unsigned char in8(unsigned int);
|
||||
void out8(unsigned int, unsigned char);
|
||||
unsigned short in16(unsigned int);
|
||||
unsigned short in16r(unsigned int);
|
||||
void out16(unsigned int, unsigned short value);
|
||||
void out16r(unsigned int, unsigned short value);
|
||||
unsigned long in32(unsigned int);
|
||||
unsigned long in32r(unsigned int);
|
||||
void out32(unsigned int, unsigned long value);
|
||||
void out32r(unsigned int, unsigned long value);
|
||||
void ppcDcbf(unsigned long value);
|
||||
void ppcDcbi(unsigned long value);
|
||||
void ppcSync(void);
|
||||
void ppcDcbz(unsigned long value);
|
||||
|
||||
#endif
|
||||
|
|
214
include/common.h
214
include/common.h
|
@ -31,9 +31,7 @@
|
|||
#include <linux/bitops.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/string.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
#include <part.h>
|
||||
#include <asm/common.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#define debug(fmt,args...) printf (fmt ,##args)
|
||||
|
@ -52,7 +50,6 @@
|
|||
typedef void (interrupt_handler_t)(void *);
|
||||
|
||||
#include <asm/u-boot.h> /* boot information for Linux kernel */
|
||||
#include <asm/global_data.h> /* global data used for startup functions */
|
||||
|
||||
/*
|
||||
* General Purpose Utilities
|
||||
|
@ -72,7 +69,8 @@ typedef void (interrupt_handler_t)(void *);
|
|||
void do_reset(void);
|
||||
void reginfo(void);
|
||||
|
||||
void hang (void) __attribute__ ((noreturn));
|
||||
void hang (void) __attribute__ ((noreturn));
|
||||
void panic(const char *fmt, ...);
|
||||
|
||||
/* */
|
||||
long int initdram (int);
|
||||
|
@ -83,200 +81,37 @@ void print_size (ulong, const char *);
|
|||
void main_loop (void);
|
||||
int run_command (const char *cmd, int flag);
|
||||
int readline (const char *prompt, char *buf, int len);
|
||||
void init_cmd_timeout(void);
|
||||
void reset_cmd_timeout(void);
|
||||
|
||||
/* lib_$(ARCH)/board.c */
|
||||
void board_init_f (ulong);
|
||||
//void board_init_r (gd_t *, ulong);
|
||||
int checkboard (void);
|
||||
int checkflash (void);
|
||||
int checkdram (void);
|
||||
int checkcpu (void);
|
||||
char * strmhz(char *buf, long hz);
|
||||
int last_stage_init(void);
|
||||
extern ulong monitor_flash_len;
|
||||
|
||||
/* common/cmd_autoscript.c */
|
||||
int autoscript (ulong addr);
|
||||
|
||||
|
||||
extern ulong load_addr; /* Default Load Address */
|
||||
|
||||
#ifdef CONFIG_AUTO_COMPLETE
|
||||
int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf);
|
||||
#endif
|
||||
|
||||
int misc_init_f (void);
|
||||
int misc_init_r (void);
|
||||
|
||||
/* common/exports.c */
|
||||
void jumptable_init(void);
|
||||
|
||||
/* common/memsize.c */
|
||||
long get_ram_size (volatile long *, long);
|
||||
|
||||
/* $(BOARD)/eeprom.c */
|
||||
void eeprom_init (void);
|
||||
#ifndef CONFIG_SPI
|
||||
int eeprom_probe (unsigned dev_addr, unsigned offset);
|
||||
#endif
|
||||
int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt);
|
||||
int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt);
|
||||
#ifdef CONFIG_LWMON
|
||||
extern uchar pic_read (uchar reg);
|
||||
extern void pic_write (uchar reg, uchar val);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set this up regardless of board
|
||||
* type, to prevent errors.
|
||||
*/
|
||||
#if defined(CONFIG_SPI) || !defined(CFG_I2C_EEPROM_ADDR)
|
||||
# define CFG_DEF_EEPROM_ADDR 0
|
||||
#else
|
||||
# define CFG_DEF_EEPROM_ADDR CFG_I2C_EEPROM_ADDR
|
||||
#endif /* CONFIG_SPI || !defined(CFG_I2C_EEPROM_ADDR) */
|
||||
|
||||
#if defined(CONFIG_SPI)
|
||||
extern void spi_init_f (void);
|
||||
extern void spi_init_r (void);
|
||||
extern ssize_t spi_read (uchar *, int, uchar *, int);
|
||||
extern ssize_t spi_write (uchar *, int, uchar *, int);
|
||||
#endif
|
||||
|
||||
#if defined(CFG_DRAM_TEST)
|
||||
int testdram(void);
|
||||
#endif /* CFG_DRAM_TEST */
|
||||
|
||||
/* $(CPU)/start.S */
|
||||
#if defined(CONFIG_5xx) || \
|
||||
defined(CONFIG_8xx)
|
||||
uint get_immr (uint);
|
||||
#endif
|
||||
uint get_pir (void);
|
||||
#if defined(CONFIG_MPC5xxx)
|
||||
uint get_svr (void);
|
||||
#endif
|
||||
uint get_pvr (void);
|
||||
uint get_svr (void);
|
||||
uint rd_ic_cst (void);
|
||||
void wr_ic_cst (uint);
|
||||
void wr_ic_adr (uint);
|
||||
uint rd_dc_cst (void);
|
||||
void wr_dc_cst (uint);
|
||||
void wr_dc_adr (uint);
|
||||
int icache_status (void);
|
||||
void icache_enable (void);
|
||||
void icache_disable(void);
|
||||
int dcache_status (void);
|
||||
void dcache_enable (void);
|
||||
void dcache_disable(void);
|
||||
void relocate_code (ulong, gd_t *, ulong);
|
||||
ulong get_endaddr (void);
|
||||
void trap_init (ulong);
|
||||
#if defined (CONFIG_4xx) || \
|
||||
defined (CONFIG_MPC5xxx) || \
|
||||
defined (CONFIG_74xx_7xx) || \
|
||||
defined (CONFIG_74x) || \
|
||||
defined (CONFIG_75x) || \
|
||||
defined (CONFIG_74xx) || \
|
||||
defined (CONFIG_MPC8220) || \
|
||||
defined (CONFIG_MPC85xx) || \
|
||||
defined (CONFIG_MPC86xx) || \
|
||||
defined (CONFIG_MPC83XX)
|
||||
unsigned char in8(unsigned int);
|
||||
void out8(unsigned int, unsigned char);
|
||||
unsigned short in16(unsigned int);
|
||||
unsigned short in16r(unsigned int);
|
||||
void out16(unsigned int, unsigned short value);
|
||||
void out16r(unsigned int, unsigned short value);
|
||||
unsigned long in32(unsigned int);
|
||||
unsigned long in32r(unsigned int);
|
||||
void out32(unsigned int, unsigned long value);
|
||||
void out32r(unsigned int, unsigned long value);
|
||||
void ppcDcbf(unsigned long value);
|
||||
void ppcDcbi(unsigned long value);
|
||||
void ppcSync(void);
|
||||
void ppcDcbz(unsigned long value);
|
||||
#endif
|
||||
|
||||
/* $(CPU)/cpu.c */
|
||||
int checkcpu (void);
|
||||
int checkicache (void);
|
||||
int checkdcache (void);
|
||||
void upmconfig (unsigned int, unsigned int *, unsigned int);
|
||||
ulong get_tbclk (void);
|
||||
void reset_cpu (ulong addr);
|
||||
|
||||
/* $(CPU)/speed.c */
|
||||
int get_clocks (void);
|
||||
int get_clocks_866 (void);
|
||||
int sdram_adjust_866 (void);
|
||||
int adjust_sdram_tbs_8xx (void);
|
||||
#if defined(CONFIG_8260)
|
||||
int prt_8260_clks (void);
|
||||
#elif defined(CONFIG_MPC83XX)
|
||||
int print_clock_conf(void);
|
||||
#elif defined(CONFIG_MPC5xxx)
|
||||
int prt_mpc5xxx_clks (void);
|
||||
#endif
|
||||
#if defined(CONFIG_MPC8220)
|
||||
int prt_mpc8220_clks (void);
|
||||
#endif
|
||||
#ifdef CONFIG_4xx
|
||||
ulong get_OPB_freq (void);
|
||||
ulong get_PCI_freq (void);
|
||||
#endif
|
||||
#if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || defined(CONFIG_LH7A40X)
|
||||
ulong get_FCLK (void);
|
||||
ulong get_HCLK (void);
|
||||
ulong get_PCLK (void);
|
||||
ulong get_UCLK (void);
|
||||
#endif
|
||||
#if defined(CONFIG_LH7A40X)
|
||||
ulong get_PLLCLK (void);
|
||||
#endif
|
||||
#if defined CONFIG_INCA_IP
|
||||
uint incaip_get_cpuclk (void);
|
||||
#endif
|
||||
ulong get_bus_freq (ulong);
|
||||
|
||||
#if defined(CONFIG_MPC85xx)
|
||||
typedef MPC85xx_SYS_INFO sys_info_t;
|
||||
void get_sys_info ( sys_info_t * );
|
||||
#endif
|
||||
#if defined(CONFIG_MPC86xx)
|
||||
typedef MPC86xx_SYS_INFO sys_info_t;
|
||||
void get_sys_info ( sys_info_t * );
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_4xx) || defined(CONFIG_IOP480)
|
||||
# if defined(CONFIG_440)
|
||||
typedef PPC440_SYS_INFO sys_info_t;
|
||||
# if defined(CONFIG_440SPE)
|
||||
unsigned long determine_sysper(void);
|
||||
unsigned long determine_pci_clock_per(void);
|
||||
int ppc440spe_revB(void);
|
||||
# endif
|
||||
# else
|
||||
typedef PPC405_SYS_INFO sys_info_t;
|
||||
# endif
|
||||
void get_sys_info ( sys_info_t * );
|
||||
#endif
|
||||
|
||||
/* $(CPU)/cpu_init.c */
|
||||
#if defined(CONFIG_8xx) || defined(CONFIG_8260)
|
||||
void cpu_init_f (volatile immap_t *immr);
|
||||
#endif
|
||||
#if defined(CONFIG_4xx) || defined(CONFIG_MPC85xx) || defined(CONFIG_MCF52x2) ||defined(CONFIG_MPC86xx)
|
||||
void cpu_init_f (void);
|
||||
#endif
|
||||
|
||||
int cpu_init_r (void);
|
||||
#if defined(CONFIG_8260)
|
||||
int prt_8260_rsr (void);
|
||||
#endif
|
||||
|
||||
/* $(CPU)/interrupts.c */
|
||||
//void timer_interrupt (struct pt_regs *);
|
||||
//void external_interrupt (struct pt_regs *);
|
||||
|
@ -290,40 +125,9 @@ int disable_interrupts (void);
|
|||
#define disable_interrupts() 0
|
||||
#endif
|
||||
|
||||
/* $(CPU)/.../commproc.c */
|
||||
int dpram_init (void);
|
||||
uint dpram_base(void);
|
||||
uint dpram_base_align(uint align);
|
||||
uint dpram_alloc(uint size);
|
||||
uint dpram_alloc_align(uint size,uint align);
|
||||
void post_word_store (ulong);
|
||||
ulong post_word_load (void);
|
||||
void bootcount_store (ulong);
|
||||
ulong bootcount_load (void);
|
||||
#define BOOTCOUNT_MAGIC 0xB001C041
|
||||
|
||||
/* $(CPU)/.../<eth> */
|
||||
void mii_init (void);
|
||||
|
||||
/* $(CPU)/.../lcd.c */
|
||||
ulong lcd_setmem (ulong);
|
||||
|
||||
/* $(CPU)/.../vfd.c */
|
||||
ulong vfd_setmem (ulong);
|
||||
|
||||
/* $(CPU)/.../video.c */
|
||||
ulong video_setmem (ulong);
|
||||
|
||||
/* lib_$(ARCH)/cache.c */
|
||||
void flush_cache (unsigned long, unsigned long);
|
||||
|
||||
|
||||
/* lib_$(ARCH)/ticks.S */
|
||||
unsigned long long get_ticks(void);
|
||||
void wait_ticks (unsigned long);
|
||||
|
||||
/* lib_$(ARCH)/time.c */
|
||||
int udelay (unsigned long);
|
||||
void udelay (unsigned long);
|
||||
void mdelay (unsigned long);
|
||||
|
||||
/* lib_generic/vsprintf.c */
|
||||
ulong simple_strtoul(const char *cp,char **endp,unsigned int base);
|
||||
|
@ -331,7 +135,6 @@ ulong simple_strtoul(const char *cp,char **endp,unsigned int base);
|
|||
unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base);
|
||||
#endif
|
||||
long simple_strtol(const char *cp,char **endp,unsigned int base);
|
||||
void panic(const char *fmt, ...);
|
||||
|
||||
/* lib_generic/crc32.c */
|
||||
ulong crc32 (ulong, const unsigned char *, uint);
|
||||
|
@ -344,11 +147,6 @@ int ctrlc (void);
|
|||
void show_boot_progress (int status);
|
||||
#endif
|
||||
|
||||
/* Reservoir for several functions in the code where
|
||||
* previously no header file existed
|
||||
*/
|
||||
int cmd_get_data_size(char* arg, int default_size);
|
||||
|
||||
#define MEMAREA_SIZE_SPECIFIED 1
|
||||
|
||||
struct memarea_info {
|
||||
|
|
|
@ -14,7 +14,7 @@ void install_hdlr(int, interrupt_handler_t*, void*);
|
|||
void free_hdlr(int);
|
||||
void *malloc(size_t);
|
||||
void free(void*);
|
||||
int udelay(unsigned long);
|
||||
void udelay(unsigned long);
|
||||
void vprintf(const char *, va_list);
|
||||
void do_reset (void);
|
||||
unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
|
||||
|
|
|
@ -70,4 +70,19 @@ void spi_init(void);
|
|||
*/
|
||||
int spi_xfer(spi_chipsel_type chipsel, int bitlen, uchar *dout, uchar *din);
|
||||
|
||||
void spi_init_f (void);
|
||||
void spi_init_r (void);
|
||||
ssize_t spi_read (uchar *, int, uchar *, int);
|
||||
ssize_t spi_write (uchar *, int, uchar *, int);
|
||||
|
||||
/*
|
||||
* Set this up regardless of board
|
||||
* type, to prevent errors.
|
||||
*/
|
||||
#if defined(CONFIG_SPI) || !defined(CFG_I2C_EEPROM_ADDR)
|
||||
# define CFG_DEF_EEPROM_ADDR 0
|
||||
#else
|
||||
# define CFG_DEF_EEPROM_ADDR CFG_I2C_EEPROM_ADDR
|
||||
#endif /* CONFIG_SPI || !defined(CFG_I2C_EEPROM_ADDR) */
|
||||
|
||||
#endif /* _SPI_H_ */
|
||||
|
|
|
@ -317,9 +317,6 @@ TftpStart (void)
|
|||
tftp_filename = BootFile;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_NET_MULTI)
|
||||
printf ("Using %s device\n", eth_get_name());
|
||||
#endif
|
||||
puts ("TFTP from server "); print_IPaddr (NetServerIP);
|
||||
puts ("; our IP address is "); print_IPaddr (NetOurIP);
|
||||
|
||||
|
@ -344,8 +341,6 @@ TftpStart (void)
|
|||
|
||||
putc ('\n');
|
||||
|
||||
printf ("Load address: 0x%lx\n", load_addr);
|
||||
|
||||
puts ("Loading: *\b");
|
||||
|
||||
NetSetTimeout (TIMEOUT * SECOND, TftpTimeout);
|
||||
|
|
Loading…
Reference in New Issue