## ARM9 Systems
#########################################################################
-LIST_ARM9="cmdk2400 smdk2410"
+LIST_ARM9="smdk2400 smdk2410"
LIST_arm="${LIST_SA} ${LIST_ARM7} ${LIST_ARM9}"
for arg in $@
do
case "$arg" in
- 8xx|824x|8260|4xx|7xx|74xx)
+ 8xx|824x|8260|4xx|7xx|74xx|SA|ARM7|ARM9)
for target in `eval echo '$LIST_'${arg}`
do
build_target ${target}
LIBS = board/$(BOARDDIR)/lib$(BOARD).a
LIBS += cpu/$(CPU)/lib$(CPU).a
LIBS += lib_$(ARCH)/lib$(ARCH).a
-LIBS += drivers/libdrivers.a
LIBS += fs/jffs2/libjffs2.a
LIBS += net/libnet.a
LIBS += disk/libdisk.a
LIBS += rtc/librtc.a
LIBS += dtt/libdtt.a
+LIBS += drivers/libdrivers.a
LIBS += common/libcommon.a
LIBS += lib_generic/libgeneric.a
printf("(");
- if (size_b0 > 0)
- printf("Bank#1 - %ld MB", size_b0 >> 20);
-
- if (size_b1 > 0)
- printf("%sBank#2 - %ld kB",
- (size_b0 > 0) ? ", " : "",
- size_b1 >> 10);
+ if (size_b0 > 0) {
+ puts ("Bank#1 - ");
+ print_size (size_b0, (size_b1 > 0) ? ", " : ") ");
+ }
- printf(") ");
+ if (size_b1 > 0) {
+ puts ("Bank#2 - ");
+ print_size (size_b1, ") ");
+ }
}
else {
printf ("## No FLASH found.\n");
int board_init (void)
{
+ DECLARE_GLOBAL_DATA_PTR;
+
/* memory and cpu-speed are setup before relocation */
/* so we do _nothing_ here */
/* arch number of DNP1110-Board */
- bd->bi_arch_number = 255;
+ gd->bd->bi_arch_number = 255;
/* adress of boot parameters */
- bd->bi_boot_params = 0xc0000100;
+ gd->bd->bi_boot_params = 0xc0000100;
return 0;
}
int dram_init (void)
{
- bd->bi_dram[0].start = PHYS_SDRAM_1;
- bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+ DECLARE_GLOBAL_DATA_PTR;
+
+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
return PHYS_SDRAM_1_SIZE;
}
*/
#include <common.h>
+#include <environment.h>
static int check_crc(bd_t *bd)
{
break;
}
- if (info->size >= (1 << 20)) {
- printf (" Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count);
- } else {
- printf (" Size: %ld kB in %d Sectors\n", info->size >> 10, info->sector_count);
- }
+ puts (" Size: ");
+ print_size (info->size, "");
+ printf (" in %d Sectors\n", info->sector_count);
printf (" Sector Start Addresses:");
for (i=0; i<info->sector_count; ++i) {
*/
#include <common.h>
+#include <environment.h>
static int check_crc(bd_t *bd)
{
int board_init (void)
{
+ DECLARE_GLOBAL_DATA_PTR;
+
/* Activate LED flasher */
IO_LEDFLSH = 0x40;
/* arch number MACH_TYPE_EDB7312 */
- bd->bi_arch_number = 131;
+ gd->bd->bi_arch_number = 131;
/* location of boot parameters */
- bd->bi_boot_params = 0xc0020100;
+ gd->bd->bi_boot_params = 0xc0020100;
return 0;
}
int dram_init (void)
{
- bd->bi_dram[0].start = PHYS_SDRAM_1;
- bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+ DECLARE_GLOBAL_DATA_PTR;
+
+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
return PHYS_SDRAM_1_SIZE;
}
/*-----------------------------------------------------------------------
*/
-ulong flash_init(void)
+ulong flash_init (void)
{
- int i, j;
- ulong size = 0;
-
- for (i = 0; i < CFG_MAX_FLASH_BANKS; i++)
- {
- ulong flashbase = 0;
- flash_info[i].flash_id =
- (INTEL_MANUFACT & FLASH_VENDMASK) |
- (INTEL_ID_28F128J3 & FLASH_TYPEMASK);
- flash_info[i].size = FLASH_BANK_SIZE;
- flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
- memset(flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
- if (i == 0)
- flashbase = PHYS_FLASH_1;
- else
- panic("configured to many flash banks!\n");
- for (j = 0; j < flash_info[i].sector_count; j++)
- {
- flash_info[i].start[j] = flashbase + j*MAIN_SECT_SIZE;
+ int i, j;
+ ulong size = 0;
+
+ for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
+ ulong flashbase = 0;
+
+ flash_info[i].flash_id =
+ (INTEL_MANUFACT & FLASH_VENDMASK) |
+ (INTEL_ID_28F128J3 & FLASH_TYPEMASK);
+ flash_info[i].size = FLASH_BANK_SIZE;
+ flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
+ memset (flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
+ if (i == 0)
+ flashbase = PHYS_FLASH_1;
+ else
+ panic ("configured to many flash banks!\n");
+ for (j = 0; j < flash_info[i].sector_count; j++) {
+ flash_info[i].start[j] = flashbase + j * MAIN_SECT_SIZE;
+ }
+ size += flash_info[i].size;
}
- size += flash_info[i].size;
- }
-
- /* Protect monitor and environment sectors
- */
- flash_protect(FLAG_PROTECT_SET,
- CFG_FLASH_BASE,
- CFG_FLASH_BASE + _armboot_end - _armboot_start,
- &flash_info[0]);
-
- flash_protect(FLAG_PROTECT_SET,
- CFG_ENV_ADDR,
- CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
- &flash_info[0]);
-
- return size;
+
+ /* Protect monitor and environment sectors
+ */
+ flash_protect (FLAG_PROTECT_SET,
+ CFG_FLASH_BASE,
+ CFG_FLASH_BASE + _armboot_end - _armboot_start,
+ &flash_info[0]);
+
+ flash_protect (FLAG_PROTECT_SET,
+ CFG_ENV_ADDR,
+ CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
+
+ return size;
}
/*-----------------------------------------------------------------------
*/
-void flash_print_info (flash_info_t *info)
+void flash_print_info (flash_info_t * info)
{
- int i;
-
- switch (info->flash_id & FLASH_VENDMASK)
- {
- case (INTEL_MANUFACT & FLASH_VENDMASK):
- printf("Intel: ");
- break;
- default:
- printf("Unknown Vendor ");
- break;
- }
-
- switch (info->flash_id & FLASH_TYPEMASK)
- {
- case (INTEL_ID_28F128J3 & FLASH_TYPEMASK):
- printf("28F128J3 (128Mbit)\n");
- break;
- default:
- printf("Unknown Chip Type\n");
- goto Done;
- break;
- }
-
- printf(" Size: %ld MB in %d Sectors\n",
- info->size >> 20, info->sector_count);
-
- printf(" Sector Start Addresses:");
- for (i = 0; i < info->sector_count; i++)
- {
- if ((i % 5) == 0)
- {
- printf ("\n ");
+ int i;
+
+ switch (info->flash_id & FLASH_VENDMASK) {
+ case (INTEL_MANUFACT & FLASH_VENDMASK):
+ printf ("Intel: ");
+ break;
+ default:
+ printf ("Unknown Vendor ");
+ break;
}
- printf (" %08lX%s", info->start[i],
- info->protect[i] ? " (RO)" : " ");
- }
- printf ("\n");
-
-Done:
+
+ switch (info->flash_id & FLASH_TYPEMASK) {
+ case (INTEL_ID_28F128J3 & FLASH_TYPEMASK):
+ printf ("28F128J3 (128Mbit)\n");
+ break;
+ default:
+ printf ("Unknown Chip Type\n");
+ goto Done;
+ break;
+ }
+
+ printf (" Size: %ld MB in %d Sectors\n",
+ info->size >> 20, info->sector_count);
+
+ printf (" Sector Start Addresses:");
+ for (i = 0; i < info->sector_count; i++) {
+ if ((i % 5) == 0) {
+ printf ("\n ");
+ }
+ printf (" %08lX%s", info->start[i],
+ info->protect[i] ? " (RO)" : " ");
+ }
+ printf ("\n");
+
+ Done:
}
/*-----------------------------------------------------------------------
*/
-int flash_erase (flash_info_t *info, int s_first, int s_last)
+int flash_erase (flash_info_t * info, int s_first, int s_last)
{
- int flag, prot, sect;
- int rc = ERR_OK;
-
- if (info->flash_id == FLASH_UNKNOWN)
- return ERR_UNKNOWN_FLASH_TYPE;
-
- if ((s_first < 0) || (s_first > s_last)) {
- return ERR_INVAL;
- }
-
- if ((info->flash_id & FLASH_VENDMASK) !=
- (INTEL_MANUFACT & FLASH_VENDMASK)) {
- return ERR_UNKNOWN_FLASH_VENDOR;
- }
-
- prot = 0;
- for (sect=s_first; sect<=s_last; ++sect) {
- if (info->protect[sect]) {
- prot++;
- }
- }
- if (prot)
- return ERR_PROTECTED;
+ int flag, prot, sect;
+ int rc = ERR_OK;
- /*
- * Disable interrupts which might cause a timeout
- * here. Remember that our exception vectors are
- * at address 0 in the flash, and we don't want a
- * (ticker) exception to happen while the flash
- * chip is in programming mode.
- */
- flag = disable_interrupts();
+ if (info->flash_id == FLASH_UNKNOWN)
+ return ERR_UNKNOWN_FLASH_TYPE;
- /* Start erase on unprotected sectors */
- for (sect = s_first; sect<=s_last && !ctrlc(); sect++) {
+ if ((s_first < 0) || (s_first > s_last)) {
+ return ERR_INVAL;
+ }
- printf("Erasing sector %2d ... ", sect);
+ if ((info->flash_id & FLASH_VENDMASK) !=
+ (INTEL_MANUFACT & FLASH_VENDMASK)) {
+ return ERR_UNKNOWN_FLASH_VENDOR;
+ }
- /* arm simple, non interrupt dependent timer */
- reset_timer_masked();
-
- if (info->protect[sect] == 0) { /* not protected */
- vushort *addr = (vushort *)(info->start[sect]);
-
- *addr = 0x20; /* erase setup */
- *addr = 0xD0; /* erase confirm */
-
- while ((*addr & 0x80) != 0x80) {
- if (get_timer_masked() > CFG_FLASH_ERASE_TOUT) {
- *addr = 0xB0; /* suspend erase */
- *addr = 0xFF; /* reset to read mode */
- rc = ERR_TIMOUT;
- goto outahere;
+ prot = 0;
+ for (sect = s_first; sect <= s_last; ++sect) {
+ if (info->protect[sect]) {
+ prot++;
+ }
+ }
+ if (prot)
+ return ERR_PROTECTED;
+
+ /*
+ * Disable interrupts which might cause a timeout
+ * here. Remember that our exception vectors are
+ * at address 0 in the flash, and we don't want a
+ * (ticker) exception to happen while the flash
+ * chip is in programming mode.
+ */
+ flag = disable_interrupts ();
+
+ /* Start erase on unprotected sectors */
+ for (sect = s_first; sect <= s_last && !ctrlc (); sect++) {
+
+ printf ("Erasing sector %2d ... ", sect);
+
+ /* arm simple, non interrupt dependent timer */
+ reset_timer_masked ();
+
+ if (info->protect[sect] == 0) { /* not protected */
+ vu_short *addr = (vu_short *) (info->start[sect]);
+
+ *addr = 0x20; /* erase setup */
+ *addr = 0xD0; /* erase confirm */
+
+ while ((*addr & 0x80) != 0x80) {
+ if (get_timer_masked () > CFG_FLASH_ERASE_TOUT) {
+ *addr = 0xB0; /* suspend erase */
+ *addr = 0xFF; /* reset to read mode */
+ rc = ERR_TIMOUT;
+ goto outahere;
+ }
+ }
+
+ /* clear status register command */
+ *addr = 0x50;
+ /* reset to read mode */
+ *addr = 0xFF;
}
- }
-
- /* clear status register command */
- *addr = 0x50;
- /* reset to read mode */
- *addr = 0xFF;
+ printf ("ok.\n");
}
- printf("ok.\n");
- }
- if (ctrlc())
- printf("User Interrupt!\n");
-
-outahere:
-
- /* allow flash to settle - wait 10 ms */
- udelay_masked(10000);
-
- if (flag)
- enable_interrupts();
-
- return rc;
+ if (ctrlc ())
+ printf ("User Interrupt!\n");
+
+ outahere:
+
+ /* allow flash to settle - wait 10 ms */
+ udelay_masked (10000);
+
+ if (flag)
+ enable_interrupts ();
+
+ return rc;
}
/*-----------------------------------------------------------------------
* Copy memory to flash
*/
-static int write_word (flash_info_t *info, ulong dest, ushort data)
+static int write_word (flash_info_t * info, ulong dest, ushort data)
{
- vushort *addr = (vushort *)dest, val;
- int rc = ERR_OK;
- int flag;
-
- /* Check if Flash is (sufficiently) erased
- */
- if ((*addr & data) != data)
- return ERR_NOT_ERASED;
-
- /*
- * Disable interrupts which might cause a timeout
- * here. Remember that our exception vectors are
- * at address 0 in the flash, and we don't want a
- * (ticker) exception to happen while the flash
- * chip is in programming mode.
- */
- flag = disable_interrupts();
-
- /* clear status register command */
- *addr = 0x50;
-
- /* program set-up command */
- *addr = 0x40;
-
- /* latch address/data */
- *addr = data;
-
- /* arm simple, non interrupt dependent timer */
- reset_timer_masked();
-
- /* wait while polling the status register */
- while(((val = *addr) & 0x80) != 0x80)
- {
- if (get_timer_masked() > CFG_FLASH_WRITE_TOUT) {
- rc = ERR_TIMOUT;
- /* suspend program command */
- *addr = 0xB0;
- goto outahere;
+ vu_short *addr = (vu_short *) dest, val;
+ int rc = ERR_OK;
+ int flag;
+
+ /* Check if Flash is (sufficiently) erased
+ */
+ if ((*addr & data) != data)
+ return ERR_NOT_ERASED;
+
+ /*
+ * Disable interrupts which might cause a timeout
+ * here. Remember that our exception vectors are
+ * at address 0 in the flash, and we don't want a
+ * (ticker) exception to happen while the flash
+ * chip is in programming mode.
+ */
+ flag = disable_interrupts ();
+
+ /* clear status register command */
+ *addr = 0x50;
+
+ /* program set-up command */
+ *addr = 0x40;
+
+ /* latch address/data */
+ *addr = data;
+
+ /* arm simple, non interrupt dependent timer */
+ reset_timer_masked ();
+
+ /* wait while polling the status register */
+ while (((val = *addr) & 0x80) != 0x80) {
+ if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
+ rc = ERR_TIMOUT;
+ /* suspend program command */
+ *addr = 0xB0;
+ goto outahere;
+ }
+ }
+
+ if (val & 0x1A) { /* check for error */
+ printf ("\nFlash write error %02x at address %08lx\n",
+ (int) val, (unsigned long) dest);
+ if (val & (1 << 3)) {
+ printf ("Voltage range error.\n");
+ rc = ERR_PROG_ERROR;
+ goto outahere;
+ }
+ if (val & (1 << 1)) {
+ printf ("Device protect error.\n");
+ rc = ERR_PROTECTED;
+ goto outahere;
+ }
+ if (val & (1 << 4)) {
+ printf ("Programming error.\n");
+ rc = ERR_PROG_ERROR;
+ goto outahere;
+ }
+ rc = ERR_PROG_ERROR;
+ goto outahere;
}
- }
-
- if(val & 0x1A) { /* check for error */
- printf("\nFlash write error %02x at address %08lx\n",
- (int)val, (unsigned long)dest);
- if(val & (1<<3)) {
- printf("Voltage range error.\n");
- rc = ERR_PROG_ERROR;
- goto outahere;
- }
- if(val & (1<<1)) {
- printf("Device protect error.\n");
- rc = ERR_PROTECTED;
- goto outahere;
- }
- if(val & (1<<4)) {
- printf("Programming error.\n");
- rc = ERR_PROG_ERROR;
- goto outahere;
- }
- rc = ERR_PROG_ERROR;
- goto outahere;
- }
-
-outahere:
- /* read array command */
- *addr = 0xFF;
-
- if (flag)
- enable_interrupts();
-
- return rc;
+
+ outahere:
+ /* read array command */
+ *addr = 0xFF;
+
+ if (flag)
+ enable_interrupts ();
+
+ return rc;
}
/*-----------------------------------------------------------------------
* Copy memory to flash.
*/
-int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
+int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
{
- ulong cp, wp;
- ushort data;
- int l;
- int i, rc;
-
- wp = (addr & ~1); /* get lower word aligned address */
+ ulong cp, wp;
+ ushort data;
+ int l;
+ int i, rc;
+
+ wp = (addr & ~1); /* get lower word aligned address */
+
+ /*
+ * handle unaligned start bytes
+ */
+ if ((l = addr - wp) != 0) {
+ data = 0;
+ for (i = 0, cp = wp; i < l; ++i, ++cp) {
+ data = (data >> 8) | (*(uchar *) cp << 8);
+ }
+ for (; i < 2 && cnt > 0; ++i) {
+ data = (data >> 8) | (*src++ << 8);
+ --cnt;
+ ++cp;
+ }
+ for (; cnt == 0 && i < 2; ++i, ++cp) {
+ data = (data >> 8) | (*(uchar *) cp << 8);
+ }
- /*
- * handle unaligned start bytes
- */
- if ((l = addr - wp) != 0) {
- data = 0;
- for (i=0, cp=wp; i<l; ++i, ++cp) {
- data = (data >> 8) | (*(uchar *)cp << 8);
+ if ((rc = write_word (info, wp, data)) != 0) {
+ return (rc);
+ }
+ wp += 2;
}
- for (; i<2 && cnt>0; ++i) {
- data = (data >> 8) | (*src++ << 8);
- --cnt;
- ++cp;
+
+ /*
+ * handle word aligned part
+ */
+ while (cnt >= 2) {
+ data = *((vu_short *) src);
+ if ((rc = write_word (info, wp, data)) != 0) {
+ return (rc);
+ }
+ src += 2;
+ wp += 2;
+ cnt -= 2;
}
- for (; cnt==0 && i<2; ++i, ++cp) {
- data = (data >> 8) | (*(uchar *)cp << 8);
+
+ if (cnt == 0) {
+ return ERR_OK;
}
-
- if ((rc = write_word(info, wp, data)) != 0) {
- return (rc);
+
+ /*
+ * handle unaligned tail bytes
+ */
+ data = 0;
+ for (i = 0, cp = wp; i < 2 && cnt > 0; ++i, ++cp) {
+ data = (data >> 8) | (*src++ << 8);
+ --cnt;
}
- wp += 2;
- }
-
- /*
- * handle word aligned part
- */
- while (cnt >= 2) {
- data = *((vushort*)src);
- if ((rc = write_word(info, wp, data)) != 0) {
- return (rc);
+ for (; i < 2; ++i, ++cp) {
+ data = (data >> 8) | (*(uchar *) cp << 8);
}
- src += 2;
- wp += 2;
- cnt -= 2;
- }
-
- if (cnt == 0) {
- return ERR_OK;
- }
-
- /*
- * handle unaligned tail bytes
- */
- data = 0;
- for (i=0, cp=wp; i<2 && cnt>0; ++i, ++cp) {
- data = (data >> 8) | (*src++ << 8);
- --cnt;
- }
- for (; i<2; ++i, ++cp) {
- data = (data >> 8) | (*(uchar *)cp << 8);
- }
-
- return write_word(info, wp, data);
+
+ return write_word (info, wp, data);
}
break;
}
- if((info->size >> 20) > 0 ) {
- printf (" Size: %ld MB in %d Sectors\n",
- info->size >> 20, info->sector_count);
- } else {
- printf (" Size: %ld kB in %d Sectors\n",
- info->size >> 10, info->sector_count);
- }
+ puts (" Size: ");
+ print_size (info->size, "");
+ printf (" in %d Sectors\n", info->sector_count);
printf (" Sector Start Addresses:");
for (i=0; i<info->sector_count; ++i) {
*/
#include <common.h>
+#include <environment.h>
static int check_crc(bd_t *bd)
{
int board_init (void)
{
+ DECLARE_GLOBAL_DATA_PTR;
+
/* Activate LED flasher */
IO_LEDFLSH = 0x40;
/* arch number of EP7111 */
- bd->bi_arch_number = 50;
+ gd->bd->bi_arch_number = 50;
/* location of boot parameters for EP7111 */
- bd->bi_boot_params = 0xc0020100;
+ gd->bd->bi_boot_params = 0xc0020100;
return 0;
}
int dram_init (void)
{
- bd->bi_dram[0].start = PHYS_SDRAM_1;
- bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
- bd->bi_dram[1].start = PHYS_SDRAM_2;
- bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+ DECLARE_GLOBAL_DATA_PTR;
+
+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+ gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+ gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
return PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE;
}
*/
#include <common.h>
+#include <environment.h>
static int check_crc(bd_t *bd)
{
int board_init (void)
{
+ DECLARE_GLOBAL_DATA_PTR;
+
/* memory and cpu-speed are setup before relocation */
/* so we do _nothing_ here */
/* arch number of LART-Board */
- bd->bi_arch_number = 27;
+ gd->bd->bi_arch_number = 27;
/* adress of boot parameters */
- bd->bi_boot_params = 0xc0000100;
+ gd->bd->bi_boot_params = 0xc0000100;
return 0;
}
int dram_init (void)
{
+ DECLARE_GLOBAL_DATA_PTR;
+ bd_t *bd = gd->bd;
+
bd->bi_dram[0].start = PHYS_SDRAM_1;
bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
bd->bi_dram[1].start = PHYS_SDRAM_2;
*/
#include <common.h>
+#include <environment.h>
static int check_crc(bd_t *bd)
{
int board_init (void)
{
+ DECLARE_GLOBAL_DATA_PTR;
+
/* memory and cpu-speed are setup before relocation */
/* but if we use InfernoLoader, we must do some inits here */
#endif /* CONFIG_INIT_CRITICAL */
/* arch number for shannon */
- bd->bi_arch_number = 97;
+ gd->bd->bi_arch_number = 97;
/* adress of boot parameters */
- bd->bi_boot_params = 0xc0000100;
+ gd->bd->bi_boot_params = 0xc0000100;
return 0;
}
int dram_init (void)
{
+#if defined(PHYS_SDRAM_1) || defined(PHYS_SDRAM_2) || \
+ defined(PHYS_SDRAM_3) || defined(PHYS_SDRAM_4)
+ DECLARE_GLOBAL_DATA_PTR;
+ bd_t *bd = gd->bd;
+#endif
+
#ifdef PHYS_SDRAM_1
bd->bi_dram[0].start = PHYS_SDRAM_1;
bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
#endif
- return ( PHYS_SDRAM_1_SIZE
+ return ( 0
+#ifdef PHYS_SDRAM_1
+ + PHYS_SDRAM_1_SIZE
+#endif
+#ifdef PHYS_SDRAM_2
+ PHYS_SDRAM_2_SIZE
-#ifdef PHYS_SDRAM_4
+#endif
+#ifdef PHYS_SDRAM_3
+ PHYS_SDRAM_3_SIZE
+#endif
+#ifdef PHYS_SDRAM_4
+ PHYS_SDRAM_4_SIZE
#endif
);
*/
#include <common.h>
+#include <environment.h>
static int check_crc(bd_t *bd)
{
if (info->protect[sect] == 0)
{ /* not protected */
- vushort *addr = (vushort *)(info->start[sect]);
+ vu_short *addr = (vu_short *)(info->start[sect]);
MEM_FLASH_ADDR1 = CMD_UNLOCK1;
MEM_FLASH_ADDR2 = CMD_UNLOCK2;
volatile static int write_hword (flash_info_t *info, ulong dest, ushort data)
{
- vushort *addr = (vushort *)dest;
+ vu_short *addr = (vu_short *)dest;
ushort result;
int rc = ERR_OK;
int cflag, iflag;
* handle word aligned part
*/
while (cnt >= 2) {
- data = *((vushort*)src);
+ data = *((vu_short*)src);
if ((rc = write_hword(info, wp, data)) != 0) {
return (rc);
}
int board_init (void)
{
+ DECLARE_GLOBAL_DATA_PTR;
+
/* to reduce PLL lock time, adjust the LOCKTIME register */
rLOCKTIME = 0xFFFFFF;
rGPHUP = 0x000007FF;
/* arch number of SMDK2410-Board */
- bd->bi_arch_number = 193;
+ gd->bd->bi_arch_number = 193;
/* adress of boot parameters */
- bd->bi_boot_params = 0x30000100;
+ gd->bd->bi_boot_params = 0x30000100;
return 0;
}
int dram_init (void)
{
- bd->bi_dram[0].start = PHYS_SDRAM_1;
- bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+ DECLARE_GLOBAL_DATA_PTR;
+
+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
return PHYS_SDRAM_1_SIZE;
}
static void print_str(const char *, const char *);
int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
int i;
printf ("\nIP addr = "); print_IPaddr (bd->bi_ip_addr);
printf ("\nbaudrate = %6ld bps\n", bd->bi_baudrate );
return 0;
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
static void print_num(const char *name, ulong value)
ulong *len_ptr,
int verify)
{
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
ulong sp;
* r7: End of command line string
*/
(*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
static void
tm.tm_hour, tm.tm_min, tm.tm_sec);
#endif /* CFG_CMD_DATE */
printf (" Image Type: "); print_type(hdr); printf ("\n");
- printf (" Data Size: %d Bytes = %d kB = %d MB\n",
- hdr->ih_size, hdr->ih_size>>10, hdr->ih_size>>20);
+ printf (" Data Size: %d Bytes = ", hdr->ih_size);
+ print_size (hdr->ih_size, "\n");
printf (" Load Address: %08x\n", hdr->ih_load);
printf (" Entry Point: %08x\n", hdr->ih_ep);
printf (" Contents:\n");
for (i=0; *len_ptr; ++i, ++len_ptr) {
- printf (" Image %d: %8ld Bytes = %ld kB = %ld MB\n",
- i, *len_ptr, *len_ptr>>10, *len_ptr>>20);
+ printf (" Image %d: %8ld Bytes = ", i, *len_ptr);
+ print_size (*len_ptr, "\n");
}
}
}
/*
- * (C) Copyright 2000, 2001
+ * (C) Copyright 2000-2002
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* See file CREDITS for list of people who contributed to this
#include <watchdog.h>
#include <command.h>
#include <image.h>
-#ifdef CONFIG_IDE_8xx_DIRECT
+#include <asm/byteorder.h>
+#if defined(CONFIG_IDE_8xx_DIRECT) || defined(CONFIG_IDE_PCMCIA)
# include <pcmcia.h>
#endif
#ifdef CONFIG_8xx
hdr = (image_header_t *)addr;
- if (hdr->ih_magic == IH_MAGIC) {
+ if (ntohl(hdr->ih_magic) == IH_MAGIC) {
print_image_hdr (hdr);
- cnt = (hdr->ih_size + sizeof(image_header_t));
+ cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;
static env_t *env_ptr = NULL;
#else
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ /* nothing XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
# error Define one of CFG_ENV_IS_IN_NVRAM, CFG_ENV_IS_IN_EEPROM, CFG_ENV_IS_IN_FLASH, CFG_ENV_IS_NOWHERE
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
#endif /* CFG_ENV_IS_IN_FLASH */
/*----------------------------------------------------------------------*/
void env_relocate (void)
{
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
DEBUGF ("%s[%d] offset = 0x%lx\n", __FUNCTION__,__LINE__,
}
#endif
gd->env_addr = (ulong)&(env_ptr->data);
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
/************************************************************************
************************************************************************/
*/
static uchar get_env_char_memory (int index)
{
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
if (gd->env_valid) {
} else {
return ( default_environment[index] );
}
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
static uchar *get_env_addr_memory(int index)
{
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
if (gd->env_valid) {
} else {
return (&default_environment[index]);
}
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
#if defined(CFG_ENV_IS_IN_NVRAM) && defined(CFG_NVRAM_ACCESS_ROUTINE)
static uchar get_env_char_nvram(int index)
{
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
uchar c;
c = default_environment[index];
return c;
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
#endif
*/
static uchar get_env_char_eeprom (int index)
{
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
uchar c;
}
return (c);
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
#endif /* CFG_ENV_IS_IN_EEPROM */
int _do_setenv (int flag, int argc, char *argv[])
{
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
int i, len, oldval;
}
#endif /* CFG_CMD_NET */
return 0;
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
void setenv (char *varname, char *varvalue)
int saveenv(void)
{
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
int len, rc;
ulong end_addr;
uchar *flash_sect_addr;
/* try to re-protect */
(void) flash_sect_protect (1, (ulong)flash_sect_addr, end_addr);
return rcode;
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
#endif /* CFG_CMD_ENV + CFG_CMD_FLASH */
#else
int env_init(void)
{
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
DECLARE_GLOBAL_DATA_PTR;
if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) {
}
return (0);
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
}
#endif /* defined(CFG_ENV_IS_IN_NVRAM) && defined(CFG_NVRAM_ACCESS_ROUTINE) */
#include <console.h>
#include <syscall.h>
+void **syscall_tbl;
+
#ifdef CFG_CONSOLE_IS_IN_ENV
/*
* if overwrite_console returns 1, the stdin, stderr and stdout
disable_interrupts ();
reset_cpu (0);
- /*NOTREACHED*/}
+ /*NOTREACHED*/
+ return (0);
+}
void icache_enable (void)
{
#include <common.h>
#include <clps7111.h>
-#include <ptregs.h>
+
+#include <asm/proc-armv/ptrace.h>
extern void reset_cpu(ulong addr);
return IO_UARTDR1 & 0xff;
}
+
+void
+serial_puts (const char *s)
+{
+ while (*s) {
+ serial_putc (*s++);
+ }
+}
return rUTRSTAT1 & 0x1;
#endif
}
+
+void
+serial_puts (const char *s)
+{
+ while (*s) {
+ serial_putc (*s++);
+ }
+}
#include <common.h>
#include <SA-1100.h>
-#include <ptregs.h>
+
+#include <asm/proc-armv/ptrace.h>
extern void reset_cpu (ulong addr);
return (char) Ser3UTDR & 0xff;
#endif
}
+
+void
+serial_puts (const char *s)
+{
+ while (*s) {
+ serial_putc (*s++);
+ }
+}
#elif CONFIG_STUART
#endif
}
+
+void
+serial_puts (const char *s)
+{
+ while (*s) {
+ serial_putc (*s++);
+ }
+}
#ifdef CONFIG_DRIVER_3C589
-#include <3c589.h>
+#include "3c589.h"
// Use power-down feature of the chip
LIB = libdrivers.a
-OBJS = ns87308.o ns16550.o serial.o pci_auto.o pci.o pci_indirect.o \
- eepro100.o dc2114x.o w83c553f.o sym53c8xx.o pcnet.o \
- tigon3.o bcm570x.o bcm570x_autoneg.o 5701rls.o
+OBJS = 3c589.o 5701rls.o bcm570x.o bcm570x_autoneg.o \
+ cs8900.o dc2114x.o eepro100.o \
+ ns16550.o ns87308.o \
+ pci.o pci_auto.o pci_indirect.o \
+ pcnet.o serial.o \
+ smc91111.o sym53c8xx.o \
+ tigon3.o w83c553f.o
+
all: $(LIB)
$(LIB): $(OBJS)
#include <common.h>
#include <command.h>
-#include <cs8900.h>
+#include "cs8900.h"
#include <net.h>
#ifdef CONFIG_DRIVER_CS8900
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <types.h>
+#include <asm/types.h>
#include <config.h>
#ifdef CONFIG_DRIVER_CS8900
#include <common.h>
#include <command.h>
-#include <smc91111.h>
+#include "smc91111.h"
#include <net.h>
#ifdef CONFIG_DRIVER_SMC91111
PRINTK2("Polling...\n");
SMC_SELECT_BANK(2);
- while((SMC_inw(INT_REG) & mask) == 0)
+ while((SMC_inw(SMC91111_INT_REG) & mask) == 0)
{
if (get_timer(0) >= tmo) {
is_timeout = 1;
try++;
time_out = MEMORY_WAIT_TIME;
do {
- status = SMC_inb( INT_REG );
+ status = SMC_inb( SMC91111_INT_REG );
if ( status & IM_ALLOC_INT ) {
/* acknowledge the interrupt */
- SMC_outb( IM_ALLOC_INT, INT_REG );
+ SMC_outb( IM_ALLOC_INT, SMC91111_INT_REG );
break;
}
} while ( -- time_out );
/* send the packet length ( +6 for status, length and ctl byte )
and the status word ( set to zeros ) */
#ifdef USE_32_BIT
- SMC_outl( (length +6 ) << 16 , DATA_REG );
+ SMC_outl( (length +6 ) << 16 , SMC91111_DATA_REG );
#else
- SMC_outw( 0, DATA_REG );
+ SMC_outw( 0, SMC91111_DATA_REG );
/* send the packet length ( +6 for status words, length, and ctl*/
- SMC_outw( (length+6), DATA_REG );
+ SMC_outw( (length+6), SMC91111_DATA_REG );
#endif
/* send the actual data
. almost as much time as is saved?
*/
#ifdef USE_32_BIT
- SMC_outsl(DATA_REG, buf, length >> 2 );
+ SMC_outsl(SMC91111_DATA_REG, buf, length >> 2 );
if ( length & 0x2 )
- SMC_outw(*((word *)(buf + (length & 0xFFFFFFFC))), DATA_REG);
+ SMC_outw(*((word *)(buf + (length & 0xFFFFFFFC))), SMC91111_DATA_REG);
#else
- SMC_outsw(DATA_REG , buf, (length ) >> 1);
+ SMC_outsw(SMC91111_DATA_REG , buf, (length ) >> 1);
#endif // USE_32_BIT
/* Send the last byte, if there is one. */
if ( (length & 1) == 0 ) {
- SMC_outw( 0, DATA_REG );
+ SMC_outw( 0, SMC91111_DATA_REG );
} else {
- SMC_outw( buf[length -1 ] | 0x2000, DATA_REG );
+ SMC_outw( buf[length -1 ] | 0x2000, SMC91111_DATA_REG );
}
/* and let the chipset deal with it */
return 0;
} else {
/* ack. int */
- SMC_outw(IM_TX_INT, INT_REG);
+ SMC_outw(IM_TX_INT, SMC91111_INT_REG);
PRINTK2("%s: Sent packet of length %d \n", SMC_DEV_NAME, length);
/* release packet */
/* First two words are status and packet_length */
#ifdef USE_32_BIT
- stat_len = SMC_inl(DATA_REG);
+ stat_len = SMC_inl(SMC91111_DATA_REG);
status = stat_len & 0xffff;
packet_length = stat_len >> 16;
#else
- status = SMC_inw( DATA_REG );
- packet_length = SMC_inw( DATA_REG );
+ status = SMC_inw( SMC91111_DATA_REG );
+ packet_length = SMC_inw( SMC91111_DATA_REG );
#endif
packet_length &= 0x07ff; /* mask off top bits */
to send the DWORDs or the bytes first, or some
mixture. A mixture might improve already slow PIO
performance */
- SMC_insl( DATA_REG , NetRxPackets[0], packet_length >> 2 );
+ SMC_insl( SMC91111_DATA_REG , NetRxPackets[0], packet_length >> 2 );
/* read the left over bytes */
if (packet_length & 3)
{
int i;
byte *tail = NetRxPackets[0] + (packet_length & ~3);
- dword leftover = SMC_inl(DATA_REG);
+ dword leftover = SMC_inl(SMC91111_DATA_REG);
for (i=0; i<(packet_length & 3); i++)
*tail++ = (byte) (leftover >> (8*i)) & 0xff;
}
#else
PRINTK3(" Reading %d words and %d byte(s) \n",
(packet_length >> 1 ), packet_length & 1 );
- SMC_insw(DATA_REG , NetRxPackets[0], packet_length >> 1);
+ SMC_insw(SMC91111_DATA_REG , NetRxPackets[0], packet_length >> 1);
#endif // USE_32_BIT
#ifndef _SMC91111_H_
#define _SMC91111_H_
-#include <types.h>
+#include <asm/types.h>
#include <config.h>
// Data Register
/* BANK 2 */
-#define DATA_REG 0x0008
+#define SMC91111_DATA_REG 0x0008
// Interrupt Status/Acknowledge Register
/* BANK 2 */
-#define INT_REG 0x000C
+#define SMC91111_INT_REG 0x000C
// Interrupt Mask Register
#include <ppc_defs.h>
#include <syscall.h>
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ .global mon_getc
+ .type mon_getc,function
+mon_getc:
+ .global mon_tstc
+ .type mon_tstc,function
+mon_tstc:
+ .global mon_putc
+ .type mon_putc,function
+mon_putc:
+ .global mon_puts
+ .type mon_puts,function
+mon_puts:
+ .global mon_printf
+ .type mon_printf,function
+mon_printf:
+ .global mon_install_hdlr
+ .type mon_install_hdlr,function
+mon_install_hdlr:
+ .global mon_free_hdlr
+ .type mon_free_hdlr,function
+mon_free_hdlr:
+ .global mon_malloc
+ .type mon_malloc,function
+mon_malloc:
+ .global mon_free
+ .type mon_free,function
+mon_free:
+ @ args = 0, pretend = 0, frame = 0
+ @ frame_needed = 1, current_function_anonymous_args = 0
+ mov ip, sp
+ stmfd sp!, {fp, ip, lr, pc}
+ sub fp, ip, #4
+ ldmea fp, {fp, sp, pc}
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
#define SYSCALL(name,n) \
.globl name ; \
name: ; \
SYSCALL(mon_free_hdlr,SYSCALL_FREE_HDLR)
SYSCALL(mon_malloc,SYSCALL_MALLOC)
SYSCALL(mon_free,SYSCALL_FREE)
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
bd_t *bd;
unsigned long flags;
unsigned long baudrate;
+ unsigned long have_console; /* serial_init() was called */
+ unsigned long reloc_off; /* Relocation Offset */
#if 0
unsigned long cpu_clk; /* CPU clock in Hz! */
unsigned long bus_clk;
unsigned long ram_size; /* RAM size */
- unsigned long reloc_off; /* Relocation Offset */
unsigned long reset_status; /* reset status register at boot */
unsigned long env_addr; /* Address of Environment struct */
unsigned long env_valid; /* Checksum of Environment valid? */
- unsigned long have_console; /* serial_init() was called */
#endif
} gd_t;
#ifndef __ASM_ARM_IO_H
#define __ASM_ARM_IO_H
-#ifdef __KERNEL__
-
#include <linux/types.h>
+#include <asm/byteorder.h>
#include <asm/memory.h>
#include <asm/arch/hardware.h>
#define isa_check_signature(io,sig,len) (0)
#endif /* __mem_isa */
-#endif /* __KERNEL__ */
+
#endif /* __ASM_ARM_IO_H */
int board_init(void);
int dram_init (void);
-/* arm/display_options.c */
-int display_banner(void);
-int display_dram_config(void);
-void display_flash_config(ulong);
-
/* ------------------------------------------------------------ */
/* Here is a list of some prototypes which are incompatible to */
/* the PPCBoot implementation */
/* originally from linux source.
- * removed the dependacies on CONFIG_ values
+ * removed the dependencies on CONFIG_ values
* removed virt_to_phys stuff (and in fact everything surrounded by #if __KERNEL__)
* Modified By Rob Taylor, Flying Pig Systems, 2000
*/
#ifdef CONFIG_HYMOD
#include <asm/hymod.h>
#endif
+#ifdef CONFIG_ARM
+#define asmlinkage /* nothing */
+#endif
#include <part.h>
#include <flash.h>
/* */
long int initdram (int);
int display_options (void);
+void print_size (ulong, const char *);
/* common/main.c */
void main_loop (void);
ulong crc32_no_comp (ulong, const unsigned char *, uint);
/* common/console.c */
-void **syscall_tbl;
+extern void **syscall_tbl;
int console_init_f(void); /* Before relocation; uses the serial stuff */
int console_init_r(void); /* After relocation; uses the console stuff */
* Hardware drivers
*/
#define CONFIG_DRIVER_SMC91111
-#define SMC91111_BASE 0x20000300
+#define CONFIG_SMC91111_BASE 0x20000300
/*
#define CONFIG_BOOTDELAY 3
#define CONFIG_BOOTARGS "devfs=mount root=ramfs console=ttyS0,9600"
#define CONFIG_ETHADDR 08:00:3e:21:c7:f7
-//#define CONFIG_NETMASK 255.255.0.0
-//#define CONFIG_IPADDR 172.22.2.128
-//#define CONFIG_SERVERIP 172.22.2.126
-//#define CONFIG_BOOTFILE "impa7"
+/*#define CONFIG_NETMASK 255.255.0.0 */
+/*#define CONFIG_IPADDR 172.22.2.128 */
+/*#define CONFIG_SERVERIP 172.22.2.126 */
+/*#define CONFIG_BOOTFILE "impa7" */
#define CONFIG_BOOTCOMMAND "bootp;bootm"
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
#define CONFIG_BOOTDELAY 3
#define CONFIG_BOOTARGS "devfs=mount root=ramfs console=ttyS0,9600"
-//#define CONFIG_ETHADDR 08:00:3e:26:0a:5a
-//#define CONFIG_NETMASK 255.255.0.0
-//#define CONFIG_IPADDR 172.22.2.128
-//#define CONFIG_SERVERIP 172.22.2.126
-//#define CONFIG_BOOTFILE "impa7"
+/*#define CONFIG_ETHADDR 08:00:3e:26:0a:5a */
+/*#define CONFIG_NETMASK 255.255.0.0 */
+/*#define CONFIG_IPADDR 172.22.2.128 */
+/*#define CONFIG_SERVERIP 172.22.2.126 */
+/*#define CONFIG_BOOTFILE "impa7" */
#define CONFIG_BOOTCOMMAND "bootp;bootm"
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
#define CONFIG_BAUDRATE 115200
+#if 0 /* XXX - cannot test IDE anyway, so disabled for now - wd */
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
CFG_CMD_PCMCIA | \
CFG_CMD_IDE)
+#endif /* 0 */
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
#include <cmd_confdefs.h>
#include <cmd_confdefs.h>
#define CONFIG_BOOTDELAY 3
-//#define CONFIG_BOOTARGS "root=ramfs devfs=mount console=ttySA0,9600"
-//#define CONFIG_ETHADDR 08:00:3e:26:0a:5b
+/*#define CONFIG_BOOTARGS "root=ramfs devfs=mount console=ttySA0,9600" */
+/*#define CONFIG_ETHADDR 08:00:3e:26:0a:5b */
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_IPADDR 10.0.0.110
#define CONFIG_SERVERIP 10.0.0.1
-//#define CONFIG_BOOTFILE "elinos-lart"
-//#define CONFIG_BOOTCOMMAND "tftp; bootm"
+/*#define CONFIG_BOOTFILE "elinos-lart" */
+/*#define CONFIG_BOOTCOMMAND "tftp; bootm" */
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
#define INTEL_ID_28F640C3T 0x88CC88CC /* 64M = 4M x 16 top boot sector */
#define INTEL_ID_28F640C3B 0x88CD88CD /* 64M = 4M x 16 bottom boot sector */
+#define INTEL_ID_28F128J3 0x89189818 /* 16M = 8M x 16 x 128 */
#define INTEL_ID_28F640J5 0x00150015 /* 64M = 128K x 64 */
#define INTEL_ID_28F320J3A 0x00160016 /* 32M = 128K x 32 */
#define INTEL_ID_28F640J3A 0x00170017 /* 64M = 128K x 64 */
#define CONFIG_NET_MULTI
#endif
#endif
+#include <asm/byteorder.h> /* for nton* / ntoh* stuff */
/*
LIB = lib$(ARCH).a
-AOBJS =
+AOBJS = _udivsi3.o _umodsi3.o
-COBJS = armlinux.o board.o
+COBJS = armlinux.o board.o \
+ cache.o div0.o
OBJS = $(AOBJS) $(COBJS)
--- /dev/null
+/* # 1 "libgcc1.S" */
+@ libgcc1 routines for ARM cpu.
+@ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk)
+dividend .req r0
+divisor .req r1
+result .req r2
+curbit .req r3
+ip .req r12
+sp .req r13
+lr .req r14
+pc .req r15
+ .text
+ .globl __udivsi3
+ .type __udivsi3 ,function
+ .align 0
+ __udivsi3 :
+ cmp divisor, #0
+ beq Ldiv0
+ mov curbit, #1
+ mov result, #0
+ cmp dividend, divisor
+ bcc Lgot_result
+Loop1:
+ @ Unless the divisor is very big, shift it up in multiples of
+ @ four bits, since this is the amount of unwinding in the main
+ @ division loop. Continue shifting until the divisor is
+ @ larger than the dividend.
+ cmp divisor, #0x10000000
+ cmpcc divisor, dividend
+ movcc divisor, divisor, lsl #4
+ movcc curbit, curbit, lsl #4
+ bcc Loop1
+Lbignum:
+ @ For very big divisors, we must shift it a bit at a time, or
+ @ we will be in danger of overflowing.
+ cmp divisor, #0x80000000
+ cmpcc divisor, dividend
+ movcc divisor, divisor, lsl #1
+ movcc curbit, curbit, lsl #1
+ bcc Lbignum
+Loop3:
+ @ Test for possible subtractions, and note which bits
+ @ are done in the result. On the final pass, this may subtract
+ @ too much from the dividend, but the result will be ok, since the
+ @ "bit" will have been shifted out at the bottom.
+ cmp dividend, divisor
+ subcs dividend, dividend, divisor
+ orrcs result, result, curbit
+ cmp dividend, divisor, lsr #1
+ subcs dividend, dividend, divisor, lsr #1
+ orrcs result, result, curbit, lsr #1
+ cmp dividend, divisor, lsr #2
+ subcs dividend, dividend, divisor, lsr #2
+ orrcs result, result, curbit, lsr #2
+ cmp dividend, divisor, lsr #3
+ subcs dividend, dividend, divisor, lsr #3
+ orrcs result, result, curbit, lsr #3
+ cmp dividend, #0 @ Early termination?
+ movnes curbit, curbit, lsr #4 @ No, any more bits to do?
+ movne divisor, divisor, lsr #4
+ bne Loop3
+Lgot_result:
+ mov r0, result
+ mov pc, lr
+Ldiv0:
+ str lr, [sp, #-4]!
+ bl __div0 (PLT)
+ mov r0, #0 @ about as wrong as it could be
+ ldmia sp!, {pc}
+ .size __udivsi3 , . - __udivsi3
+/* # 235 "libgcc1.S" */
+/* # 320 "libgcc1.S" */
+/* # 421 "libgcc1.S" */
+/* # 433 "libgcc1.S" */
+/* # 456 "libgcc1.S" */
+/* # 500 "libgcc1.S" */
+/* # 580 "libgcc1.S" */
--- /dev/null
+/* # 1 "libgcc1.S" */
+@ libgcc1 routines for ARM cpu.
+@ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk)
+/* # 145 "libgcc1.S" */
+dividend .req r0
+divisor .req r1
+overdone .req r2
+curbit .req r3
+ip .req r12
+sp .req r13
+lr .req r14
+pc .req r15
+ .text
+ .globl __umodsi3
+ .type __umodsi3 ,function
+ .align 0
+ __umodsi3 :
+ cmp divisor, #0
+ beq Ldiv0
+ mov curbit, #1
+ cmp dividend, divisor
+ movcc pc, lr
+Loop1:
+ @ Unless the divisor is very big, shift it up in multiples of
+ @ four bits, since this is the amount of unwinding in the main
+ @ division loop. Continue shifting until the divisor is
+ @ larger than the dividend.
+ cmp divisor, #0x10000000
+ cmpcc divisor, dividend
+ movcc divisor, divisor, lsl #4
+ movcc curbit, curbit, lsl #4
+ bcc Loop1
+Lbignum:
+ @ For very big divisors, we must shift it a bit at a time, or
+ @ we will be in danger of overflowing.
+ cmp divisor, #0x80000000
+ cmpcc divisor, dividend
+ movcc divisor, divisor, lsl #1
+ movcc curbit, curbit, lsl #1
+ bcc Lbignum
+Loop3:
+ @ Test for possible subtractions. On the final pass, this may
+ @ subtract too much from the dividend, so keep track of which
+ @ subtractions are done, we can fix them up afterwards...
+ mov overdone, #0
+ cmp dividend, divisor
+ subcs dividend, dividend, divisor
+ cmp dividend, divisor, lsr #1
+ subcs dividend, dividend, divisor, lsr #1
+ orrcs overdone, overdone, curbit, ror #1
+ cmp dividend, divisor, lsr #2
+ subcs dividend, dividend, divisor, lsr #2
+ orrcs overdone, overdone, curbit, ror #2
+ cmp dividend, divisor, lsr #3
+ subcs dividend, dividend, divisor, lsr #3
+ orrcs overdone, overdone, curbit, ror #3
+ mov ip, curbit
+ cmp dividend, #0 @ Early termination?
+ movnes curbit, curbit, lsr #4 @ No, any more bits to do?
+ movne divisor, divisor, lsr #4
+ bne Loop3
+ @ Any subtractions that we should not have done will be recorded in
+ @ the top three bits of "overdone". Exactly which were not needed
+ @ are governed by the position of the bit, stored in ip.
+ @ If we terminated early, because dividend became zero,
+ @ then none of the below will match, since the bit in ip will not be
+ @ in the bottom nibble.
+ ands overdone, overdone, #0xe0000000
+ moveq pc, lr @ No fixups needed
+ tst overdone, ip, ror #3
+ addne dividend, dividend, divisor, lsr #3
+ tst overdone, ip, ror #2
+ addne dividend, dividend, divisor, lsr #2
+ tst overdone, ip, ror #1
+ addne dividend, dividend, divisor, lsr #1
+ mov pc, lr
+Ldiv0:
+ str lr, [sp, #-4]!
+ bl __div0 (PLT)
+ mov r0, #0 @ about as wrong as it could be
+ ldmia sp!, {pc}
+ .size __umodsi3 , . - __umodsi3
+/* # 320 "libgcc1.S" */
+/* # 421 "libgcc1.S" */
+/* # 433 "libgcc1.S" */
+/* # 456 "libgcc1.S" */
+/* # 500 "libgcc1.S" */
+/* # 580 "libgcc1.S" */
#include <devices.h>
#include <version.h>
+const char version_string[] =
+ PPCBOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
+
#ifdef CONFIG_DRIVER_CS8900
extern void cs8900_get_enetaddr (uchar * addr);
#endif
* Init Utilities *
************************************************************************
* Some of this code should be moved into the core functions,
+ * or dropped completely,
* but let's get it working (again) first...
*/
return (0);
}
+static int display_banner (void)
+{
+
+ printf ("\n\n%s\n\n", version_string);
+ printf ("ARMBoot code: %08lx -> %08lx\n",
+ _armboot_start, _armboot_end);
+#ifdef CONFIG_USE_IRQ
+ printf ("IRQ Stack: %08lx\n", IRQ_STACK_START);
+ printf ("FIQ Stack: %08lx\n", FIQ_STACK_START);
+#endif
+ return (0);
+}
+
+/*
+ * WARNING: this code looks "cleaner" than the PowerPC version, but
+ * has the disadvantage that you either get nothing, or everything.
+ * On PowerPC, you might see "DRAM: " before the system hangs - which
+ * gives a simple yet clear indication which part of the
+ * initialization if failing.
+ */
+static int display_dram_config (void)
+{
+ DECLARE_GLOBAL_DATA_PTR;
+ int i;
+
+ puts ("DRAM Configuration:\n");
+
+ for(i=0; i<CONFIG_NR_DRAM_BANKS; i++) {
+ printf ("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start);
+ print_size (gd->bd->bi_dram[i].size, "\n");
+ }
+
+ return (0);
+}
+
+static void display_flash_config (ulong size)
+{
+ puts ("Flash: ");
+ print_size (size, "\n");
+}
+
+
+
/*
* Breath some life into the board...
*
init_baudrate, /* initialze baudrate settings */
serial_init, /* serial communications setup */
display_banner,
- interrupt_init, /* set up execptions */
+ interrupt_init, /* set up exceptions */
dram_init, /* configure available RAM banks */
display_dram_config,
--- /dev/null
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/* for now: just dummy functions to satisfy the linker */
+
+void flush_cache (unsigned long dummy1, unsigned long dummy2)
+{
+ return;
+}
--- /dev/null
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/* Replacement (=dummy) for GNU/Linux division-by zero handler */
+void __div0 (void)
+{
+ extern void hang (void);
+
+ hang();
+}
/*
- * (C) Copyright 2000
+ * (C) Copyright 2000-2002
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* See file CREDITS for list of people who contributed to this
#endif
return 0;
}
+
+/*
+ * print sizes as "xxx kB", "xxx.y kB", "xxx MB" or "xxx.y MB" as needed;
+ * allow for optional trailing string (like "\n")
+ */
+void print_size (ulong size, const char *s)
+{
+ ulong m, n;
+ ulong d = 1 << 20; /* 1 MB */
+ char c = 'M';
+
+ if (size < d) { /* print in kB */
+ c = 'k';
+ d = 1 << 10;
+ }
+
+ n = size / d;
+
+ m = (10 * (size - (n * d)) + (d / 2) ) / d;
+
+ printf ("%2ld", n);
+ if (m) {
+ printf (".%ld", m);
+ }
+ printf (" %cB%s", c, s);
+}
#include <linux/ctype.h>
#include <malloc.h>
-#define __HAVE_ARCH_BCOPY
+#ifdef CONFIG_ARM
+#undef __HAVE_ARCH_MEMCMP
+#undef __HAVE_ARCH_MEMCPY
+#undef __HAVE_ARCH_MEMMOVE
+#undef __HAVE_ARCH_MEMSET
+#undef __HAVE_ARCH_BCOPY
+#undef __HAVE_ARCH_STRCAT
+#undef __HAVE_ARCH_STRCHR
+#undef __HAVE_ARCH_STRCMP
+#undef __HAVE_ARCH_STRCPY
+#undef __HAVE_ARCH_STRLEN
+#undef __HAVE_ARCH_STRNCPY
+#else
#define __HAVE_ARCH_MEMCMP
#define __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMSET
+#define __HAVE_ARCH_BCOPY
#define __HAVE_ARCH_STRCAT
#define __HAVE_ARCH_STRCMP
#define __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRLEN
#define __HAVE_ARCH_STRNCPY
+#endif
#ifndef __HAVE_ARCH_STRNICMP
/**
puts ("DRAM: ");
if ((gd->ram_size = initdram (board_type)) > 0) {
- printf ("%2ld MB\n", gd->ram_size >> 20);
+ print_size (gd->ram_size, "\n");
return (0);
}
puts (failed);
if ((flash_size = flash_init ()) > 0) {
#ifdef CFG_FLASH_CHECKSUM
- if (flash_size >= (1 << 20)) {
- printf ("%2ld MB", flash_size >> 20);
- } else {
- printf ("%2ld kB", flash_size >> 10);
- }
+ print_size (flash_size, "");
/*
* Compute and print flash CRC if flashchecksum is set to 'y'
*
}
putc ('\n');
#else
- if (flash_size >= (1 << 20)) {
- printf ("%2ld MB\n", flash_size >> 20);
- } else {
- printf ("%2ld kB\n", flash_size >> 10);
- }
+ print_size (flash_size, "");
#endif /* CFG_FLASH_CHECKSUM */
} else {
puts (failed);
printf ("Filename '%s'.", tftp_filename);
if (NetBootFileSize) {
- printf (" Size is %d%s kB => %x Bytes",
- NetBootFileSize/2,
- (NetBootFileSize%2) ? ".5" : "",
- NetBootFileSize<<9);
+ printf (" Size is 0x%x Bytes = ", NetBootFileSize<<9);
+ print_size (NetBootFileSize<<9, "");
}
putc ('\n');