version 1.1, 2007/11/08 22:21:46 |
version 1.4, 2007/11/13 15:41:35 |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/device.h> |
#include <sys/device.h> |
|
|
|
/* devices' regs that we will touch in config_machineinit() */ |
|
#include <arch/sam7s64/dev/sapmcreg.h> |
|
|
/* |
/* |
* Configuration file for platform (AT91SAM7S64). |
* Configuration file for platform (AT91SAM7S64). |
*/ |
*/ |
|
|
/* device drivers */ |
/* device drivers */ |
extern struct driver root_dr; |
extern struct driver root_dr; |
extern struct driver cpu_dr; |
extern struct driver cpu_dr; |
extern struct driver obio_dr; |
extern struct driver saapbus_dr; |
extern struct driver tacons_dr; |
|
extern struct driver fcons_dr; |
|
extern struct driver tartc_dr; |
|
extern struct driver tairqc_dr; |
|
|
|
|
|
extern void(*putchar)(char); |
extern void(*putchar)(char); |
void tacons_early_putc(char ch); |
void sauart_early_putc(char ch); |
|
|
/* amount of physical memory, in Bytes */ |
/* amount of physical memory, in Bytes */ |
uint32_t physmem = 33554432; |
uint32_t physmem = 16384; |
|
|
/* |
/* |
* Where to attach each device. |
* Where to attach each device. |
|
|
struct attachinfo config_attachinfo[] = { |
struct attachinfo config_attachinfo[] = { |
/* child, parent, pminor, loc, intrno, flags */ |
/* child, parent, pminor, loc, intrno, flags */ |
{ "cpu" , "root", 0, 0, 0, 0 }, |
{ "cpu" , "root", 0, 0, 0, 0 }, |
{ "obio", "root", 0, 0, 0, 0 }, |
{ "saapbus","root", 0, 0, 0, 0 }, |
{ "tacons", "obio", 0, 0x10000000, 0, 0 }, |
|
{ "tartc", "obio", 0, 0x15000000, 4, 0 }, |
|
{ "tairqc", "obio", 0, 0x16000000, 0, 0 }, |
|
{ "fcons", "tacons", 0, 0, 0, 0 }, |
|
{ NULL, NULL, 0, 0, 0, 0 } |
{ NULL, NULL, 0, 0, 0, 0 } |
}; |
}; |
|
|
|
|
struct driverinfo config_driverinfo[] = { |
struct driverinfo config_driverinfo[] = { |
/* name, driverp, ninstances (should be -1) */ |
/* name, driverp, ninstances (should be -1) */ |
{ "root", &root_dr, -1 }, |
{ "root", &root_dr, -1 }, |
{ "obio", &obio_dr, -1 }, |
|
{ "cpu" , &cpu_dr, -1 }, |
{ "cpu" , &cpu_dr, -1 }, |
{ "tacons", &tacons_dr, -1 }, |
{ "saapbus" , &saapbus_dr, -1 }, |
{ "tartc", &tartc_dr, -1 }, |
|
{ "fcons", &fcons_dr, -1 }, |
|
{ "tairqc", &tairqc_dr, -1 }, |
|
{ NULL, NULL, 0 } |
{ NULL, NULL, 0 } |
}; |
}; |
|
|
|
|
*/ |
*/ |
|
|
void |
void |
config_consinit(void) |
config_machineinit(void) |
{ |
{ |
/* |
/* |
* Configure putchar, so we can printf messages to the console without fcons. |
* Initialize critical devices at startup. |
*/ |
*/ |
/* putchar = tauart_early_putc; */ |
|
putchar = tacons_early_putc; |
/* XXX kill magic */ |
|
|
|
/* enable main oscillator and set 6 Slow Clock cycles to wait for its startup */ |
|
*(uint32_t)(SAPMC_BASE + SAPMC_CKGR_MOR) = (0x0000ff00 & (0x06 << 8)) | 0x00000001; |
|
|
|
/* wait main osc. to stabilize.. */ |
|
while (*(uint32_t)(SAPMC_BASE + SAPMC_PMC_SR) & 0x00000001 ) |
|
; |
|
|
|
/* TODO set PLL */ |
|
// *(uint32_t)(SAPMC_BASE + SAPMC_PMC_MCKR) = |
} |
} |
|
|
|
|