*/
#include "armboot.h"
+#include "command.h"
+#include <SA-1100.h>
/* ------------------------------------------------------------------------- */
* Miscelaneous platform dependent initialisations
*/
+struct clocksetup
+{
+ int clockspeed; /* frequency in MHz */
+ unsigned long ppcr; /* value for core clock config */
+ unsigned long mdcas0; /* CAS timing ... */
+ unsigned long mdcas1;
+ unsigned long mdcas2;
+ unsigned long mdcnfg;
+ unsigned long msc0;
+ unsigned long mecr; /* PCMCIA timing */
+ unsigned long lccr3; /* pixel clock divider */
+};
+
+
+const static struct clocksetup speeds[] =
+{
+ {
+ 103,
+ 0x00000003,
+ 0xcccccccf,
+ 0xfffffffc,
+ 0xffffffff,
+ 0x0326991f,
+ 0x42304230,
+ 0x00c600c6,
+ 0x00000008
+ },
+ {
+ 190,
+ 0x00000009,
+ 0xc71c703f,
+ 0xffc71c71,
+ 0xffffffff,
+ 0x01b4b21f,
+ 0x44584458,
+ 0x016b016b,
+ 0x0000000f
+ },
+ {
+ 206,
+ 0x0000000a,
+ 0xc71c703f,
+ 0xffc71c71,
+ 0xffffffff,
+ 0x0194b21f,
+ 0x84c084c0,
+ 0x018c018c,
+ 0x00000010
+ }
+};
+
int board_init(bd_t *bd)
{
/* memory and cpu-speed are setup before relocation */
*(unsigned long *)temp = 0x00060006;
}
- #endif /* CONFIG_INIT_CRITICAL */
+ #endif /* CONFIG_INFERNO */
/* arch number for shannon */
bd->bi_arch_number = 97;
#endif
;
}
+
+#ifdef CONFIG_CMD_SETCLOCK
+int set_clock(int clockspeed)
+{
+ int i;
+
+ for(i = 0; i < sizeof(speeds) / sizeof(speeds[0]); i++)
+ {
+ if(speeds[i].clockspeed == clockspeed)
+ {
+ PPCR = speeds[i].ppcr;
+ MSC0 = speeds[i].msc0;
+ MDCAS0 = speeds[i].mdcas0;
+ MDCAS1 = speeds[i].mdcas1;
+ MDCAS2 = speeds[i].mdcas2;
+ MDCNFG = speeds[i].mdcnfg;
+ MECR = speeds[i].mecr;
+ LCCR3 = speeds[i].lccr3;
+ return(0);
+ }
+ }
+ printf("Available clockspeeds are:\n");
+ for(i = 0; i < sizeof(speeds) / sizeof(speeds[0]); i++)
+ printf(" %d\n", speeds[i].clockspeed);
+ return(-1);
+}
+
+
+int do_setclock (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
+{
+ if (argc != 2) {
+ printf ("Usage:\n%s\n", cmdtp->usage);
+ return 1;
+ }
+
+ return(set_clock(simple_strtoul(argv[1], NULL, 10)));
+}
+
+
+#endif
#define __CONFIG_H
/*
- * If we are developing, we might want to start armboot from ram
- * so we MUST NOT initialize critical regs like mem-timing ...
+ * If we want to rely on the Inferno Loader to bring us to life,
+ * we must use a different flash ROM layout, and we must initialze
+ * a few more things..
*/
+/*#undef CONFIG_INFERNO*/ /* we are not using the inferno bootldr */
+#define CONFIG_INFERNO /* we are using the inferno bootldr */
/*
- * we just run in non-critical mode now, because we use the Inferno-Loader to
- * bring us to live
+ * If we are developing, we might want to start armboot from ram
+ * so we MUST NOT initialize critical regs like mem-timing in this case
*/
-#define CONFIG_INFERNO /* we are using the inferno bootldr */
-#undef CONFIG_INIT_CRITICAL /* undef for developing */
+
+/*#define CONFIG_INIT_CRITICAL*/ /* undef for developing */
+#undef CONFIG_INIT_CRITICAL /* undef for developing */
/*
* High Level Configuration Options
* There are two possible drivers for the shannon's LCD screen,
* select one of these:
*/
-#define CONFIG_ANSI_CONSOLE /* ansi terminal emulation */
-#undef CONFIG_CFB_CONSOLE /* framebuffer console with std input */
-
-#ifdef CONFIG_ANSI_CONSOLE
-/* this set of defines will enable the generic frame buffer driver */
-#define CONFIG_FRAMEBUFFER /* use framebuffer */
-#define CONFIG_FRAMEBUFFER_BPP 8 /* 8 bits per pixel */
-#define CONFIG_FRAMEBUFFER_CLUT /* h/w has color lookup table */
-#endif
-
-#ifdef CONFIG_CFB_CONSOLE
-#define CONFIG_CONSOLE_CURSOR /* display cursor */
-#define CONFIG_VIDEO_LOGO /* display linux logo */
-#define CONFIG_VIDEO_SHANNON /* enable Shannon video driver */
-#endif
+#undef CONFIG_ANSI_CONSOLE /* ansi terminal emulation */
+//#define CONFIG_ANSI_CONSOLE /* ansi terminal emulation */
+#define CONFIG_CFB_CONSOLE /* framebuffer console with std input */
+//#undef CONFIG_CFB_CONSOLE /* framebuffer console with std input */
/*
* Keyboard device
+ *
+ * If you have enabled one of the LCD screen drivers above, you will
+ * most likely want to enable this as well ...
*/
#define CONFIG_KEYBOARD /* enable generic keyboard driver */
#define CONFIG_KEYBOARD_IRDA /* use IrDA keyboard */
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
CFG_CMD_PCMCIA | \
+ CFG_CMD_BSP | \
CFG_CMD_IDE)
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
#include <cmd_confdefs.h>
#define CONFIG_BOOTDELAY 3
+#ifdef CONFIG_KEYBOARD
+#define CONFIG_BOOTARGS "root=ramfs devfs=mount"
+#else
#define CONFIG_BOOTARGS "root=ramfs devfs=mount console=ttySA0,115200"
-#define CONFIG_NETMASK 255.255.0.0
+#endif
+#define CONFIG_NETMASK 255.255.0.0
#define CONFIG_BOOTCOMMAND "help"
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
#define CFG_LOAD_ADDR 0xd0000000 /* default load address */
#define CFG_HZ 3686400 /* incrementer freq: 3.6864 MHz */
-#define CFG_CPUSPEED 0x09 /* 190 MHz for Shannon */
+
+/*
+** CPU clock selection: The inferno firmware initializes the
+** shanonn to 103MHz, however, in our experience, many tuxscreens
+** can be safely overclocked to 190 MHz, some even to 206 MHz.
+*/
+#define CFG_CPUSPEED 0x03 /* 103 MHz for Shannon */
+//#define CFG_CPUSPEED 0x09 /* 190 MHz for Shannon */
+//#define CFG_CPUSPEED 0x0a /* 206 MHz for Shannon */
/* valid baudrates */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x003E0000) /* Addr of Environment Sector */
#define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
#else
-#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x1C000) /* Addr of Environment Sector */
-#define CFG_ENV_SIZE 0x4000 /* Total Size of Environment Sector */
+#define CFG_ENV_ADDR (PHYS_FLASH_1 + 0x20000) /* Addr of Environment Sector */
+#define CFG_ENV_SIZE 0x20000 /* Total Size of Environment Sector */
#endif
/*-----------------------------------------------------------------------
/* Offset for alternate registers */
#define CFG_ATA_ALT_OFFSET (CFG_ATA_BASE_ADDR)
+/*-----------------------------------------------------------------------
+ * Further parameters for framebuffer driver
+ *-----------------------------------------------------------------------
+ */
+
+/* no need normally to change anything here */
+
+#ifdef CONFIG_ANSI_CONSOLE
+/* this set of defines will enable the generic frame buffer driver */
+#define CONFIG_FRAMEBUFFER /* use framebuffer */
+#define CONFIG_FRAMEBUFFER_BPP 8 /* 8 bits per pixel */
+#define CONFIG_FRAMEBUFFER_CLUT /* h/w has color lookup table */
+#define CONFIG_ADJUST_LCD /* enable adjustment of LCD contrast/brightness*/
+#define CONFIG_PAGELENGTH 24 /* stop scrolling every 24 lines */
+#endif
+
+#ifdef CONFIG_CFB_CONSOLE
+#define CONFIG_CONSOLE_CURSOR /* display cursor */
+#define CONFIG_VIDEO_LOGO /* display linux logo */
+#define CONFIG_VIDEO_SHANNON /* enable Shannon video driver */
+#define CONFIG_ADJUST_LCD /* enable adjustment of LCD contrast/brightness*/
+#define CONFIG_PAGELENGTH 24 /* stop scrolling every 24 lines */
+#endif
+
+#ifdef CONFIG_KEYBOARD
+#define CFG_DEBOUNCE_TOUT (CFG_HZ/10) /* keyboard debounce timeout : 100 ms*/
+#endif
+
+#define CONFIG_CMD_SETCLOCK /* enable setting of CPU clock */
+
/*-----------------------------------------------------------------------
*/