Commit 42246dac authored by Stefan Roese's avatar Stefan Roese

Merge branch 'master' of /home/stefan/git/u-boot/u-boot into next

parents 11188d55 699f0512
This diff is collapsed.
......@@ -426,7 +426,7 @@ D: FADS823 configuration, MPC823 video support, I2C, wireless keyboard, lots mor
N: Andre Schwarz
E: [email protected]
D: Support for Matrix Vision boards (MVBLM7)
D: Support for Matrix Vision boards (MVBLM7/MVBC_P)
N: Robert Schwebel
E: [email protected]
......
......@@ -372,6 +372,7 @@ Peter De Schrijver <[email protected]>
Andre Schwarz <[email protected]>
mvbc_p MPC5200
mvblm7 MPC8343
Timur Tabi <[email protected]>
......
......@@ -48,6 +48,7 @@ LIST_5xxx=" \
mecp5200 \
motionpro \
munices \
MVBC_P \
o2dnt \
pf5200 \
PM520 \
......
This diff is collapsed.
......@@ -41,51 +41,51 @@ int checkboard (void)
phys_size_t initdram (int board_type)
{
int size,i;
int size, i;
size = 0;
MCFSDRAMC_DCR = MCFSDRAMC_DCR_RTIM_6
| MCFSDRAMC_DCR_RC((15 * CFG_CLK)>>4);
#ifdef CFG_SDRAM_BASE0
MCFSDRAMC_DACR0 = MCFSDRAMC_DACR_BASE(CFG_SDRAM_BASE0)
| MCFSDRAMC_DACR_CASL(1)
| MCFSDRAMC_DACR_CBM(3)
| MCFSDRAMC_DACR_PS_16);
MCFSDRAMC_DMR0 = MCFSDRAMC_DMR_BAM_16M
| MCFSDRAMC_DMR_V;
MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_IP;
*(unsigned short *)(CFG_SDRAM_BASE0) = 0xA5A5;
MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_RE;
for (i=0; i < 2000; i++)
asm(" nop");
mbar_writeLong(MCFSDRAMC_DACR0, mbar_readLong(MCFSDRAMC_DACR0)
| MCFSDRAMC_DACR_IMRS);
*(unsigned int *)(CFG_SDRAM_BASE0 + 0x220) = 0xA5A5;
size += CFG_SDRAM_SIZE * 1024 * 1024;
#endif
#ifdef CFG_SDRAM_BASE1
MCFSDRAMC_DACR1 = MCFSDRAMC_DACR_BASE(CFG_SDRAM_BASE1)
| MCFSDRAMC_DACR_CASL(1)
| MCFSDRAMC_DACR_CBM(3)
| MCFSDRAMC_DACR_PS_16;
MCFSDRAMC_DMR1 = MCFSDRAMC_DMR_BAM_16M
| MCFSDRAMC_DMR_V;
MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_IP;
*(unsigned short *)(CFG_SDRAM_BASE1) = 0xA5A5;
MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_RE;
for (i=0; i < 2000; i++)
asm(" nop");
MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_IMRS;
*(unsigned int *)(CFG_SDRAM_BASE1 + 0x220) = 0xA5A5;
size += CFG_SDRAM_SIZE1 * 1024 * 1024;
#endif
MCFSDRAMC_DCR = MCFSDRAMC_DCR_RTIM_6
| MCFSDRAMC_DCR_RC ((15 * CFG_CLK) >> 4);
#ifdef CFG_SDRAM_BASE0
MCFSDRAMC_DACR0 = MCFSDRAMC_DACR_BASE (CFG_SDRAM_BASE0)
| MCFSDRAMC_DACR_CASL (1)
| MCFSDRAMC_DACR_CBM (3)
| MCFSDRAMC_DACR_PS_16;
MCFSDRAMC_DMR0 = MCFSDRAMC_DMR_BAM_16M | MCFSDRAMC_DMR_V;
MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_IP;
*(unsigned short *) (CFG_SDRAM_BASE0) = 0xA5A5;
MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_RE;
for (i = 0; i < 2000; i++)
asm (" nop");
mbar_writeLong (MCFSDRAMC_DACR0,
mbar_readLong (MCFSDRAMC_DACR0) | MCFSDRAMC_DACR_IMRS);
*(unsigned int *) (CFG_SDRAM_BASE0 + 0x220) = 0xA5A5;
size += CFG_SDRAM_SIZE * 1024 * 1024;
#endif
#ifdef CFG_SDRAM_BASE1
MCFSDRAMC_DACR1 = MCFSDRAMC_DACR_BASE (CFG_SDRAM_BASE1)
| MCFSDRAMC_DACR_CASL (1)
| MCFSDRAMC_DACR_CBM (3)
| MCFSDRAMC_DACR_PS_16;
MCFSDRAMC_DMR1 = MCFSDRAMC_DMR_BAM_16M | MCFSDRAMC_DMR_V;
MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_IP;
*(unsigned short *) (CFG_SDRAM_BASE1) = 0xA5A5;
MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_RE;
for (i = 0; i < 2000; i++)
asm (" nop");
MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_IMRS;
*(unsigned int *) (CFG_SDRAM_BASE1 + 0x220) = 0xA5A5;
size += CFG_SDRAM_SIZE1 * 1024 * 1024;
#endif
return size;
}
......
......@@ -173,7 +173,7 @@ int cfm_flash_write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cn
dest = cmf_backdoor_address(addr);
while ((cnt>=4) && (rc == ERR_OK))
{
data =*((volatile u32 *) src);
data = *((volatile u32 *) src);
*(volatile u32*) dest = data;
MCFCFM_CMD = MCFCFM_CMD_PGM;
MCFCFM_USTAT = MCFCFM_USTAT_CBEIF;
......
......@@ -348,7 +348,7 @@ int amd_flash_write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt
dest = addr;
while ((cnt>=2) && (rc == ERR_OK))
{
data =*((volatile u16 *) src);
data = *((volatile u16 *) src);
rc=amd_write_word (info,dest,data);
src +=2;
dest +=2;
......
......@@ -229,7 +229,7 @@ int drv_isa_kbd_init (void)
device_t kbddev ;
char *stdinname = getenv ("stdin");
if(isa_kbd_init()==-1)
if(isa_kbd_init() == -1)
return -1;
memset (&kbddev, 0, sizeof(kbddev));
strcpy(kbddev.name, DEVNAME);
......@@ -515,7 +515,7 @@ int kbd_read_data(void)
int val;
unsigned char status;
val=-1;
val = -1;
status = kbd_read_status();
if (status & KBD_STAT_OBF) {
val = kbd_read_input();
......
......@@ -518,7 +518,7 @@ void usb_check_int_chain(void)
uhci_td_t *td,*prevtd;
for(i=0;i<8;i++) {
prevtd=&td_int[i]; /* the first previous td is the skeleton td */
prevtd = &td_int[i]; /* the first previous td is the skeleton td */
link=swap_32(td_int[i].link) & 0xfffffff0; /* next in chain */
td=(uhci_td_t *)link; /* assign it */
/* all interrupt TDs are finally linked to the td_int[0].
......@@ -595,7 +595,7 @@ int usb_lowlevel_init(void)
busdevfunc=pci_find_device(USB_UHCI_VEND_ID,USB_UHCI_DEV_ID,0); /* get PCI Device ID */
if(busdevfunc==-1) {
if(busdevfunc == -1) {
printf("Error USB UHCI (%04X,%04X) not found\n",USB_UHCI_VEND_ID,USB_UHCI_DEV_ID);
return -1;
}
......@@ -642,12 +642,12 @@ int usb_lowlevel_init(void)
*/
int usb_lowlevel_stop(void)
{
if(irqvec==-1)
if(irqvec == -1)
return 1;
irq_free_handler(irqvec);
irq_free_handler(0);
reset_hc();
irqvec=-1;
irqvec = -1;
return 0;
}
......
#include "menu.h"
#define SINGLE_BOX 0
#define DOUBLE_BOX 1
void video_draw_box(int style, int attr, char *title, int separate, int x, int y, int w, int h);
void video_draw_text(int x, int y, int attr, char *text);
void video_save_rect(int x, int y, int w, int h, void *save_area, int clearchar, int clearattr);
void video_restore_rect(int x, int y, int w, int h, void *save_area);
int video_rows(void);
int video_cols(void);
#define MAX_MENU_OPTIONS 200
typedef struct
{
int used; /* flag if this entry is used */
int entry_x; /* Character column of the menu entry */
int entry_y; /* Character line of the entry */
int option_x; /* Character colum of the option (entry is same) */
} option_data_t;
option_data_t odata[MAX_MENU_OPTIONS];
int normal_attr = 0x0F;
int select_attr = 0x2F;
int disabled_attr = 0x07;
menu_t *root_menu;
int menu_init (menu_t *root)
{
char *s;
int i;
s = getenv("menu_normal");
if (s) normal_attr = atoi(s);
s = getenv("menu_select");
if (s) select_attr = atoi(s);
s = getenv("menu_disabled");
if (s) disabled_attr = atoi(s);
for (i=0; i<MAX_MENU_OPTIONS; i++) odata[i].used = 0;
root_menu = root;
}
option_data_t *menu_alloc_odata(void)
{
int i;
for (int i=0; i<MAX_MENU_OPTIONS; i++)
{
if (odata[i].used == 0) return &odata[i];
}
return NULL;
}
void menu_free_odata(option_data_t *odata)
{
odata->used = 0;
}
void menu_layout (menu_t *menu)
{
#ifndef MENU_H
#define MENU_H
/* A single menu */
typedef void (*menu_finish_callback)(struct menu_s *menu);
typedef struct menu_s {
char *name; /* Menu name */
int num_options; /* Number of options in this menu */
int flags; /* Various flags - see below */
int option_align; /* Aligns options to a field width of this much characters if != 0 */
struct menu_option_s **options; /* Pointer to this menu's options */
menu_finish_callback callback; /* Called when the menu closes */
} menu_t;
/*
* type: Type of the option (see below)
* name: Name to display for this option
* help: Optional help string
* id : optional id number
* sys : pointer for system-specific data, init to NULL and don't touch
*/
#define OPTION_PREAMBLE \
int type; \
char *name; \
char *help; \
int id; \
void *sys;
/*
* Menu option types.
* There are a number of different layouts for menu options depending
* on their types. Currently there are the following possibilities:
*
* Submenu:
* This entry links to a new menu.
*
* Boolean:
* A simple on/off toggle entry. Booleans can be either yes/no, 0/1 or on/off.
* Optionally, this entry can enable/disable a set of other options. An example would
* be to enable/disable on-board USB, and if enabled give access to further options like
* irq settings, base address etc.
*
* Text:
* A single line/limited number of characters text entry box. Text can be restricted
* to a certain charset (digits/hex digits/all/custom). Result is also available as an
* int if numeric.
*
* Selection:
* One-of-many type of selection entry. User may choose on of a set of strings, which
* maps to a specific value for the variable.
*
* Routine:
* Selecting this calls an entry-specific routine. This can be used for saving contents etc.
*
* Custom:
* Display and behaviour of this entry is defined by a set of callbacks.
*/
#define MENU_SUBMENU_TYPE 0
typedef struct menu_submenu_s
{
OPTION_PREAMBLE
menu_t * submenu; /* Pointer to the submenu */
} menu_submenu_t;
#define MENU_BOOLEAN_TYPE 1
typedef struct menu_boolean_s
{
OPTION_PREAMBLE
char *variable; /* Name of the variable to getenv()/setenv() */
int subtype; /* Subtype (on/off, 0/1, yes/no, enable/disable), see below */
int mutex; /* Bit mask of options to enable/disable. Bit 0 is the option
immediately following this one, bit 1 is the next one etc.
bit 7 = 0 means to disable when this option is off,
bit 7 = 1 means to disable when this option is on.
An option is disabled when the type field's upper bit is set */
} menu_boolean_t;
/* BOOLEAN Menu flags */
#define MENU_BOOLEAN_ONOFF 0x01
#define MENU_BOOLEAN_01 0x02
#define MENU_BOOLEAN_YESNO 0x03
#define MENU_BOOLEAN_ENDIS 0x04
#define MENU_BOOLEAN_TYPE_MASK 0x07
#define MENU_TEXT_TYPE 2
typedef struct menu_text_s
{
OPTION_PREAMBLE
char *variable; /* Name of the variable to getenv()/setenv() */
int maxchars; /* Max number of characters */
char *charset; /* Optional charset to use */
int flags; /* Flags - see below */
} menu_text_t;
/* TEXT entry menu flags */
#define MENU_TEXT_NUMERIC 0x01
#define MENU_TEXT_HEXADECIMAL 0x02
#define MENU_TEXT_FREE 0x03
#define MENU_TEXT_TYPE_MASK 0x07
#define MENU_SELECTION_TYPE 3
typedef struct menu_select_option_s {
char *map_from; /* Map this variable contents ... */
char *map_to; /* ... to this menu text and vice versa */
} menu_select_option_t;
typedef struct menu_select_s {
OPTION_PREAMBLE int num_options; /* Number of mappings */
menu_select_option_t **options;
/* Option list array */
} menu_select_t;
#define MENU_ROUTINE_TYPE 4
typedef void (*menu_routine_callback) (struct menu_routine_s *);
typedef struct menu_routine_s {
OPTION_PREAMBLE menu_routine_callback callback;
/* routine to be called */
void *user_data; /* User data, don't care for system */
} menu_routine_t;
#define MENU_CUSTOM_TYPE 5
typedef void (*menu_custom_draw) (struct menu_custom_s *);
typedef void (*menu_custom_key) (struct menu_custom_s *, int);
typedef struct menu_custom_s {
OPTION_PREAMBLE menu_custom_draw drawfunc;
menu_custom_key keyfunc;
void *user_data;
} menu_custom_t;
/*
* The menu option superstructure
*/
typedef struct menu_option_s {
union {
menu_submenu_t m_sub_menu;
menu_boolean_t m_boolean;
menu_text_t m_text;
menu_select_t m_select;
menu_routine_t m_routine;
};
} menu_option_t;
/* Init the menu system. Returns <0 on error */
int menu_init(menu_t *root);
/* Execute a single menu. Returns <0 on error */
int menu_do(menu_t *menu);
#endif
......@@ -5,5 +5,3 @@ ability and set the correct frequency and memory configuration.
To configure for the older Rev 2 ADS5121 type (this will not have PCI)
make ads5121_rev2_config
......@@ -29,14 +29,10 @@
#include <asm/arch/hardware.h>
#include <asm/arch/emac_defs.h>
#define MACH_TYPE_DAVINCI_EVM 901
DECLARE_GLOBAL_DATA_PTR;
extern void i2c_init(int speed, int slaveaddr);
extern void timer_init(void);
extern int eth_hw_init(void);
extern phy_t phy;
/* Works on Always On power domain only (no PD argument) */
......@@ -187,11 +183,8 @@ int misc_init_r (void)
}
}
if (!eth_hw_init()) {
if (!eth_hw_init())
printf("ethernet init failed!\n");
} else {
printf("ETH PHY : %s\n", phy.name);
}
i2c_read (0x39, 0x00, 1, (u_int8_t *)&i, 1);
......
......@@ -29,14 +29,10 @@
#include <asm/arch/hardware.h>
#include <asm/arch/emac_defs.h>
#define MACH_TYPE_SCHMOOGIE 1255
DECLARE_GLOBAL_DATA_PTR;
extern void i2c_init(int speed, int slaveaddr);
extern void timer_init(void);
extern int eth_hw_init(void);
extern phy_t phy;
/* Works on Always On power domain only (no PD argument) */
......@@ -233,11 +229,8 @@ int misc_init_r (void)
forceenv("serial#", (char *)&tmp[0]);
}
if (!eth_hw_init()) {
if (!eth_hw_init())
printf("ethernet init failed!\n");
} else {
printf("ETH PHY : %s\n", phy.name);
}
return(0);
}
......
......@@ -43,7 +43,6 @@ DECLARE_GLOBAL_DATA_PTR;
extern void timer_init(void);
extern int eth_hw_init(void);
extern phy_t phy;
/* Works on Always On power domain only (no PD argument) */
......@@ -288,11 +287,8 @@ int misc_init_r(void)
}
}
if (!eth_hw_init()) {
if (!eth_hw_init())
printf("Ethernet init failed\n");
} else {
printf("ETH PHY: %s\n", phy.name);
}
/* On this platform, U-Boot is copied in RAM by the UBL,
* so we are always in the relocated state. */
......
......@@ -29,14 +29,10 @@
#include <asm/arch/hardware.h>
#include <asm/arch/emac_defs.h>
#define MACH_TYPE_SONATA 1254
DECLARE_GLOBAL_DATA_PTR;
extern void i2c_init(int speed, int slaveaddr);
extern void timer_init(void);
extern int eth_hw_init(void);
extern phy_t phy;
/* Works on Always On power domain only (no PD argument) */
......@@ -188,11 +184,8 @@ int misc_init_r (void)
}
}
if (!eth_hw_init()) {
if (!eth_hw_init())
printf("ethernet init failed!\n");
} else {
printf("ETH PHY : %s\n", phy.name);
}
return(0);
}
......
......@@ -31,82 +31,83 @@
#include <net.h>
#include "srom.h"
extern int eepro100_write_eeprom (struct eth_device* dev,
int location, int addr_len, unsigned short data);
extern int eepro100_write_eeprom (struct eth_device *dev,
int location, int addr_len,
unsigned short data);
/*----------------------------------------------------------------------------*/
unsigned short eepro100_srom_checksum (unsigned short *sromdata)
{
unsigned short sum = 0;
unsigned int i;
for (i = 0; i < (EE_SIZE-1); i++)
{
sum += sromdata[i];
}
return (EE_CHECKSUM - sum);
unsigned short sum = 0;
unsigned int i;
for (i = 0; i < (EE_SIZE - 1); i++) {
sum += sromdata[i];
}
return (EE_CHECKSUM - sum);
}
/*----------------------------------------------------------------------------*/
int eepro100_srom_store (unsigned short *source)
{
int count;
struct eth_device onboard_dev;
/* get onboard network iobase */
pci_read_config_dword(PCI_BDF(0,0x10,0), PCI_BASE_ADDRESS_0,
(unsigned int *)&onboard_dev.iobase);
onboard_dev.iobase &= ~0xf;
source[63] = eepro100_srom_checksum (source);
for (count=0; count < EE_SIZE; count++)
{
if ( eepro100_write_eeprom ((struct eth_device*)&onboard_dev,
count, EE_ADDR_BITS, SROM_SHORT(source)) == -1 )
return -1;
source++;
}
return 0;
int count;
struct eth_device onboard_dev;
/* get onboard network iobase */
pci_read_config_dword (PCI_BDF (0, 0x10, 0), PCI_BASE_ADDRESS_0,
(unsigned int *) &onboard_dev.iobase);
onboard_dev.iobase &= ~0xf;
source[63] = eepro100_srom_checksum (source);
for (count = 0; count < EE_SIZE; count++) {
if (eepro100_write_eeprom ((struct eth_device *) &onboard_dev,
count, EE_ADDR_BITS,
SROM_SHORT (source)) == -1) {
return -1;
}
source++;
}
return 0;
}
/*----------------------------------------------------------------------------*/
#ifdef EEPRO100_SROM_CHECK
extern int read_eeprom (struct eth_device* dev, int location, int addr_len);
extern int read_eeprom (struct eth_device *dev, int location, int addr_len);
void eepro100_srom_load (unsigned short *destination)
{
int count;
struct eth_device onboard_dev;
int count;
struct eth_device onboard_dev;
#ifdef DEBUG
int lr = 0;
printf ("eepro100_srom_download:\n");
int lr = 0;
printf ("eepro100_srom_download:\n");
#endif
/* get onboard network iobase */
pci_read_config_dword(PCI_BDF(0,0x10,0), PCI_BASE_ADDRESS_0,
&onboard_dev.iobase);
onboard_dev.iobase &= ~0xf;
/* get onboard network iobase */
pci_read_config_dword (PCI_BDF (0, 0x10, 0), PCI_BASE_ADDRESS_0,
&onboard_dev.iobase);
onboard_dev.iobase &= ~0xf;
memset (destination, 0x65, 128);
memset (destination, 0x65, 128);
for (count=0; count < 0x40; count++)
{
*destination++ = read_eeprom (struct eth_device*)&onboard_dev,
count, EE_ADDR_BITS);
for (count = 0; count < 0x40; count++) {
*destination++ = read_eeprom ((struct eth_device *) &onboard_dev,
count, EE_ADDR_BITS);
#ifdef DEBUG
printf ("%04x ", *(destination - 1));
if (lr++ == 7)
{
printf("\n");
lr = 0;
}
printf ("%04x ", *(destination - 1));
if (lr++ == 7) {
printf ("\n");
lr = 0;
}
#endif
}
}
}
#endif /* EEPRO100_SROM_CHECK */
......
......@@ -1570,8 +1570,8 @@ dram_size(long int *base, long int maxsize)