Compare commits
119 Commits
v1.3.4-rc1
...
v1.3.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd82919e6c | ||
|
|
17e900b8c0 | ||
|
|
52b047ae48 | ||
|
|
224f7a5679 | ||
|
|
565ffbb9ee | ||
|
|
c9c101c660 | ||
|
|
b315ad8f0a | ||
|
|
902ca09246 | ||
|
|
3216ca9692 | ||
|
|
3cf8a234b8 | ||
|
|
2d0daa0361 | ||
|
|
9de67149db | ||
|
|
23f935c073 | ||
|
|
5276a3584d | ||
|
|
b6b183c5b2 | ||
|
|
4d57b0fb29 | ||
|
|
81c4dc3979 | ||
|
|
e84d568fa2 | ||
|
|
d9015f6a50 | ||
|
|
406819ae94 | ||
|
|
cfc442d791 | ||
|
|
a9fe0c3e7c | ||
|
|
0d28f34bbe | ||
|
|
aa5ffa16d7 | ||
|
|
c11528083e | ||
|
|
0bf202ec58 | ||
|
|
dedec4cfc8 | ||
|
|
61c5b8c64d | ||
|
|
91eb5d663d | ||
|
|
cd5b7d4a1e | ||
|
|
fe749f0cef | ||
|
|
29f8f58ff4 | ||
|
|
41266c9b5a | ||
|
|
f77d92a3f5 | ||
|
|
ba9324451b | ||
|
|
21f971ec26 | ||
|
|
3b8d17f0f0 | ||
|
|
2a112b234d | ||
|
|
d9d78ee46d | ||
|
|
d5d28fe4aa | ||
|
|
fd0f2f3796 | ||
|
|
1d10dcd041 | ||
|
|
eab1007334 | ||
|
|
6689484ccd | ||
|
|
ef11df6b66 | ||
|
|
0f2b5d8ec0 | ||
|
|
81091f58f0 | ||
|
|
4cd7e6528f | ||
|
|
66da6fa0e3 | ||
|
|
81d3f1fddd | ||
|
|
5fa62000db | ||
|
|
9314a342e1 | ||
|
|
1464eff77e | ||
|
|
2a433c66b1 | ||
|
|
ac169d645f | ||
|
|
01ae85b58b | ||
|
|
35d3bd3cc3 | ||
|
|
5c40548f01 | ||
|
|
a58c78067c | ||
|
|
4b50cd12a3 | ||
|
|
2bb6a1044f | ||
|
|
a48311557d | ||
|
|
a5bcb01fbd | ||
|
|
cdb8bd2fd3 | ||
|
|
2e752be39d | ||
|
|
c37207d7f5 | ||
|
|
5475412063 | ||
|
|
0b4951d4cd | ||
|
|
c4ec6db074 | ||
|
|
f7c602ac8b | ||
|
|
9196b44334 | ||
|
|
6361ad4b59 | ||
|
|
f0ff885ca6 | ||
|
|
57c219ad5d | ||
|
|
3f9ae1a5d4 | ||
|
|
ebb86c4ecd | ||
|
|
2cb9080427 | ||
|
|
3c95960e52 | ||
|
|
695a29b768 | ||
|
|
861931c30b | ||
|
|
09d318a8bb | ||
|
|
1ca9950b46 | ||
|
|
4fc72a0d6c | ||
|
|
a4c59ad4a2 | ||
|
|
8d87589e8e | ||
|
|
6b73b754f7 | ||
|
|
13ca6305f2 | ||
|
|
05c7fe0f04 | ||
|
|
c14eefcc48 | ||
|
|
936897d4d1 | ||
|
|
5d1d00fb36 | ||
|
|
2dacb734ba | ||
|
|
36d59bd9da | ||
|
|
7610db17fd | ||
|
|
f96b44cef8 | ||
|
|
e4dafff86f | ||
|
|
dbd3238792 | ||
|
|
ba17540844 | ||
|
|
a229d291f3 | ||
|
|
252a5e0738 | ||
|
|
7f4b009f42 | ||
|
|
a79c3e8d9c | ||
|
|
ab06bddb04 | ||
|
|
1953d128fd | ||
|
|
de2a07e534 | ||
|
|
ffbb5cb942 | ||
|
|
b2f44ba570 | ||
|
|
f13f64cf42 | ||
|
|
86446d3a5d | ||
|
|
97a3bf268d | ||
|
|
0043ac5502 | ||
|
|
20a71d93d6 | ||
|
|
1092fbd647 | ||
|
|
66fe183b1d | ||
|
|
340ccb260f | ||
|
|
2624239558 | ||
|
|
794a592497 | ||
|
|
f2aeecc320 | ||
|
|
6324e5bec8 |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -26,6 +26,8 @@
|
||||
/u-boot.ldr
|
||||
/u-boot.ldr.hex
|
||||
/u-boot.ldr.srec
|
||||
/u-boot-onenand.bin
|
||||
/u-boot-flexonenand.bin
|
||||
|
||||
#
|
||||
# Generated files
|
||||
@@ -46,3 +48,8 @@ series
|
||||
|
||||
# cscope files
|
||||
cscope.*
|
||||
|
||||
# OneNAND IPL files
|
||||
/onenand_ipl/onenand-ipl*
|
||||
/onenand_ipl/board/*/onenand*
|
||||
/onenand_ipl/board/*/*.S
|
||||
|
||||
50
MAINTAINERS
50
MAINTAINERS
@@ -239,6 +239,10 @@ The LEOX team <team@leox.org>
|
||||
|
||||
ELPT860 MPC860T
|
||||
|
||||
Guennadi Liakhovetski <g.liakhovetski@gmx.de>
|
||||
|
||||
linkstation MPC8241
|
||||
|
||||
Dave Liu <daveliu@freescale.com>
|
||||
|
||||
MPC8315ERDB MPC8315
|
||||
@@ -412,14 +416,14 @@ Stephen Williams <steve@icarus.com>
|
||||
|
||||
JSE PPC405GPr
|
||||
|
||||
Roy Zang <tie-fei.zang@freescale.com>
|
||||
|
||||
mpc7448hpc2 MPC7448
|
||||
|
||||
John Zhan <zhanz@sinovee.com>
|
||||
|
||||
svm_sc8xx MPC8xx
|
||||
|
||||
Guennadi Liakhovetski <g.liakhovetski@gmx.de>
|
||||
|
||||
linkstation MPC8241
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Unknown / orphaned boards:
|
||||
@@ -523,6 +527,10 @@ Rolf Offermanns <rof@sysgo.de>
|
||||
|
||||
shannon SA1100
|
||||
|
||||
Kyungmin Park <kyungmin.park@samsung.com>
|
||||
|
||||
apollon ARM1136EJS
|
||||
|
||||
Peter Pearse <peter.pearse@arm.com>
|
||||
integratorcp All current ARM supplied & supported core modules
|
||||
-see http://www.arm.com/products/DevTools/Hardware_Platforms.html
|
||||
@@ -552,6 +560,13 @@ Robert Schwebel <r.schwebel@pengutronix.de>
|
||||
csb226 xscale
|
||||
innokom xscale
|
||||
|
||||
Michael Schwingen <michael@schwingen.org>
|
||||
|
||||
actux1 xscale
|
||||
actux2 xscale
|
||||
actux3 xscale
|
||||
actux4 xscale
|
||||
|
||||
Andrea Scian <andrea.scian@dave-tech.it>
|
||||
|
||||
B2 ARM7TDMI (S3C44B0X)
|
||||
@@ -566,22 +581,11 @@ Richard Woodruff <r-woodruff2@ti.com>
|
||||
|
||||
omap2420h4 ARM1136EJS
|
||||
|
||||
Kyungmin Park <kyungmin.park@samsung.com>
|
||||
|
||||
apollon ARM1136EJS
|
||||
|
||||
Alex Z<>pke <azu@sysgo.de>
|
||||
|
||||
lart SA1100
|
||||
dnp1110 SA1110
|
||||
|
||||
Michael Schwingen <michael@schwingen.org>
|
||||
|
||||
actux1 xscale
|
||||
actux2 xscale
|
||||
actux3 xscale
|
||||
actux4 xscale
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Unknown / orphaned boards:
|
||||
@@ -679,6 +683,10 @@ Matthias Fuchs <matthias.fuchs@esd-electronics.com>
|
||||
|
||||
TASREG MCF5249
|
||||
|
||||
Hayden Fraser <Hayden.Fraser@freescale.com>
|
||||
|
||||
M5253EVBE mcf52x2
|
||||
|
||||
TsiChung Liew <Tsi-Chung.Liew@freescale.com>
|
||||
|
||||
M52277EVB mcf5227x
|
||||
@@ -689,10 +697,6 @@ TsiChung Liew <Tsi-Chung.Liew@freescale.com>
|
||||
M5475EVB mcf547x_8x
|
||||
M5485EVB mcf547x_8x
|
||||
|
||||
Hayden Fraser <Hayden.Fraser@freescale.com>
|
||||
|
||||
M5253EVBE mcf52x2
|
||||
|
||||
#########################################################################
|
||||
# AVR32 Systems: #
|
||||
# #
|
||||
@@ -716,6 +720,10 @@ Haavard Skinnemoen <hskinnemoen@atmel.com>
|
||||
# Board CPU #
|
||||
#########################################################################
|
||||
|
||||
Yusuke Goda <goda.yusuke@renesas.com>
|
||||
|
||||
MIGO-R SH7722
|
||||
|
||||
Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
|
||||
|
||||
MS7750SE SH7750
|
||||
@@ -732,10 +740,6 @@ Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
|
||||
|
||||
MS7720SE SH7720
|
||||
|
||||
Yusuke Goda <goda.yusuke@renesas.com>
|
||||
|
||||
MIGO-R SH7722
|
||||
|
||||
#########################################################################
|
||||
# Blackfin Systems: #
|
||||
# #
|
||||
|
||||
1
MAKEALL
1
MAKEALL
@@ -540,7 +540,6 @@ LIST_at91=" \
|
||||
#########################################################################
|
||||
|
||||
LIST_pxa=" \
|
||||
adsvix \
|
||||
cerf250 \
|
||||
cradle \
|
||||
csb226 \
|
||||
|
||||
9
Makefile
9
Makefile
@@ -24,7 +24,7 @@
|
||||
VERSION = 1
|
||||
PATCHLEVEL = 3
|
||||
SUBLEVEL = 4
|
||||
EXTRAVERSION = -rc1
|
||||
EXTRAVERSION =
|
||||
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
|
||||
VERSION_FILE = $(obj)include/version_autogenerated.h
|
||||
|
||||
@@ -346,10 +346,9 @@ $(U_BOOT_NAND): $(NAND_SPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
|
||||
cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
|
||||
|
||||
$(ONENAND_IPL): $(VERSION_FILE) $(obj)include/autoconf.mk
|
||||
$(MAKE) -C $(obj)onenand_ipl/board/$(BOARDDIR) all
|
||||
$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
|
||||
|
||||
$(U_BOOT_ONENAND): $(ONENAND_IPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
|
||||
$(MAKE) -C $(obj)onenand_ipl/board/$(BOARDDIR) all
|
||||
cat $(obj)onenand_ipl/onenand-ipl-2k.bin $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
|
||||
cat $(obj)onenand_ipl/onenand-ipl-4k.bin $(obj)u-boot.bin > $(obj)u-boot-flexonenand.bin
|
||||
|
||||
@@ -2595,9 +2594,6 @@ actux3_config : unconfig
|
||||
actux4_config : unconfig
|
||||
@$(MKCONFIG) $(@:_config=) arm ixp actux4
|
||||
|
||||
adsvix_config : unconfig
|
||||
@$(MKCONFIG) $(@:_config=) arm pxa adsvix
|
||||
|
||||
cerf250_config : unconfig
|
||||
@$(MKCONFIG) $(@:_config=) arm pxa cerf250
|
||||
|
||||
@@ -2664,6 +2660,7 @@ zylonite_config :
|
||||
|
||||
apollon_config : unconfig
|
||||
@mkdir -p $(obj)include
|
||||
@mkdir -p $(obj)onenand_ipl/board/apollon
|
||||
@echo "#define CONFIG_ONENAND_U_BOOT" > $(obj)include/config.h
|
||||
@$(MKCONFIG) $(@:_config=) arm arm1136 apollon NULL omap24xx
|
||||
@echo "CONFIG_ONENAND_U_BOOT = y" >> $(obj)include/config.mk
|
||||
|
||||
4
README
4
README
@@ -98,7 +98,7 @@ Where we come from:
|
||||
- create ARMBoot project (http://sourceforge.net/projects/armboot)
|
||||
- add other CPU families (starting with ARM)
|
||||
- create U-Boot project (http://sourceforge.net/projects/u-boot)
|
||||
- current project page: see http://www.denx.de/wiki/UBoot
|
||||
- current project page: see http://www.denx.de/wiki/U-Boot
|
||||
|
||||
|
||||
Names and Spelling:
|
||||
@@ -3903,7 +3903,7 @@ may be rejected, even when they contain important and valuable stuff.
|
||||
|
||||
Patches shall be sent to the u-boot-users mailing list.
|
||||
|
||||
Please see http://www.denx.de/wiki/UBoot/Patches for details.
|
||||
Please see http://www.denx.de/wiki/U-Boot/Patches for details.
|
||||
|
||||
When you send a patch, please include the following information with
|
||||
it:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2007 Semihalf
|
||||
* (C) Copyright 2007-2008 Semihalf
|
||||
*
|
||||
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||
*
|
||||
@@ -46,14 +46,15 @@
|
||||
#define ENUM_USB 1
|
||||
#define ENUM_SCSI 2
|
||||
#define ENUM_MMC 3
|
||||
#define ENUM_MAX 4
|
||||
#define ENUM_SATA 4
|
||||
#define ENUM_MAX 5
|
||||
|
||||
struct stor_spec {
|
||||
int max_dev;
|
||||
int enum_started;
|
||||
int enum_ended;
|
||||
int type; /* "external" type: DT_STOR_{IDE,USB,etc} */
|
||||
char name[4];
|
||||
char *name;
|
||||
};
|
||||
|
||||
static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0, "" }, };
|
||||
@@ -68,12 +69,19 @@ void dev_stor_init(void)
|
||||
specs[ENUM_IDE].type = DEV_TYP_STOR | DT_STOR_IDE;
|
||||
specs[ENUM_IDE].name = "ide";
|
||||
#endif
|
||||
#if defined(CONFIG_CMD_USB)
|
||||
specs[ENUM_USB].max_dev = USB_MAX_STOR_DEV;
|
||||
specs[ENUM_USB].enum_started = 0;
|
||||
specs[ENUM_USB].enum_ended = 0;
|
||||
specs[ENUM_USB].type = DEV_TYP_STOR | DT_STOR_USB;
|
||||
specs[ENUM_USB].name = "usb";
|
||||
#if defined(CONFIG_CMD_MMC)
|
||||
specs[ENUM_MMC].max_dev = CFG_MMC_MAX_DEVICE;
|
||||
specs[ENUM_MMC].enum_started = 0;
|
||||
specs[ENUM_MMC].enum_ended = 0;
|
||||
specs[ENUM_MMC].type = DEV_TYP_STOR | DT_STOR_MMC;
|
||||
specs[ENUM_MMC].name = "mmc";
|
||||
#endif
|
||||
#if defined(CONFIG_CMD_SATA)
|
||||
specs[ENUM_SATA].max_dev = CFG_SATA_MAX_DEVICE;
|
||||
specs[ENUM_SATA].enum_started = 0;
|
||||
specs[ENUM_SATA].enum_ended = 0;
|
||||
specs[ENUM_SATA].type = DEV_TYP_STOR | DT_STOR_SATA;
|
||||
specs[ENUM_SATA].name = "sata";
|
||||
#endif
|
||||
#if defined(CONFIG_CMD_SCSI)
|
||||
specs[ENUM_SCSI].max_dev = CFG_SCSI_MAX_DEVICE;
|
||||
@@ -82,6 +90,13 @@ void dev_stor_init(void)
|
||||
specs[ENUM_SCSI].type = DEV_TYP_STOR | DT_STOR_SCSI;
|
||||
specs[ENUM_SCSI].name = "scsi";
|
||||
#endif
|
||||
#if defined(CONFIG_CMD_USB) && defined(CONFIG_USB_STORAGE)
|
||||
specs[ENUM_USB].max_dev = USB_MAX_STOR_DEV;
|
||||
specs[ENUM_USB].enum_started = 0;
|
||||
specs[ENUM_USB].enum_ended = 0;
|
||||
specs[ENUM_USB].type = DEV_TYP_STOR | DT_STOR_USB;
|
||||
specs[ENUM_USB].name = "usb";
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -108,7 +123,10 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
|
||||
|
||||
if (first) {
|
||||
di->cookie = (void *)get_dev(specs[type].name, 0);
|
||||
found = 1;
|
||||
if (di->cookie == NULL)
|
||||
return 0;
|
||||
else
|
||||
found = 1;
|
||||
|
||||
} else {
|
||||
for (i = 0; i < specs[type].max_dev; i++)
|
||||
@@ -123,7 +141,10 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
|
||||
}
|
||||
|
||||
di->cookie = (void *)get_dev(specs[type].name, i);
|
||||
found = 1;
|
||||
if (di->cookie == NULL)
|
||||
return 0;
|
||||
else
|
||||
found = 1;
|
||||
|
||||
/* provide hint if there are more devices in
|
||||
* this group to enumerate */
|
||||
@@ -360,7 +381,7 @@ lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start
|
||||
return 0;
|
||||
|
||||
if ((dd->block_read) == NULL) {
|
||||
debugf("no block_read() for device 0x%08x\n");
|
||||
debugf("no block_read() for device 0x%08x\n", cookie);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (C) Copyright 2007 Semihalf
|
||||
* (C) Copyright 2007-2008 Semihalf
|
||||
*
|
||||
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||
*
|
||||
@@ -31,13 +31,15 @@
|
||||
|
||||
#define errf(fmt, args...) do { printf("ERROR @ %s(): ", __func__); printf(fmt, ##args); } while (0)
|
||||
|
||||
void test_dump_si(struct sys_info *);
|
||||
#define BUF_SZ 2048
|
||||
#define WAIT_SECS 5
|
||||
|
||||
void test_dump_buf(void *, int);
|
||||
void test_dump_di(int);
|
||||
void test_dump_si(struct sys_info *);
|
||||
void test_dump_sig(struct api_signature *);
|
||||
|
||||
char buf[2048];
|
||||
|
||||
#define WAIT_SECS 5
|
||||
static char buf[BUF_SZ];
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -58,11 +60,12 @@ int main(int argc, char *argv[])
|
||||
if (sig->version > API_SIG_VERSION)
|
||||
return -3;
|
||||
|
||||
printf("API signature found @%x\n", sig);
|
||||
printf("API signature found @%x\n", (unsigned int)sig);
|
||||
test_dump_sig(sig);
|
||||
|
||||
printf("\n*** Consumer API test ***\n");
|
||||
printf("syscall ptr 0x%08x@%08x\n", syscall_ptr, &syscall_ptr);
|
||||
printf("syscall ptr 0x%08x@%08x\n", (unsigned int)syscall_ptr,
|
||||
(unsigned int)&syscall_ptr);
|
||||
|
||||
/* console activities */
|
||||
ub_putc('B');
|
||||
@@ -125,11 +128,17 @@ int main(int argc, char *argv[])
|
||||
if (i == devs_no)
|
||||
printf("No storage devices available\n");
|
||||
else {
|
||||
memset(buf, 0, BUF_SZ);
|
||||
|
||||
if ((rv = ub_dev_open(i)) != 0)
|
||||
errf("open device %d error %d\n", i, rv);
|
||||
else if ((rv = ub_dev_read(i, &buf, 200, 20)) != 0)
|
||||
|
||||
else if ((rv = ub_dev_read(i, buf, 1, 0)) != 0)
|
||||
errf("could not read from device %d, error %d\n", i, rv);
|
||||
|
||||
printf("Sector 0 dump (512B):\n");
|
||||
test_dump_buf(buf, 512);
|
||||
|
||||
ub_dev_close(i);
|
||||
}
|
||||
|
||||
@@ -180,7 +189,7 @@ void test_dump_sig(struct api_signature *sig)
|
||||
printf("signature:\n");
|
||||
printf(" version\t= %d\n", sig->version);
|
||||
printf(" checksum\t= 0x%08x\n", sig->checksum);
|
||||
printf(" sc entry\t= 0x%08x\n", sig->syscall);
|
||||
printf(" sc entry\t= 0x%08x\n", (unsigned int)sig->syscall);
|
||||
}
|
||||
|
||||
void test_dump_si(struct sys_info *si)
|
||||
@@ -188,9 +197,9 @@ void test_dump_si(struct sys_info *si)
|
||||
int i;
|
||||
|
||||
printf("sys info:\n");
|
||||
printf(" clkbus\t= 0x%08x\n", si->clk_bus);
|
||||
printf(" clkcpu\t= 0x%08x\n", si->clk_cpu);
|
||||
printf(" bar\t\t= 0x%08x\n", si->bar);
|
||||
printf(" clkbus\t= 0x%08x\n", (unsigned int)si->clk_bus);
|
||||
printf(" clkcpu\t= 0x%08x\n", (unsigned int)si->clk_cpu);
|
||||
printf(" bar\t\t= 0x%08x\n", (unsigned int)si->bar);
|
||||
|
||||
printf("---\n");
|
||||
for (i = 0; i < si->mr_no; i++) {
|
||||
@@ -217,23 +226,56 @@ void test_dump_si(struct sys_info *si)
|
||||
}
|
||||
}
|
||||
|
||||
static char * test_stor_typ(int type)
|
||||
static char *test_stor_typ(int type)
|
||||
{
|
||||
if (type & DT_STOR_IDE)
|
||||
return "IDE";
|
||||
|
||||
if (type & DT_STOR_MMC)
|
||||
return "MMC";
|
||||
|
||||
if (type & DT_STOR_SATA)
|
||||
return "SATA";
|
||||
|
||||
if (type & DT_STOR_SCSI)
|
||||
return "SCSI";
|
||||
|
||||
if (type & DT_STOR_USB)
|
||||
return "USB";
|
||||
|
||||
if (type & DT_STOR_MMC);
|
||||
return "MMC";
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
void test_dump_buf(void *buf, int len)
|
||||
{
|
||||
int i;
|
||||
int line_counter = 0;
|
||||
int sep_flag = 0;
|
||||
int addr = 0;
|
||||
|
||||
printf("%07x:\t", addr);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (line_counter++ > 15) {
|
||||
line_counter = 0;
|
||||
sep_flag = 0;
|
||||
addr += 16;
|
||||
i--;
|
||||
printf("\n%07x:\t", addr);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sep_flag++ > 1) {
|
||||
sep_flag = 1;
|
||||
printf(" ");
|
||||
}
|
||||
|
||||
printf("%02x", *((char *)buf++));
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void test_dump_di(int handle)
|
||||
{
|
||||
int i;
|
||||
@@ -252,7 +294,7 @@ void test_dump_di(int handle)
|
||||
|
||||
} else if (di->type & DEV_TYP_STOR) {
|
||||
printf(" type\t\t= %s\n", test_stor_typ(di->type));
|
||||
printf(" blk size\t\t= %d\n", di->di_stor.block_size);
|
||||
printf(" blk count\t\t= %d\n", di->di_stor.block_count);
|
||||
printf(" blk size\t\t= %d\n", (unsigned int)di->di_stor.block_size);
|
||||
printf(" blk count\t\t= %d\n", (unsigned int)di->di_stor.block_count);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ $(shell mkdir -p $(OBJTREE)/board/freescale/common)
|
||||
|
||||
LIB = $(obj)lib$(BOARD).a
|
||||
|
||||
COBJS-y := $(BOARD).o iopin.o
|
||||
COBJS-y := $(BOARD).o
|
||||
COBJS-${CONFIG_FSL_DIU_FB} += ads5121_diu.o
|
||||
COBJS-${CONFIG_FSL_DIU_FB} += ../freescale/common/fsl_diu_fb.o
|
||||
COBJS-${CONFIG_FSL_DIU_FB} += ../freescale/common/fsl_logo_bmp.o
|
||||
|
||||
@@ -23,14 +23,12 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <mpc512x.h>
|
||||
#include "iopin.h"
|
||||
#include <asm/bitops.h>
|
||||
#include <command.h>
|
||||
#include <fdt_support.h>
|
||||
#ifdef CONFIG_MISC_INIT_R
|
||||
#include <i2c.h>
|
||||
#endif
|
||||
#include "iopin.h" /* for iopin_initialize() prototype */
|
||||
|
||||
/* Clocks in use */
|
||||
#define SCCR1_CLOCKS_EN (CLOCK_SCCR1_CFG_EN | \
|
||||
@@ -124,7 +122,7 @@ long int fixed_sdram (void)
|
||||
u32 i;
|
||||
|
||||
/* Initialize IO Control */
|
||||
im->io_ctrl.regs[MEM_IDX] = IOCTRL_MUX_DDR;
|
||||
im->io_ctrl.regs[IOCTL_MEM/4] = IOCTRL_MUX_DDR;
|
||||
|
||||
/* Initialize DDR Local Window */
|
||||
im->sysconf.ddrlaw.bar = CFG_DDR_BASE & 0xFFFFF000;
|
||||
@@ -237,6 +235,56 @@ int misc_init_r(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
static iopin_t ioregs_init[] = {
|
||||
/* FUNC1=FEC_RX_DV Sets Next 3 to FEC pads */
|
||||
{
|
||||
IOCTL_SPDIF_TXCLK, 3, 0,
|
||||
IO_PIN_FMUX(1) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
|
||||
},
|
||||
/* Set highest Slew on 9 PATA pins */
|
||||
{
|
||||
IOCTL_PATA_CE1, 9, 1,
|
||||
IO_PIN_FMUX(0) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC1=FEC_COL Sets Next 15 to FEC pads */
|
||||
{
|
||||
IOCTL_PSC0_0, 15, 0,
|
||||
IO_PIN_FMUX(1) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC1=SPDIF_TXCLK */
|
||||
{
|
||||
IOCTL_LPC_CS1, 1, 0,
|
||||
IO_PIN_FMUX(1) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(1) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC2=SPDIF_TX and sets Next pin to SPDIF_RX */
|
||||
{
|
||||
IOCTL_I2C1_SCL, 2, 0,
|
||||
IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(1) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC2=DIU CLK */
|
||||
{
|
||||
IOCTL_PSC6_0, 1, 0,
|
||||
IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(1) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC2=DIU_HSYNC */
|
||||
{
|
||||
IOCTL_PSC6_1, 1, 0,
|
||||
IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC2=DIUVSYNC Sets Next 26 to DIU Pads */
|
||||
{
|
||||
IOCTL_PSC6_4, 26, 0,
|
||||
IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
|
||||
}
|
||||
};
|
||||
|
||||
int checkboard (void)
|
||||
{
|
||||
@@ -246,7 +294,9 @@ int checkboard (void)
|
||||
printf ("Board: ADS5121 rev. 0x%04x (CPLD rev. 0x%02x)\n",
|
||||
brd_rev, cpld_rev);
|
||||
/* initialize function mux & slew rate IO inter alia on IO Pins */
|
||||
iopin_initialize();
|
||||
|
||||
|
||||
iopin_initialize(ioregs_init, sizeof(ioregs_init) / sizeof(ioregs_init[0]));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2008
|
||||
* Martha J Marx, Silicon Turnkey Express, mmarx@silicontkx.com
|
||||
* mpc512x I/O pin/pad initialization for the ADS5121 board
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <linux/types.h>
|
||||
#include "iopin.h"
|
||||
|
||||
/* IO pin fields */
|
||||
#define IO_PIN_FMUX(v) ((v) << 7) /* pin function */
|
||||
#define IO_PIN_HOLD(v) ((v) << 5) /* hold time, pci only */
|
||||
#define IO_PIN_PUD(v) ((v) << 4) /* if PUE, 0=pull-down, 1=pull-up */
|
||||
#define IO_PIN_PUE(v) ((v) << 3) /* pull up/down enable */
|
||||
#define IO_PIN_ST(v) ((v) << 2) /* schmitt trigger */
|
||||
#define IO_PIN_DS(v) ((v)) /* slew rate */
|
||||
|
||||
static struct iopin_t {
|
||||
int p_offset; /* offset from IOCTL_MEM_OFFSET */
|
||||
int nr_pins; /* number of pins to set this way */
|
||||
int bit_or; /* or in the value instead of overwrite */
|
||||
u_long val; /* value to write or or */
|
||||
} ioregs_init[] = {
|
||||
/* FUNC1=FEC_RX_DV Sets Next 3 to FEC pads */
|
||||
{
|
||||
IOCTL_SPDIF_TXCLK, 3, 0,
|
||||
IO_PIN_FMUX(1) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
|
||||
},
|
||||
/* Set highest Slew on 9 PATA pins */
|
||||
{
|
||||
IOCTL_PATA_CE1, 9, 1,
|
||||
IO_PIN_FMUX(0) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC1=FEC_COL Sets Next 15 to FEC pads */
|
||||
{
|
||||
IOCTL_PSC0_0, 15, 0,
|
||||
IO_PIN_FMUX(1) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC1=SPDIF_TXCLK */
|
||||
{
|
||||
IOCTL_LPC_CS1, 1, 0,
|
||||
IO_PIN_FMUX(1) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(1) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC2=SPDIF_TX and sets Next pin to SPDIF_RX */
|
||||
{
|
||||
IOCTL_I2C1_SCL, 2, 0,
|
||||
IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(1) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC2=DIU CLK */
|
||||
{
|
||||
IOCTL_PSC6_0, 1, 0,
|
||||
IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(1) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC2=DIU_HSYNC */
|
||||
{
|
||||
IOCTL_PSC6_1, 1, 0,
|
||||
IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
|
||||
},
|
||||
/* FUNC2=DIUVSYNC Sets Next 26 to DIU Pads */
|
||||
{
|
||||
IOCTL_PSC6_4, 26, 0,
|
||||
IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
|
||||
IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
|
||||
}
|
||||
};
|
||||
|
||||
void iopin_initialize(void)
|
||||
{
|
||||
short i, j, n, p;
|
||||
u_long *reg;
|
||||
immap_t *im = (immap_t *)CFG_IMMR;
|
||||
|
||||
reg = (u_long *)&(im->io_ctrl.regs[0]);
|
||||
|
||||
if (sizeof(ioregs_init) == 0)
|
||||
return;
|
||||
|
||||
n = sizeof(ioregs_init) / sizeof(ioregs_init[0]);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
for (p = 0, j = ioregs_init[i].p_offset / sizeof(u_long);
|
||||
p < ioregs_init[i].nr_pins; p++, j++) {
|
||||
if (ioregs_init[i].bit_or)
|
||||
reg[j] |= ioregs_init[i].val;
|
||||
else
|
||||
reg[j] = ioregs_init[i].val;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1,222 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2008
|
||||
* Martha J Marx, Silicon Turnkey Express, mmarx@silicontkx.com
|
||||
* mpc512x I/O pin/pad initialization for the ADS5121 board
|
||||
* 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
|
||||
*/
|
||||
|
||||
#define IOCTL_MEM 0x000
|
||||
#define IOCTL_GP 0x004
|
||||
#define IOCTL_LPC_CLK 0x008
|
||||
#define IOCTL_LPC_OE 0x00C
|
||||
#define IOCTL_LPC_RWB 0x010
|
||||
#define IOCTL_LPC_ACK 0x014
|
||||
#define IOCTL_LPC_CS0 0x018
|
||||
#define IOCTL_NFC_CE0 0x01C
|
||||
#define IOCTL_LPC_CS1 0x020
|
||||
#define IOCTL_LPC_CS2 0x024
|
||||
#define IOCTL_LPC_AX03 0x028
|
||||
#define IOCTL_EMB_AX02 0x02C
|
||||
#define IOCTL_EMB_AX01 0x030
|
||||
#define IOCTL_EMB_AX00 0x034
|
||||
#define IOCTL_EMB_AD31 0x038
|
||||
#define IOCTL_EMB_AD30 0x03C
|
||||
#define IOCTL_EMB_AD29 0x040
|
||||
#define IOCTL_EMB_AD28 0x044
|
||||
#define IOCTL_EMB_AD27 0x048
|
||||
#define IOCTL_EMB_AD26 0x04C
|
||||
#define IOCTL_EMB_AD25 0x050
|
||||
#define IOCTL_EMB_AD24 0x054
|
||||
#define IOCTL_EMB_AD23 0x058
|
||||
#define IOCTL_EMB_AD22 0x05C
|
||||
#define IOCTL_EMB_AD21 0x060
|
||||
#define IOCTL_EMB_AD20 0x064
|
||||
#define IOCTL_EMB_AD19 0x068
|
||||
#define IOCTL_EMB_AD18 0x06C
|
||||
#define IOCTL_EMB_AD17 0x070
|
||||
#define IOCTL_EMB_AD16 0x074
|
||||
#define IOCTL_EMB_AD15 0x078
|
||||
#define IOCTL_EMB_AD14 0x07C
|
||||
#define IOCTL_EMB_AD13 0x080
|
||||
#define IOCTL_EMB_AD12 0x084
|
||||
#define IOCTL_EMB_AD11 0x088
|
||||
#define IOCTL_EMB_AD10 0x08C
|
||||
#define IOCTL_EMB_AD09 0x090
|
||||
#define IOCTL_EMB_AD08 0x094
|
||||
#define IOCTL_EMB_AD07 0x098
|
||||
#define IOCTL_EMB_AD06 0x09C
|
||||
#define IOCTL_EMB_AD05 0x0A0
|
||||
#define IOCTL_EMB_AD04 0x0A4
|
||||
#define IOCTL_EMB_AD03 0x0A8
|
||||
#define IOCTL_EMB_AD02 0x0AC
|
||||
#define IOCTL_EMB_AD01 0x0B0
|
||||
#define IOCTL_EMB_AD00 0x0B4
|
||||
#define IOCTL_PATA_CE1 0x0B8
|
||||
#define IOCTL_PATA_CE2 0x0BC
|
||||
#define IOCTL_PATA_ISOLATE 0x0C0
|
||||
#define IOCTL_PATA_IOR 0x0C4
|
||||
#define IOCTL_PATA_IOW 0x0C8
|
||||
#define IOCTL_PATA_IOCHRDY 0x0CC
|
||||
#define IOCTL_PATA_INTRQ 0x0D0
|
||||
#define IOCTL_PATA_DRQ 0x0D4
|
||||
#define IOCTL_PATA_DACK 0x0D8
|
||||
#define IOCTL_NFC_WP 0x0DC
|
||||
#define IOCTL_NFC_RB 0x0E0
|
||||
#define IOCTL_NFC_ALE 0x0E4
|
||||
#define IOCTL_NFC_CLE 0x0E8
|
||||
#define IOCTL_NFC_WE 0x0EC
|
||||
#define IOCTL_NFC_RE 0x0F0
|
||||
#define IOCTL_PCI_AD31 0x0F4
|
||||
#define IOCTL_PCI_AD30 0x0F8
|
||||
#define IOCTL_PCI_AD29 0x0FC
|
||||
#define IOCTL_PCI_AD28 0x100
|
||||
#define IOCTL_PCI_AD27 0x104
|
||||
#define IOCTL_PCI_AD26 0x108
|
||||
#define IOCTL_PCI_AD25 0x10C
|
||||
#define IOCTL_PCI_AD24 0x110
|
||||
#define IOCTL_PCI_AD23 0x114
|
||||
#define IOCTL_PCI_AD22 0x118
|
||||
#define IOCTL_PCI_AD21 0x11C
|
||||
#define IOCTL_PCI_AD20 0x120
|
||||
#define IOCTL_PCI_AD19 0x124
|
||||
#define IOCTL_PCI_AD18 0x128
|
||||
#define IOCTL_PCI_AD17 0x12C
|
||||
#define IOCTL_PCI_AD16 0x130
|
||||
#define IOCTL_PCI_AD15 0x134
|
||||
#define IOCTL_PCI_AD14 0x138
|
||||
#define IOCTL_PCI_AD13 0x13C
|
||||
#define IOCTL_PCI_AD12 0x140
|
||||
#define IOCTL_PCI_AD11 0x144
|
||||
#define IOCTL_PCI_AD10 0x148
|
||||
#define IOCTL_PCI_AD09 0x14C
|
||||
#define IOCTL_PCI_AD08 0x150
|
||||
#define IOCTL_PCI_AD07 0x154
|
||||
#define IOCTL_PCI_AD06 0x158
|
||||
#define IOCTL_PCI_AD05 0x15C
|
||||
#define IOCTL_PCI_AD04 0x160
|
||||
#define IOCTL_PCI_AD03 0x164
|
||||
#define IOCTL_PCI_AD02 0x168
|
||||
#define IOCTL_PCI_AD01 0x16C
|
||||
#define IOCTL_PCI_AD00 0x170
|
||||
#define IOCTL_PCI_CBE0 0x174
|
||||
#define IOCTL_PCI_CBE1 0x178
|
||||
#define IOCTL_PCI_CBE2 0x17C
|
||||
#define IOCTL_PCI_CBE3 0x180
|
||||
#define IOCTL_PCI_GNT2 0x184
|
||||
#define IOCTL_PCI_REQ2 0x188
|
||||
#define IOCTL_PCI_GNT1 0x18C
|
||||
#define IOCTL_PCI_REQ1 0x190
|
||||
#define IOCTL_PCI_GNT0 0x194
|
||||
#define IOCTL_PCI_REQ0 0x198
|
||||
#define IOCTL_PCI_INTA 0x19C
|
||||
#define IOCTL_PCI_CLK 0x1A0
|
||||
#define IOCTL_PCI_RST_OUT 0x1A4
|
||||
#define IOCTL_PCI_FRAME 0x1A8
|
||||
#define IOCTL_PCI_IDSEL 0x1AC
|
||||
#define IOCTL_PCI_DEVSEL 0x1B0
|
||||
#define IOCTL_PCI_IRDY 0x1B4
|
||||
#define IOCTL_PCI_TRDY 0x1B8
|
||||
#define IOCTL_PCI_STOP 0x1BC
|
||||
#define IOCTL_PCI_PAR 0x1C0
|
||||
#define IOCTL_PCI_PERR 0x1C4
|
||||
#define IOCTL_PCI_SERR 0x1C8
|
||||
#define IOCTL_SPDIF_TXCLK 0x1CC
|
||||
#define IOCTL_SPDIF_TX 0x1D0
|
||||
#define IOCTL_SPDIF_RX 0x1D4
|
||||
#define IOCTL_I2C0_SCL 0x1D8
|
||||
#define IOCTL_I2C0_SDA 0x1DC
|
||||
#define IOCTL_I2C1_SCL 0x1E0
|
||||
#define IOCTL_I2C1_SDA 0x1E4
|
||||
#define IOCTL_I2C2_SCL 0x1E8
|
||||
#define IOCTL_I2C2_SDA 0x1EC
|
||||
#define IOCTL_IRQ0 0x1F0
|
||||
#define IOCTL_IRQ1 0x1F4
|
||||
#define IOCTL_CAN1_TX 0x1F8
|
||||
#define IOCTL_CAN2_TX 0x1FC
|
||||
#define IOCTL_J1850_TX 0x200
|
||||
#define IOCTL_J1850_RX 0x204
|
||||
#define IOCTL_PSC_MCLK_IN 0x208
|
||||
#define IOCTL_PSC0_0 0x20C
|
||||
#define IOCTL_PSC0_1 0x210
|
||||
#define IOCTL_PSC0_2 0x214
|
||||
#define IOCTL_PSC0_3 0x218
|
||||
#define IOCTL_PSC0_4 0x21C
|
||||
#define IOCTL_PSC1_0 0x220
|
||||
#define IOCTL_PSC1_1 0x224
|
||||
#define IOCTL_PSC1_2 0x228
|
||||
#define IOCTL_PSC1_3 0x22C
|
||||
#define IOCTL_PSC1_4 0x230
|
||||
#define IOCTL_PSC2_0 0x234
|
||||
#define IOCTL_PSC2_1 0x238
|
||||
#define IOCTL_PSC2_2 0x23C
|
||||
#define IOCTL_PSC2_3 0x240
|
||||
#define IOCTL_PSC2_4 0x244
|
||||
#define IOCTL_PSC3_0 0x248
|
||||
#define IOCTL_PSC3_1 0x24C
|
||||
#define IOCTL_PSC3_2 0x250
|
||||
#define IOCTL_PSC3_3 0x254
|
||||
#define IOCTL_PSC3_4 0x258
|
||||
#define IOCTL_PSC4_0 0x25C
|
||||
#define IOCTL_PSC4_1 0x260
|
||||
#define IOCTL_PSC4_2 0x264
|
||||
#define IOCTL_PSC4_3 0x268
|
||||
#define IOCTL_PSC4_4 0x26C
|
||||
#define IOCTL_PSC5_0 0x270
|
||||
#define IOCTL_PSC5_1 0x274
|
||||
#define IOCTL_PSC5_2 0x278
|
||||
#define IOCTL_PSC5_3 0x27C
|
||||
#define IOCTL_PSC5_4 0x280
|
||||
#define IOCTL_PSC6_0 0x284
|
||||
#define IOCTL_PSC6_1 0x288
|
||||
#define IOCTL_PSC6_2 0x28C
|
||||
#define IOCTL_PSC6_3 0x290
|
||||
#define IOCTL_PSC6_4 0x294
|
||||
#define IOCTL_PSC7_0 0x298
|
||||
#define IOCTL_PSC7_1 0x29C
|
||||
#define IOCTL_PSC7_2 0x2A0
|
||||
#define IOCTL_PSC7_3 0x2A4
|
||||
#define IOCTL_PSC7_4 0x2A8
|
||||
#define IOCTL_PSC8_0 0x2AC
|
||||
#define IOCTL_PSC8_1 0x2B0
|
||||
#define IOCTL_PSC8_2 0x2B4
|
||||
#define IOCTL_PSC8_3 0x2B8
|
||||
#define IOCTL_PSC8_4 0x2BC
|
||||
#define IOCTL_PSC9_0 0x2C0
|
||||
#define IOCTL_PSC9_1 0x2C4
|
||||
#define IOCTL_PSC9_2 0x2C8
|
||||
#define IOCTL_PSC9_3 0x2CC
|
||||
#define IOCTL_PSC9_4 0x2D0
|
||||
#define IOCTL_PSC10_0 0x2D4
|
||||
#define IOCTL_PSC10_1 0x2D8
|
||||
#define IOCTL_PSC10_2 0x2DC
|
||||
#define IOCTL_PSC10_3 0x2E0
|
||||
#define IOCTL_PSC10_4 0x2E4
|
||||
#define IOCTL_PSC11_0 0x2E8
|
||||
#define IOCTL_PSC11_1 0x2EC
|
||||
#define IOCTL_PSC11_2 0x2F0
|
||||
#define IOCTL_PSC11_3 0x2F4
|
||||
#define IOCTL_PSC11_4 0x2F8
|
||||
#define IOCTL_HRESET 0x2FC
|
||||
#define IOCTL_SRESET 0x300
|
||||
#define IOCTL_CKSTP_OUT 0x304
|
||||
#define IOCTL_USB2_VBUS_PWR_FAULT 0x308
|
||||
#define IOCTL_USB2_VBUS_PWR_SELECT 0x30C
|
||||
#define IOCTL_USB2_PHY_DRVV_BUS 0x310
|
||||
|
||||
extern void iopin_initialize(void);
|
||||
@@ -1,51 +0,0 @@
|
||||
#
|
||||
# (C) Copyright 2000-2006
|
||||
# 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
|
||||
#
|
||||
|
||||
include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = $(obj)lib$(BOARD).a
|
||||
|
||||
COBJS := adsvix.o pcmcia.o
|
||||
SOBJS := lowlevel_init.o pxavoltage.o
|
||||
|
||||
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||
OBJS := $(addprefix $(obj),$(COBJS))
|
||||
SOBJS := $(addprefix $(obj),$(SOBJS))
|
||||
|
||||
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
|
||||
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(SOBJS) $(OBJS)
|
||||
|
||||
distclean: clean
|
||||
rm -f $(LIB) core *.bak $(obj).depend
|
||||
|
||||
#########################################################################
|
||||
|
||||
# defines $(obj).depend target
|
||||
include $(SRCTREE)/rules.mk
|
||||
|
||||
sinclude $(obj).depend
|
||||
|
||||
#########################################################################
|
||||
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Robert Whaley, Applied Data Systems, Inc. rwhaley@applieddata.net
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Miscelaneous platform dependent initialisations
|
||||
*/
|
||||
|
||||
int board_init (void)
|
||||
{
|
||||
/* memory and cpu-speed are setup before relocation */
|
||||
/* so we do _nothing_ here */
|
||||
|
||||
/* arch number of ADSVIX-Board */
|
||||
gd->bd->bi_arch_number = 620;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = 0xa000003c;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
setenv("stdout", "serial");
|
||||
setenv("stderr", "serial");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int dram_init (void)
|
||||
{
|
||||
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;
|
||||
gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
|
||||
gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
|
||||
gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
|
||||
gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
TEXT_BASE = 0xa1700000
|
||||
@@ -1,466 +0,0 @@
|
||||
/*
|
||||
* This was originally from the Lubbock u-boot port.
|
||||
*
|
||||
* Most of this taken from Redboot hal_platform_setup.h with cleanup
|
||||
*
|
||||
* NOTE: I haven't clean this up considerably, just enough to get it
|
||||
* running. See hal_platform_setup.h for the source. See
|
||||
* board/cradle/lowlevel_init.S for another PXA250 setup that is
|
||||
* much cleaner.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
|
||||
/* wait for coprocessor write complete */
|
||||
.macro CPWAIT reg
|
||||
mrc p15,0,\reg,c2,c0,0
|
||||
mov \reg,\reg
|
||||
sub pc,pc,#4
|
||||
.endm
|
||||
|
||||
|
||||
/*
|
||||
* Memory setup
|
||||
*/
|
||||
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
|
||||
/* Set up GPIO pins first ----------------------------------------- */
|
||||
|
||||
ldr r0, =GPSR0
|
||||
ldr r1, =CFG_GPSR0_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPSR1
|
||||
ldr r1, =CFG_GPSR1_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPSR2
|
||||
ldr r1, =CFG_GPSR2_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPSR3
|
||||
ldr r1, =CFG_GPSR3_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPCR0
|
||||
ldr r1, =CFG_GPCR0_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPCR1
|
||||
ldr r1, =CFG_GPCR1_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPCR2
|
||||
ldr r1, =CFG_GPCR2_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPCR3
|
||||
ldr r1, =CFG_GPCR3_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPDR0
|
||||
ldr r1, =CFG_GPDR0_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPDR1
|
||||
ldr r1, =CFG_GPDR1_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPDR2
|
||||
ldr r1, =CFG_GPDR2_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GPDR3
|
||||
ldr r1, =CFG_GPDR3_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR0_L
|
||||
ldr r1, =CFG_GAFR0_L_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR0_U
|
||||
ldr r1, =CFG_GAFR0_U_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR1_L
|
||||
ldr r1, =CFG_GAFR1_L_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR1_U
|
||||
ldr r1, =CFG_GAFR1_U_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR2_L
|
||||
ldr r1, =CFG_GAFR2_L_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR2_U
|
||||
ldr r1, =CFG_GAFR2_U_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR3_L
|
||||
ldr r1, =CFG_GAFR3_L_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =GAFR3_U
|
||||
ldr r1, =CFG_GAFR3_U_VAL
|
||||
str r1, [r0]
|
||||
|
||||
ldr r0, =PSSR /* enable GPIO pins */
|
||||
ldr r1, =CFG_PSSR_VAL
|
||||
str r1, [r0]
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Enable memory interface */
|
||||
/* */
|
||||
/* The sequence below is based on the recommended init steps */
|
||||
/* detailed in the Intel PXA250 Operating Systems Developers Guide, */
|
||||
/* Chapter 10. */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 1: Wait for at least 200 microsedonds to allow internal */
|
||||
/* clocks to settle. Only necessary after hard reset... */
|
||||
/* FIXME: can be optimized later */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
ldr r3, =OSCR /* reset the OS Timer Count to zero */
|
||||
mov r2, #0
|
||||
str r2, [r3]
|
||||
ldr r4, =0x300 /* really 0x2E1 is about 200usec, */
|
||||
/* so 0x300 should be plenty */
|
||||
1:
|
||||
ldr r2, [r3]
|
||||
cmp r4, r2
|
||||
bgt 1b
|
||||
|
||||
mem_init:
|
||||
|
||||
ldr r1, =MEMC_BASE /* get memory controller base addr. */
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 2a: Initialize Asynchronous static memory controller */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* MSC registers: timing, bus width, mem type */
|
||||
|
||||
/* MSC0: nCS(0,1) */
|
||||
ldr r2, =CFG_MSC0_VAL
|
||||
str r2, [r1, #MSC0_OFFSET]
|
||||
ldr r2, [r1, #MSC0_OFFSET] /* read back to ensure */
|
||||
/* that data latches */
|
||||
/* MSC1: nCS(2,3) */
|
||||
ldr r2, =CFG_MSC1_VAL
|
||||
str r2, [r1, #MSC1_OFFSET]
|
||||
ldr r2, [r1, #MSC1_OFFSET]
|
||||
|
||||
/* MSC2: nCS(4,5) */
|
||||
ldr r2, =CFG_MSC2_VAL
|
||||
str r2, [r1, #MSC2_OFFSET]
|
||||
ldr r2, [r1, #MSC2_OFFSET]
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 2b: Initialize Card Interface */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* MECR: Memory Expansion Card Register */
|
||||
ldr r2, =CFG_MECR_VAL
|
||||
str r2, [r1, #MECR_OFFSET]
|
||||
ldr r2, [r1, #MECR_OFFSET]
|
||||
|
||||
/* MCMEM0: Card Interface slot 0 timing */
|
||||
ldr r2, =CFG_MCMEM0_VAL
|
||||
str r2, [r1, #MCMEM0_OFFSET]
|
||||
ldr r2, [r1, #MCMEM0_OFFSET]
|
||||
|
||||
/* MCMEM1: Card Interface slot 1 timing */
|
||||
ldr r2, =CFG_MCMEM1_VAL
|
||||
str r2, [r1, #MCMEM1_OFFSET]
|
||||
ldr r2, [r1, #MCMEM1_OFFSET]
|
||||
|
||||
/* MCATT0: Card Interface Attribute Space Timing, slot 0 */
|
||||
ldr r2, =CFG_MCATT0_VAL
|
||||
str r2, [r1, #MCATT0_OFFSET]
|
||||
ldr r2, [r1, #MCATT0_OFFSET]
|
||||
|
||||
/* MCATT1: Card Interface Attribute Space Timing, slot 1 */
|
||||
ldr r2, =CFG_MCATT1_VAL
|
||||
str r2, [r1, #MCATT1_OFFSET]
|
||||
ldr r2, [r1, #MCATT1_OFFSET]
|
||||
|
||||
/* MCIO0: Card Interface I/O Space Timing, slot 0 */
|
||||
ldr r2, =CFG_MCIO0_VAL
|
||||
str r2, [r1, #MCIO0_OFFSET]
|
||||
ldr r2, [r1, #MCIO0_OFFSET]
|
||||
|
||||
/* MCIO1: Card Interface I/O Space Timing, slot 1 */
|
||||
ldr r2, =CFG_MCIO1_VAL
|
||||
str r2, [r1, #MCIO1_OFFSET]
|
||||
ldr r2, [r1, #MCIO1_OFFSET]
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 2c: Write FLYCNFG FIXME: what's that??? */
|
||||
/* ---------------------------------------------------------------- */
|
||||
ldr r2, =CFG_FLYCNFG_VAL
|
||||
str r2, [r1, #FLYCNFG_OFFSET]
|
||||
str r2, [r1, #FLYCNFG_OFFSET]
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 2d: Initialize Timing for Sync Memory (SDCLK0) */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Before accessing MDREFR we need a valid DRI field, so we set */
|
||||
/* this to power on defaults + DRI field. */
|
||||
|
||||
ldr r4, [r1, #MDREFR_OFFSET]
|
||||
ldr r2, =0xFFF
|
||||
bic r4, r4, r2
|
||||
|
||||
ldr r3, =CFG_MDREFR_VAL
|
||||
and r3, r3, r2
|
||||
|
||||
orr r4, r4, r3
|
||||
str r4, [r1, #MDREFR_OFFSET] /* write back MDREFR */
|
||||
|
||||
orr r4, r4, #MDREFR_K0RUN
|
||||
orr r4, r4, #MDREFR_K0DB4
|
||||
orr r4, r4, #MDREFR_K0FREE
|
||||
orr r4, r4, #MDREFR_K0DB2
|
||||
orr r4, r4, #MDREFR_K1DB2
|
||||
bic r4, r4, #MDREFR_K1FREE
|
||||
bic r4, r4, #MDREFR_K2FREE
|
||||
|
||||
str r4, [r1, #MDREFR_OFFSET] /* write back MDREFR */
|
||||
ldr r4, [r1, #MDREFR_OFFSET]
|
||||
|
||||
/* Note: preserve the mdrefr value in r4 */
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 3: Initialize Synchronous Static Memory (Flash/Peripherals) */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Initialize SXCNFG register. Assert the enable bits */
|
||||
|
||||
/* Write SXMRS to cause an MRS command to all enabled banks of */
|
||||
/* synchronous static memory. Note that SXLCR need not be written */
|
||||
/* at this time. */
|
||||
|
||||
ldr r2, =CFG_SXCNFG_VAL
|
||||
str r2, [r1, #SXCNFG_OFFSET]
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Step 4: Initialize SDRAM */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
bic r4, r4, #(MDREFR_K2FREE |MDREFR_K1FREE | MDREFR_K0FREE)
|
||||
|
||||
orr r4, r4, #MDREFR_K1RUN
|
||||
bic r4, r4, #MDREFR_K2DB2
|
||||
str r4, [r1, #MDREFR_OFFSET]
|
||||
ldr r4, [r1, #MDREFR_OFFSET]
|
||||
|
||||
bic r4, r4, #MDREFR_SLFRSH
|
||||
str r4, [r1, #MDREFR_OFFSET]
|
||||
ldr r4, [r1, #MDREFR_OFFSET]
|
||||
|
||||
orr r4, r4, #MDREFR_E1PIN
|
||||
str r4, [r1, #MDREFR_OFFSET]
|
||||
ldr r4, [r1, #MDREFR_OFFSET]
|
||||
|
||||
nop
|
||||
nop
|
||||
|
||||
|
||||
/* Step 4d: write MDCNFG with MDCNFG:DEx deasserted (set to 0), to */
|
||||
/* configure but not enable each SDRAM partition pair. */
|
||||
|
||||
ldr r4, =CFG_MDCNFG_VAL
|
||||
bic r4, r4, #(MDCNFG_DE0|MDCNFG_DE1)
|
||||
bic r4, r4, #(MDCNFG_DE2|MDCNFG_DE3)
|
||||
|
||||
str r4, [r1, #MDCNFG_OFFSET] /* write back MDCNFG */
|
||||
ldr r4, [r1, #MDCNFG_OFFSET]
|
||||
|
||||
|
||||
/* Step 4e: Wait for the clock to the SDRAMs to stabilize, */
|
||||
/* 100..200 <20>sec. */
|
||||
|
||||
ldr r3, =OSCR /* reset the OS Timer Count to zero */
|
||||
mov r2, #0
|
||||
str r2, [r3]
|
||||
ldr r4, =0x300 /* really 0x2E1 is about 200usec, */
|
||||
/* so 0x300 should be plenty */
|
||||
1:
|
||||
ldr r2, [r3]
|
||||
cmp r4, r2
|
||||
bgt 1b
|
||||
|
||||
|
||||
/* Step 4f: Trigger a number (usually 8) refresh cycles by */
|
||||
/* attempting non-burst read or write accesses to disabled */
|
||||
/* SDRAM, as commonly specified in the power up sequence */
|
||||
/* documented in SDRAM data sheets. The address(es) used */
|
||||
/* for this purpose must not be cacheable. */
|
||||
|
||||
ldr r3, =CFG_DRAM_BASE
|
||||
str r2, [r3]
|
||||
str r2, [r3]
|
||||
str r2, [r3]
|
||||
str r2, [r3]
|
||||
str r2, [r3]
|
||||
str r2, [r3]
|
||||
str r2, [r3]
|
||||
str r2, [r3]
|
||||
|
||||
|
||||
/* Step 4g: Write MDCNFG with enable bits asserted */
|
||||
/* (MDCNFG:DEx set to 1). */
|
||||
|
||||
ldr r3, [r1, #MDCNFG_OFFSET]
|
||||
mov r4, r3
|
||||
orr r3, r3, #MDCNFG_DE0
|
||||
str r3, [r1, #MDCNFG_OFFSET]
|
||||
mov r0, r3
|
||||
|
||||
/* Step 4h: Write MDMRS. */
|
||||
|
||||
ldr r2, =CFG_MDMRS_VAL
|
||||
str r2, [r1, #MDMRS_OFFSET]
|
||||
|
||||
/* enable APD */
|
||||
ldr r3, [r1, #MDREFR_OFFSET]
|
||||
orr r3, r3, #MDREFR_APD
|
||||
str r3, [r1, #MDREFR_OFFSET]
|
||||
|
||||
/* We are finished with Intel's memory controller initialisation */
|
||||
|
||||
setvoltage:
|
||||
|
||||
mov r10, lr
|
||||
bl initPXAvoltage /* In case the board is rebooting with a */
|
||||
mov lr, r10 /* low voltage raise it up to a good one. */
|
||||
|
||||
wakeup:
|
||||
/* Are we waking from sleep? */
|
||||
ldr r0, =RCSR
|
||||
ldr r1, [r0]
|
||||
and r1, r1, #(RCSR_GPR | RCSR_SMR | RCSR_WDR | RCSR_HWR)
|
||||
str r1, [r0]
|
||||
teq r1, #RCSR_SMR
|
||||
|
||||
bne initirqs
|
||||
|
||||
ldr r0, =PSSR
|
||||
mov r1, #PSSR_PH
|
||||
str r1, [r0]
|
||||
|
||||
/* if so, resume at PSPR */
|
||||
ldr r0, =PSPR
|
||||
ldr r1, [r0]
|
||||
mov pc, r1
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Disable (mask) all interrupts at interrupt controller */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
initirqs:
|
||||
|
||||
mov r1, #0 /* clear int. level register (IRQ, not FIQ) */
|
||||
ldr r2, =ICLR
|
||||
str r1, [r2]
|
||||
|
||||
ldr r2, =ICMR /* mask all interrupts at the controller */
|
||||
str r1, [r2]
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Clock initialisation */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
initclks:
|
||||
|
||||
/* Disable the peripheral clocks, and set the core clock frequency */
|
||||
|
||||
/* Turn Off on-chip peripheral clocks (except for memory) */
|
||||
/* for re-configuration. */
|
||||
ldr r1, =CKEN
|
||||
ldr r2, =CFG_CKEN
|
||||
str r2, [r1]
|
||||
|
||||
/* ... and write the core clock config register */
|
||||
ldr r2, =CFG_CCCR
|
||||
ldr r1, =CCCR
|
||||
str r2, [r1]
|
||||
|
||||
/* Turn on turbo mode */
|
||||
mrc p14, 0, r2, c6, c0, 0
|
||||
orr r2, r2, #0xB /* Turbo, Fast-Bus, Freq change**/
|
||||
mcr p14, 0, r2, c6, c0, 0
|
||||
|
||||
/* Re-write MDREFR */
|
||||
ldr r1, =MEMC_BASE
|
||||
ldr r2, [r1, #MDREFR_OFFSET]
|
||||
str r2, [r1, #MDREFR_OFFSET]
|
||||
#ifdef RTC
|
||||
/* enable the 32Khz oscillator for RTC and PowerManager */
|
||||
ldr r1, =OSCC
|
||||
mov r2, #OSCC_OON
|
||||
str r2, [r1]
|
||||
|
||||
/* NOTE: spin here until OSCC.OOK get set, meaning the PLL */
|
||||
/* has settled. */
|
||||
60:
|
||||
ldr r2, [r1]
|
||||
ands r2, r2, #1
|
||||
beq 60b
|
||||
#else
|
||||
#error "RTC not defined"
|
||||
#endif
|
||||
|
||||
/* Interrupt init: Mask all interrupts */
|
||||
ldr r0, =ICMR /* enable no sources */
|
||||
mov r1, #0
|
||||
str r1, [r0]
|
||||
/* FIXME */
|
||||
|
||||
#ifdef NODEBUG
|
||||
/*Disable software and data breakpoints */
|
||||
mov r0,#0
|
||||
mcr p15,0,r0,c14,c8,0 /* ibcr0 */
|
||||
mcr p15,0,r0,c14,c9,0 /* ibcr1 */
|
||||
mcr p15,0,r0,c14,c4,0 /* dbcon */
|
||||
|
||||
/*Enable all debug functionality */
|
||||
mov r0,#0x80000000
|
||||
mcr p14,0,r0,c10,c0,0 /* dcsr */
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* End lowlevel_init */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
endlowlevel_init:
|
||||
|
||||
mov pc, lr
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Robert Whaley, Applied Data Systems, Inc. rwhaley@applieddata.net
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
|
||||
void pcmcia_power_on(void)
|
||||
{
|
||||
#if 0
|
||||
if (!(GPLR(20) & GPIO_bit(20))) { /* 3.3V */
|
||||
GPCR(81) = GPIO_bit(81);
|
||||
GPSR(82) = GPIO_bit(82);
|
||||
}
|
||||
else if (!(GPLR(21) & GPIO_bit(21))) { /* 5.0V */
|
||||
GPCR(81) = GPIO_bit(81);
|
||||
GPCR(82) = GPIO_bit(82);
|
||||
}
|
||||
#else
|
||||
#warning "Board will only supply 5V, wait for next HW spin for selectable power"
|
||||
/* 5.0V */
|
||||
GPCR(81) = GPIO_bit(81);
|
||||
GPCR(82) = GPIO_bit(82);
|
||||
#endif
|
||||
|
||||
udelay(300000);
|
||||
|
||||
/* reset the card */
|
||||
GPSR(52) = GPIO_bit(52);
|
||||
|
||||
/* enable PCMCIA */
|
||||
GPCR(83) = GPIO_bit(83);
|
||||
|
||||
/* clear reset */
|
||||
udelay(10);
|
||||
GPCR(52) = GPIO_bit(52);
|
||||
|
||||
udelay(20000);
|
||||
}
|
||||
|
||||
void pcmcia_power_off(void)
|
||||
{
|
||||
/* 0V */
|
||||
GPSR(81) = GPIO_bit(81);
|
||||
GPSR(82) = GPIO_bit(82);
|
||||
/* disable PCMCIA */
|
||||
GPSR(83) = GPIO_bit(83);
|
||||
}
|
||||
@@ -1,230 +0,0 @@
|
||||
/*
|
||||
* (C) Copyright 2004
|
||||
* Robert Whaley, Applied Data Systems, Inc. rwhaley@applieddata.net
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
|
||||
#define LTC1663_ADDR 0x20
|
||||
|
||||
#define LTC1663_SY 0x01 /* Sync ACK */
|
||||
#define LTC1663_SD 0x04 /* shutdown */
|
||||
#define LTC1663_BG 0x04 /* Internal Voltage Ref */
|
||||
|
||||
#define VOLT_1_55 18 /* DAC value for 1.55V */
|
||||
|
||||
.global initPXAvoltage
|
||||
|
||||
@ Set the voltage to 1.55V early in the boot process so we can run
|
||||
@ at a high clock speed and boot quickly. Note that this is necessary
|
||||
@ because the reset button does not reset the CPU voltage, so if the
|
||||
@ voltage was low (say 0.85V) then the CPU would crash without this
|
||||
@ routine
|
||||
|
||||
@ This routine clobbers r0-r4
|
||||
|
||||
initializei2c:
|
||||
|
||||
ldr r2, =CKEN
|
||||
ldr r3, [r2]
|
||||
orr r3, r3, #CKEN15_PWRI2C
|
||||
str r3, [r2]
|
||||
|
||||
ldr r2, =PCFR
|
||||
ldr r3, [r2]
|
||||
orr r3, r3, #PCFR_PI2C_EN
|
||||
str r3, [r2]
|
||||
|
||||
/* delay for about 250msec
|
||||
*/
|
||||
ldr r3, =OSCR
|
||||
mov r2, #0
|
||||
str r2, [r3]
|
||||
ldr r1, =0xC0000
|
||||
|
||||
1:
|
||||
ldr r2, [r3]
|
||||
cmp r1, r2
|
||||
bgt 1b
|
||||
ldr r0, =PWRICR
|
||||
ldr r1, [r0]
|
||||
bic r1, r1, #(ICR_MA | ICR_START | ICR_STOP)
|
||||
str r1, [r0]
|
||||
|
||||
orr r1, r1, #ICR_UR
|
||||
str r1, [r0]
|
||||
|
||||
ldr r2, =PWRISR
|
||||
ldr r3, =0x7ff
|
||||
str r3, [r2]
|
||||
|
||||
bic r1, r1, #ICR_UR
|
||||
str r1, [r0]
|
||||
|
||||
mov r1, #(ICR_GCD | ICR_SCLE)
|
||||
str r1, [r0]
|
||||
|
||||
orr r1, r1, #ICR_IUE
|
||||
str r1, [r0]
|
||||
|
||||
orr r1, r1, #ICR_FM
|
||||
str r1, [r0]
|
||||
|
||||
/* delay for about 1msec
|
||||
*/
|
||||
ldr r3, =OSCR
|
||||
mov r2, #0
|
||||
str r2, [r3]
|
||||
ldr r1, =0xC00
|
||||
|
||||
1:
|
||||
ldr r2, [r3]
|
||||
cmp r1, r2
|
||||
bgt 1b
|
||||
mov pc, lr
|
||||
|
||||
sendbytei2c:
|
||||
ldr r3, =PWRIDBR
|
||||
str r0, [r3]
|
||||
ldr r3, =PWRICR
|
||||
ldr r0, [r3]
|
||||
orr r0, r0, r1
|
||||
bic r0, r0, r2
|
||||
str r0, [r3]
|
||||
orr r0, r0, #ICR_TB
|
||||
str r0, [r3]
|
||||
|
||||
mov r2, #0x100000
|
||||
|
||||
waitfortxemptyi2c:
|
||||
|
||||
ldr r0, =PWRISR
|
||||
ldr r1, [r0]
|
||||
|
||||
/* take it from the top if we don't get empty after a while */
|
||||
subs r2, r2, #1
|
||||
moveq lr, r4
|
||||
beq initPXAvoltage
|
||||
|
||||
tst r1, #ISR_ITE
|
||||
|
||||
beq waitfortxemptyi2c
|
||||
|
||||
orr r1, r1, #ISR_ITE
|
||||
str r1, [r0]
|
||||
|
||||
mov pc, lr
|
||||
|
||||
initPXAvoltage:
|
||||
|
||||
mov r4, lr
|
||||
|
||||
bl setleds
|
||||
|
||||
bl initializei2c
|
||||
|
||||
bl setleds
|
||||
|
||||
/* now send the real message to set the correct voltage */
|
||||
ldr r0, =LTC1663_ADDR
|
||||
mov r0, r0, LSL #1
|
||||
mov r1, #ICR_START
|
||||
ldr r2, =(ICR_STOP | ICR_ALDIE | ICR_ACKNAK)
|
||||
bl sendbytei2c
|
||||
|
||||
bl setleds
|
||||
|
||||
mov r0, #LTC1663_BG
|
||||
mov r1, #0
|
||||
mov r2, #(ICR_STOP | ICR_START)
|
||||
bl sendbytei2c
|
||||
|
||||
bl setleds
|
||||
|
||||
ldr r0, =VOLT_1_55
|
||||
and r0, r0, #0xff
|
||||
mov r1, #0
|
||||
mov r2, #(ICR_STOP | ICR_START)
|
||||
bl sendbytei2c
|
||||
|
||||
bl setleds
|
||||
|
||||
ldr r0, =VOLT_1_55
|
||||
mov r0, r0, ASR #8
|
||||
and r0, r0, #0xff
|
||||
mov r1, #ICR_STOP
|
||||
mov r2, #ICR_START
|
||||
bl sendbytei2c
|
||||
|
||||
bl setleds
|
||||
|
||||
@ delay a little for the volatage to stablize
|
||||
ldr r3, =OSCR
|
||||
mov r2, #0
|
||||
str r2, [r3]
|
||||
ldr r1, =0xC0
|
||||
|
||||
1:
|
||||
ldr r2, [r3]
|
||||
cmp r1, r2
|
||||
bgt 1b
|
||||
mov pc, r4
|
||||
|
||||
setleds:
|
||||
mov pc, lr
|
||||
|
||||
ldr r5, =0x40e00058
|
||||
ldr r3, [r5]
|
||||
bic r3, r3, #0x3
|
||||
str r3, [r5]
|
||||
ldr r5, =0x40e0000c
|
||||
ldr r3, [r5]
|
||||
orr r3, r3, #0x00010000
|
||||
str r3, [r5]
|
||||
|
||||
@ inner loop
|
||||
mov r0, #0x2
|
||||
1:
|
||||
|
||||
ldr r5, =0x40e00018
|
||||
mov r3, #0x00010000
|
||||
str r3, [r5]
|
||||
|
||||
@ outer loop
|
||||
mov r3, #0x00F00000
|
||||
2:
|
||||
subs r3, r3, #1
|
||||
bne 2b
|
||||
|
||||
ldr r5, =0x40e00024
|
||||
mov r3, #0x00010000
|
||||
str r3, [r5]
|
||||
|
||||
@ outer loop
|
||||
mov r3, #0x00F00000
|
||||
3:
|
||||
subs r3, r3, #1
|
||||
bne 3b
|
||||
|
||||
subs r0, r0, #1
|
||||
bne 1b
|
||||
|
||||
mov pc, lr
|
||||
@@ -93,6 +93,11 @@ int board_early_init_f(void)
|
||||
#ifdef CONFIG_I2C_MULTI_BUS
|
||||
sdr0_pfc1 |= ((sdr0_pfc1 & ~SDR0_PFC1_SIS_MASK) | SDR0_PFC1_SIS_IIC1_SEL);
|
||||
#endif
|
||||
/* Two UARTs, so we need 4-pin mode. Also, we want CTS/RTS mode. */
|
||||
sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_U0IM_MASK) | SDR0_PFC1_U0IM_4PINS;
|
||||
sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_U0ME_MASK) | SDR0_PFC1_U0ME_CTS_RTS;
|
||||
sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_U1ME_MASK) | SDR0_PFC1_U1ME_CTS_RTS;
|
||||
|
||||
mfsdr(SDR0_PFC2, sdr0_pfc2);
|
||||
sdr0_pfc2 = (sdr0_pfc2 & ~SDR0_PFC2_SELECT_MASK) |
|
||||
SDR0_PFC2_SELECT_CONFIG_4;
|
||||
|
||||
@@ -81,7 +81,7 @@ phys_size_t initdram(int board_type)
|
||||
unmap_physmem(sdram_base, EBI_SDRAM_SIZE);
|
||||
|
||||
if (expected_size != actual_size)
|
||||
printf("Warning: Only %u of %u MiB SDRAM is working\n",
|
||||
printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
|
||||
actual_size >> 20, expected_size >> 20);
|
||||
|
||||
return actual_size;
|
||||
|
||||
@@ -104,7 +104,7 @@ phys_size_t initdram(int board_type)
|
||||
unmap_physmem(sdram_base, EBI_SDRAM_SIZE);
|
||||
|
||||
if (expected_size != actual_size)
|
||||
printf("Warning: Only %u of %u MiB SDRAM is working\n",
|
||||
printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
|
||||
actual_size >> 20, expected_size >> 20);
|
||||
|
||||
return actual_size;
|
||||
|
||||
@@ -70,7 +70,7 @@ unsigned long flash_init(void)
|
||||
|
||||
void flash_print_info(flash_info_t *info)
|
||||
{
|
||||
printf("Flash: Vendor ID: 0x%02x, Product ID: 0x%02x\n",
|
||||
printf("Flash: Vendor ID: 0x%02lx, Product ID: 0x%02lx\n",
|
||||
info->flash_id >> 16, info->flash_id & 0xffff);
|
||||
printf("Size: %ld MB in %d sectors\n",
|
||||
info->size >> 10, info->sector_count);
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#ifdef __PPC__
|
||||
#include <ppc4xx.h>
|
||||
#endif
|
||||
#include <asm/processor.h>
|
||||
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
||||
|
||||
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB = $(obj)lib$(BOARD).a
|
||||
|
||||
OBJS = $(BOARD).o mii.o
|
||||
COBJS = $(BOARD).o mii.o
|
||||
|
||||
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||
OBJS := $(addprefix $(obj),$(COBJS))
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
* (C) Copyright 2002,2003, Motorola,Inc.
|
||||
* Xianghua Xiao, X.Xiao@motorola.com.
|
||||
*
|
||||
* Copyright 2008 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
@@ -24,18 +26,14 @@
|
||||
OUTPUT_ARCH(powerpc)
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD;
|
||||
bss PT_LOAD;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
.bootpg 0xFFFFF000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
@@ -62,21 +60,10 @@ SECTIONS
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.text)
|
||||
cpu/mpc85xx/traps.o (.text)
|
||||
cpu/mpc85xx/interrupts.o (.text)
|
||||
cpu/mpc85xx/cpu_init.o (.text)
|
||||
cpu/mpc85xx/cpu.o (.text)
|
||||
cpu/mpc85xx/speed.o (.text)
|
||||
cpu/mpc85xx/pci.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
} :text
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
@@ -85,7 +72,7 @@ SECTIONS
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
*(.eh_frame)
|
||||
}
|
||||
} :text
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
@@ -134,6 +121,18 @@ SECTIONS
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
.bootpg ADDR(.text) + 0x7f000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} :text = 0xffff
|
||||
|
||||
.resetvec ADDR(.text) + 0x7fffc :
|
||||
{
|
||||
*(.resetvec)
|
||||
} :text = 0xffff
|
||||
|
||||
. = ADDR(.text) + 0x80000;
|
||||
|
||||
__bss_start = .;
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
@@ -141,7 +140,9 @@ SECTIONS
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
} :bss
|
||||
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
* Copyright 2004, 2008 Freescale Semiconductor.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
@@ -23,18 +23,14 @@
|
||||
OUTPUT_ARCH(powerpc)
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD;
|
||||
bss PT_LOAD;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
.bootpg 0xFFFFF000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
@@ -61,22 +57,10 @@ SECTIONS
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.text)
|
||||
cpu/mpc85xx/traps.o (.text)
|
||||
cpu/mpc85xx/interrupts.o (.text)
|
||||
cpu/mpc85xx/cpu_init.o (.text)
|
||||
cpu/mpc85xx/cpu.o (.text)
|
||||
drivers/net/tsec.o (.text)
|
||||
cpu/mpc85xx/speed.o (.text)
|
||||
cpu/mpc85xx/pci.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
} :text
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
@@ -85,7 +69,7 @@ SECTIONS
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
*(.eh_frame)
|
||||
}
|
||||
} :text
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
@@ -134,6 +118,18 @@ SECTIONS
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
.bootpg ADDR(.text) + 0x7f000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} :text = 0xffff
|
||||
|
||||
.resetvec ADDR(.text) + 0x7fffc :
|
||||
{
|
||||
*(.resetvec)
|
||||
} :text = 0xffff
|
||||
|
||||
. = ADDR(.text) + 0x80000;
|
||||
|
||||
__bss_start = .;
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
@@ -141,7 +137,9 @@ SECTIONS
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
} :bss
|
||||
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2007 Freescale Semiconductor, Inc.
|
||||
* Copyright 2007-2008 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
@@ -23,18 +23,14 @@
|
||||
OUTPUT_ARCH(powerpc)
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD;
|
||||
bss PT_LOAD;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
.bootpg 0xFFFFF000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
@@ -61,21 +57,10 @@ SECTIONS
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.text)
|
||||
cpu/mpc85xx/traps.o (.text)
|
||||
cpu/mpc85xx/interrupts.o (.text)
|
||||
cpu/mpc85xx/cpu_init.o (.text)
|
||||
cpu/mpc85xx/cpu.o (.text)
|
||||
cpu/mpc85xx/speed.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
drivers/bios_emulator/atibios.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
} :text
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
@@ -84,7 +69,7 @@ SECTIONS
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
*(.eh_frame)
|
||||
}
|
||||
} :text
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
@@ -133,6 +118,18 @@ SECTIONS
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
.bootpg ADDR(.text) + 0x7f000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} :text = 0xffff
|
||||
|
||||
.resetvec ADDR(.text) + 0x7fffc :
|
||||
{
|
||||
*(.resetvec)
|
||||
} :text = 0xffff
|
||||
|
||||
. = ADDR(.text) + 0x80000;
|
||||
|
||||
__bss_start = .;
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
@@ -140,7 +137,9 @@ SECTIONS
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
} :bss
|
||||
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004, 2007 Freescale Semiconductor.
|
||||
* Copyright 2004, 2007-2008 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
@@ -23,18 +23,14 @@
|
||||
OUTPUT_ARCH(powerpc)
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD;
|
||||
bss PT_LOAD;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
.bootpg 0xFFFFF000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
@@ -61,21 +57,10 @@ SECTIONS
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.text)
|
||||
cpu/mpc85xx/traps.o (.text)
|
||||
cpu/mpc85xx/interrupts.o (.text)
|
||||
cpu/mpc85xx/cpu_init.o (.text)
|
||||
cpu/mpc85xx/cpu.o (.text)
|
||||
drivers/net/tsec.o (.text)
|
||||
cpu/mpc85xx/speed.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
} :text
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
@@ -84,7 +69,7 @@ SECTIONS
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
*(.eh_frame)
|
||||
}
|
||||
} :text
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
@@ -133,6 +118,18 @@ SECTIONS
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
.bootpg ADDR(.text) + 0x7f000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} :text = 0xffff
|
||||
|
||||
.resetvec ADDR(.text) + 0x7fffc :
|
||||
{
|
||||
*(.resetvec)
|
||||
} :text = 0xffff
|
||||
|
||||
. = ADDR(.text) + 0x80000;
|
||||
|
||||
__bss_start = .;
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
@@ -140,7 +137,9 @@ SECTIONS
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
} :bss
|
||||
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004 Freescale Semiconductor.
|
||||
* Copyright 2004, 2008 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
@@ -23,18 +23,14 @@
|
||||
OUTPUT_ARCH(powerpc)
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD;
|
||||
bss PT_LOAD;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
.bootpg 0xFFFFF000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
@@ -61,22 +57,10 @@ SECTIONS
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.text)
|
||||
cpu/mpc85xx/traps.o (.text)
|
||||
cpu/mpc85xx/interrupts.o (.text)
|
||||
cpu/mpc85xx/cpu_init.o (.text)
|
||||
cpu/mpc85xx/cpu.o (.text)
|
||||
drivers/net/tsec.o (.text)
|
||||
cpu/mpc85xx/speed.o (.text)
|
||||
cpu/mpc85xx/pci.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
} :text
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
@@ -85,7 +69,7 @@ SECTIONS
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
*(.eh_frame)
|
||||
}
|
||||
} :text
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
@@ -134,6 +118,18 @@ SECTIONS
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
.bootpg ADDR(.text) + 0x7f000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} :text = 0xffff
|
||||
|
||||
.resetvec ADDR(.text) + 0x7fffc :
|
||||
{
|
||||
*(.resetvec)
|
||||
} :text = 0xffff
|
||||
|
||||
. = ADDR(.text) + 0x80000;
|
||||
|
||||
__bss_start = .;
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
@@ -141,7 +137,9 @@ SECTIONS
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
} :bss
|
||||
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* (C) Copyright 2002,2003,Motorola,Inc.
|
||||
* (C) Copyright 2002,2003, Motorola,Inc.
|
||||
* Xianghua Xiao, X.Xiao@motorola.com.
|
||||
*
|
||||
* Copyright 2008 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
@@ -24,18 +26,14 @@
|
||||
OUTPUT_ARCH(powerpc)
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD;
|
||||
bss PT_LOAD;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
.bootpg 0xFFFFF000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
@@ -62,24 +60,10 @@ SECTIONS
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.text)
|
||||
cpu/mpc85xx/commproc.o (.text)
|
||||
cpu/mpc85xx/traps.o (.text)
|
||||
cpu/mpc85xx/interrupts.o (.text)
|
||||
cpu/mpc85xx/serial_scc.o (.text)
|
||||
cpu/mpc85xx/ether_fcc.o (.text)
|
||||
cpu/mpc85xx/cpu_init.o (.text)
|
||||
cpu/mpc85xx/cpu.o (.text)
|
||||
cpu/mpc85xx/speed.o (.text)
|
||||
cpu/mpc85xx/spd_sdram.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
} :text
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
@@ -88,7 +72,7 @@ SECTIONS
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
*(.eh_frame)
|
||||
}
|
||||
} :text
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
@@ -137,6 +121,18 @@ SECTIONS
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
.bootpg ADDR(.text) + 0x7f000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} :text = 0xffff
|
||||
|
||||
.resetvec ADDR(.text) + 0x7fffc :
|
||||
{
|
||||
*(.resetvec)
|
||||
} :text = 0xffff
|
||||
|
||||
. = ADDR(.text) + 0x80000;
|
||||
|
||||
__bss_start = .;
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
@@ -144,7 +140,9 @@ SECTIONS
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
} :bss
|
||||
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2007 Freescale Semiconductor.
|
||||
* Copyright 2004-2008 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
@@ -23,21 +23,14 @@
|
||||
OUTPUT_ARCH(powerpc)
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD;
|
||||
bss PT_LOAD;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* ELIOR - From RAM: From FLASH: 0xFFFFFFFC*/
|
||||
.resetvec 0xFFFFFFFC:
|
||||
{
|
||||
*(.resetvec)
|
||||
} = 0xffff
|
||||
|
||||
/*(ELIOR - From RAM: From FLASH: 0xFFFFF000*/
|
||||
.bootpg 0xFFFFF000:
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} = 0xffff
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
@@ -64,21 +57,10 @@ SECTIONS
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.text)
|
||||
cpu/mpc85xx/traps.o (.text)
|
||||
cpu/mpc85xx/interrupts.o (.text)
|
||||
cpu/mpc85xx/cpu_init.o (.text)
|
||||
cpu/mpc85xx/cpu.o (.text)
|
||||
cpu/mpc85xx/speed.o (.text)
|
||||
cpu/mpc85xx/pci.o (.text)
|
||||
common/dlmalloc.o (.text)
|
||||
lib_generic/crc32.o (.text)
|
||||
lib_ppc/extable.o (.text)
|
||||
lib_generic/zlib.o (.text)
|
||||
*(.text)
|
||||
*(.fixup)
|
||||
*(.got1)
|
||||
}
|
||||
} :text
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
@@ -87,7 +69,7 @@ SECTIONS
|
||||
*(.rodata1)
|
||||
*(.rodata.str1.4)
|
||||
*(.eh_frame)
|
||||
}
|
||||
} :text
|
||||
.fini : { *(.fini) } =0
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
@@ -136,6 +118,18 @@ SECTIONS
|
||||
. = ALIGN(256);
|
||||
__init_end = .;
|
||||
|
||||
.bootpg ADDR(.text) + 0x7f000 :
|
||||
{
|
||||
cpu/mpc85xx/start.o (.bootpg)
|
||||
} :text = 0xffff
|
||||
|
||||
.resetvec ADDR(.text) + 0x7fffc :
|
||||
{
|
||||
*(.resetvec)
|
||||
} :text = 0xffff
|
||||
|
||||
. = ADDR(.text) + 0x80000;
|
||||
|
||||
__bss_start = .;
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
@@ -143,7 +137,9 @@ SECTIONS
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
} :bss
|
||||
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ int mii_discover_phy(struct eth_device *dev)
|
||||
}
|
||||
#endif /* CFG_DISCOVER_PHY */
|
||||
|
||||
int mii_init(void) __attribute__((weak,alias("__mii_init")));
|
||||
void mii_init(void) __attribute__((weak,alias("__mii_init")));
|
||||
|
||||
void __mii_init(void)
|
||||
{
|
||||
|
||||
@@ -321,7 +321,7 @@ nand_init (void)
|
||||
printf ("%4lu MB\n", totlen >>20);
|
||||
}
|
||||
|
||||
#endif /* CFG_CMD_NAND */
|
||||
#endif /* CONFIG_CMD_NAND */
|
||||
|
||||
#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
|
||||
/*
|
||||
|
||||
@@ -50,16 +50,16 @@ int board_init (void)
|
||||
mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX);
|
||||
mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX);
|
||||
mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
|
||||
mx31_gpio_mux(MUX_RTS1__UART1_CTS_B);
|
||||
mx31_gpio_mux(MUX_CTS1__UART1_CTS_B);
|
||||
|
||||
/* SPI2 */
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS2);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SCLK);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SPI_RDY);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_MOSI);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_MISO);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS0);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS1);
|
||||
mx31_gpio_mux(MUX_CSPI2_SS2__CSPI2_SS2_B);
|
||||
mx31_gpio_mux(MUX_CSPI2_SCLK__CSPI2_CLK);
|
||||
mx31_gpio_mux(MUX_CSPI2_SPI_RDY__CSPI2_DATAREADY_B);
|
||||
mx31_gpio_mux(MUX_CSPI2_MOSI__CSPI2_MOSI);
|
||||
mx31_gpio_mux(MUX_CSPI2_MISO__CSPI2_MISO);
|
||||
mx31_gpio_mux(MUX_CSPI2_SS0__CSPI2_SS0_B);
|
||||
mx31_gpio_mux(MUX_CSPI2_SS1__CSPI2_SS1_B);
|
||||
|
||||
/* start SPI2 clock */
|
||||
__REG(CCM_CGR2) = __REG(CCM_CGR2) | (3 << 4);
|
||||
|
||||
@@ -54,11 +54,11 @@ int board_init (void)
|
||||
mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX);
|
||||
mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX);
|
||||
mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
|
||||
mx31_gpio_mux(MUX_RTS1__UART1_CTS_B);
|
||||
mx31_gpio_mux(MUX_CTS1__UART1_CTS_B);
|
||||
|
||||
/* setup pins for I2C2 (for EEPROM, RTC) */
|
||||
mx31_gpio_mux(MUX_CSPI2_MOSI__I2C2_SCL);
|
||||
mx31_gpio_mux(MUX_CSPI2_MISO__I2C2_SCL);
|
||||
mx31_gpio_mux(MUX_CSPI2_MISO__I2C2_SDA);
|
||||
|
||||
gd->bd->bi_arch_number = 447; /* board id for linux */
|
||||
gd->bd->bi_boot_params = (0x80000100); /* adress of boot parameters */
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <malloc.h>
|
||||
#include <pci.h>
|
||||
#include <i2c.h>
|
||||
#include <fpga.h>
|
||||
#include <environment.h>
|
||||
#include <fdt_support.h>
|
||||
#include <asm/io.h>
|
||||
@@ -109,7 +110,7 @@ void mvbc_init_gpio(void)
|
||||
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
|
||||
|
||||
printf("Ports : 0x%08x\n", gpio->port_config);
|
||||
printf("PORCFG: 0x%08x\n", *(vu_long*)MPC5XXX_CDM_PORCFG);
|
||||
printf("PORCFG: 0x%08lx\n", *(vu_long*)MPC5XXX_CDM_PORCFG);
|
||||
|
||||
out_be32(&gpio->simple_ddr, SIMPLE_DDR);
|
||||
out_be32(&gpio->simple_dvo, SIMPLE_DVO);
|
||||
|
||||
@@ -55,16 +55,16 @@ int board_init (void)
|
||||
mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX);
|
||||
mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX);
|
||||
mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
|
||||
mx31_gpio_mux(MUX_RTS1__UART1_CTS_B);
|
||||
mx31_gpio_mux(MUX_CTS1__UART1_CTS_B);
|
||||
|
||||
/* SPI2 */
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS2);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SCLK);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SPI_RDY);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_MOSI);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_MISO);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS0);
|
||||
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS1);
|
||||
mx31_gpio_mux(MUX_CSPI2_SS2__CSPI2_SS2_B);
|
||||
mx31_gpio_mux(MUX_CSPI2_SCLK__CSPI2_CLK);
|
||||
mx31_gpio_mux(MUX_CSPI2_SPI_RDY__CSPI2_DATAREADY_B);
|
||||
mx31_gpio_mux(MUX_CSPI2_MOSI__CSPI2_MOSI);
|
||||
mx31_gpio_mux(MUX_CSPI2_MISO__CSPI2_MISO);
|
||||
mx31_gpio_mux(MUX_CSPI2_SS0__CSPI2_SS0_B);
|
||||
mx31_gpio_mux(MUX_CSPI2_SS1__CSPI2_SS1_B);
|
||||
|
||||
/* start SPI2 clock */
|
||||
__REG(CCM_CGR2) = __REG(CCM_CGR2) | (3 << 4);
|
||||
|
||||
@@ -464,7 +464,8 @@ void local_bus_init (void)
|
||||
|
||||
if (lbc_mhz < 66) {
|
||||
lbc->lcrr = CFG_LBC_LCRR | LCRR_DBYP; /* DLL Bypass */
|
||||
lbc->ltedr = 0xa4c80000; /* DK: !!! */
|
||||
lbc->ltedr = LTEDR_BMD | LTEDR_PARD | LTEDR_WPD | LTEDR_WARA |
|
||||
LTEDR_RAWA | LTEDR_CSD; /* Disable all error checking */
|
||||
|
||||
} else if (lbc_mhz >= 133) {
|
||||
lbc->lcrr = CFG_LBC_LCRR & (~LCRR_DBYP); /* DLL Enabled */
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
#include "errors.h"
|
||||
#include "dtt.h"
|
||||
|
||||
/* for LM75 DTT POST test */
|
||||
#define DTT_READ_TEMP 0x0
|
||||
#define DTT_CONFIG 0x1
|
||||
#define DTT_TEMP_HYST 0x2
|
||||
#define DTT_TEMP_SET 0x3
|
||||
|
||||
#if defined(CONFIG_RTC_M48T35A)
|
||||
void rtctest(void)
|
||||
{
|
||||
|
||||
@@ -205,7 +205,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
puts ("\nip_addr = ");
|
||||
print_IPaddr (bd->bi_ip_addr);
|
||||
#endif
|
||||
printf ("\nbaudrate = %d bps\n", (ulong)bd->bi_baudrate);
|
||||
printf ("\nbaudrate = %ld bps\n", (ulong)bd->bi_baudrate);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <lmb.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_USB)
|
||||
#if defined(CONFIG_CMD_USB)
|
||||
#include <usb.h>
|
||||
#endif
|
||||
|
||||
@@ -138,7 +138,6 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
memset ((void *)&images, 0, sizeof (images));
|
||||
images.verify = getenv_yesno ("verify");
|
||||
images.autostart = getenv_yesno ("autostart");
|
||||
images.lmb = &lmb;
|
||||
|
||||
lmb_init(&lmb);
|
||||
@@ -217,7 +216,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
*/
|
||||
iflag = disable_interrupts();
|
||||
|
||||
#if (CONFIG_COMMANDS & CFG_CMD_USB)
|
||||
#if defined(CONFIG_CMD_USB)
|
||||
/*
|
||||
* turn off USB to prevent the host controller from writing to the
|
||||
* SDRAM while Linux is booting. This could happen (at least for OHCI
|
||||
@@ -251,10 +250,9 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
memmove_wd ((void *)load_start,
|
||||
(void *)os_data, os_len, CHUNKSZ);
|
||||
|
||||
load_end = load_start + os_len;
|
||||
puts("OK\n");
|
||||
}
|
||||
load_end = load_start + os_len;
|
||||
puts("OK\n");
|
||||
break;
|
||||
case IH_COMP_GZIP:
|
||||
printf (" Uncompressing %s ... ", type_name);
|
||||
@@ -363,10 +361,9 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
show_boot_progress (-9);
|
||||
#ifdef DEBUG
|
||||
puts ("\n## Control returned to monitor - resetting...\n");
|
||||
if (images.autostart)
|
||||
do_reset (cmdtp, flag, argc, argv);
|
||||
do_reset (cmdtp, flag, argc, argv);
|
||||
#endif
|
||||
if (!images.autostart && iflag)
|
||||
if (iflag)
|
||||
enable_interrupts();
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -342,7 +342,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
puts ("Bad sector specification\n");
|
||||
return 1;
|
||||
}
|
||||
printf ("Erase Flash Sectors %d-%d in Bank # %d ",
|
||||
printf ("Erase Flash Sectors %d-%d in Bank # %zu ",
|
||||
sect_first, sect_last, (info-flash_info)+1);
|
||||
rcode = flash_erase(info, sect_first, sect_last);
|
||||
return rcode;
|
||||
@@ -534,7 +534,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
puts ("Bad sector specification\n");
|
||||
return 1;
|
||||
}
|
||||
printf("%sProtect Flash Sectors %d-%d in Bank # %d\n",
|
||||
printf("%sProtect Flash Sectors %d-%d in Bank # %zu\n",
|
||||
p ? "" : "Un-", sect_first, sect_last,
|
||||
(info-flash_info)+1);
|
||||
for (i = sect_first; i <= sect_last; i++) {
|
||||
|
||||
@@ -161,8 +161,6 @@ static uchar ide_wait (int dev, ulong t);
|
||||
|
||||
#define IDE_SPIN_UP_TIME_OUT 5000 /* 5 sec spin-up timeout */
|
||||
|
||||
void inline ide_outb(int dev, int port, unsigned char val);
|
||||
unsigned char inline ide_inb(int dev, int port);
|
||||
static void input_data(int dev, ulong *sect_buf, int words);
|
||||
static void output_data(int dev, ulong *sect_buf, int words);
|
||||
static void ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len);
|
||||
@@ -298,7 +296,7 @@ int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
ulong addr = simple_strtoul(argv[2], NULL, 16);
|
||||
ulong cnt = simple_strtoul(argv[4], NULL, 16);
|
||||
ulong n;
|
||||
#ifdef CFG_64BIT_STRTOUL
|
||||
#ifdef CFG_64BIT_LBA
|
||||
lbaint_t blk = simple_strtoull(argv[3], NULL, 16);
|
||||
|
||||
printf ("\nIDE read: device %d block # %qd, count %ld ... ",
|
||||
@@ -327,7 +325,7 @@ int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
ulong addr = simple_strtoul(argv[2], NULL, 16);
|
||||
ulong cnt = simple_strtoul(argv[4], NULL, 16);
|
||||
ulong n;
|
||||
#ifdef CFG_64BIT_STRTOUL
|
||||
#ifdef CFG_64BIT_LBA
|
||||
lbaint_t blk = simple_strtoull(argv[3], NULL, 16);
|
||||
|
||||
printf ("\nIDE write: device %d block # %qd, count %ld ... ",
|
||||
@@ -523,6 +521,28 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
void inline
|
||||
__ide_outb(int dev, int port, unsigned char val)
|
||||
{
|
||||
debug ("ide_outb (dev= %d, port= 0x%x, val= 0x%02x) : @ 0x%08lx\n",
|
||||
dev, port, val, (ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)));
|
||||
outb(val, (ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)));
|
||||
}
|
||||
void inline ide_outb (int dev, int port, unsigned char val)
|
||||
__attribute__((weak, alias("__ide_outb")));
|
||||
|
||||
unsigned char inline
|
||||
__ide_inb(int dev, int port)
|
||||
{
|
||||
uchar val;
|
||||
val = inb((ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)));
|
||||
debug ("ide_inb (dev= %d, port= 0x%x) : @ 0x%08lx -> 0x%02x\n",
|
||||
dev, port, (ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)), val);
|
||||
return val;
|
||||
}
|
||||
unsigned char inline ide_inb(int dev, int port)
|
||||
__attribute__((weak, alias("__ide_inb")));
|
||||
|
||||
void ide_init (void)
|
||||
{
|
||||
|
||||
@@ -817,28 +837,6 @@ set_pcmcia_timing (int pmode)
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
void inline
|
||||
__ide_outb(int dev, int port, unsigned char val)
|
||||
{
|
||||
debug ("ide_outb (dev= %d, port= 0x%x, val= 0x%02x) : @ 0x%08lx\n",
|
||||
dev, port, val, (ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)));
|
||||
outb(val, (ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)));
|
||||
}
|
||||
void inline ide_outb (int dev, int port, unsigned char val)
|
||||
__attribute__((weak, alias("__ide_outb")));
|
||||
|
||||
unsigned char inline
|
||||
__ide_inb(int dev, int port)
|
||||
{
|
||||
uchar val;
|
||||
val = inb((ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)));
|
||||
debug ("ide_inb (dev= %d, port= 0x%x) : @ 0x%08lx -> 0x%02x\n",
|
||||
dev, port, (ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)), val);
|
||||
return val;
|
||||
}
|
||||
unsigned char inline ide_inb(int dev, int port)
|
||||
__attribute__((weak, alias("__ide_inb")));
|
||||
|
||||
#ifdef __PPC__
|
||||
# ifdef CONFIG_AMIGAONEG3SE
|
||||
static void
|
||||
|
||||
@@ -424,7 +424,6 @@ write_record (char *buf)
|
||||
#define untochar(x) ((int) (((x) - SPACE) & 0xff))
|
||||
|
||||
extern int os_data_count;
|
||||
extern int os_data_header[8];
|
||||
|
||||
static void set_kerm_bin_mode(unsigned long *);
|
||||
static int k_recv(void);
|
||||
@@ -631,11 +630,6 @@ void send_nack (int n)
|
||||
}
|
||||
|
||||
|
||||
/* os_data_* takes an OS Open image and puts it into memory, and
|
||||
puts the boot header in an array named os_data_header
|
||||
|
||||
if image is binary, no header is stored in os_data_header.
|
||||
*/
|
||||
void (*os_data_init) (void);
|
||||
void (*os_data_char) (char new_char);
|
||||
static int os_data_state, os_data_state_saved;
|
||||
@@ -643,25 +637,28 @@ int os_data_count;
|
||||
static int os_data_count_saved;
|
||||
static char *os_data_addr, *os_data_addr_saved;
|
||||
static char *bin_start_address;
|
||||
int os_data_header[8];
|
||||
|
||||
static void bin_data_init (void)
|
||||
{
|
||||
os_data_state = 0;
|
||||
os_data_count = 0;
|
||||
os_data_addr = bin_start_address;
|
||||
}
|
||||
|
||||
static void os_data_save (void)
|
||||
{
|
||||
os_data_state_saved = os_data_state;
|
||||
os_data_count_saved = os_data_count;
|
||||
os_data_addr_saved = os_data_addr;
|
||||
}
|
||||
|
||||
static void os_data_restore (void)
|
||||
{
|
||||
os_data_state = os_data_state_saved;
|
||||
os_data_count = os_data_count_saved;
|
||||
os_data_addr = os_data_addr_saved;
|
||||
}
|
||||
|
||||
static void bin_data_char (char new_char)
|
||||
{
|
||||
switch (os_data_state) {
|
||||
@@ -671,6 +668,7 @@ static void bin_data_char (char new_char)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void set_kerm_bin_mode (unsigned long *addr)
|
||||
{
|
||||
bin_start_address = (char *) addr;
|
||||
@@ -686,16 +684,19 @@ void k_data_init (void)
|
||||
k_data_escape = 0;
|
||||
os_data_init ();
|
||||
}
|
||||
|
||||
void k_data_save (void)
|
||||
{
|
||||
k_data_escape_saved = k_data_escape;
|
||||
os_data_save ();
|
||||
}
|
||||
|
||||
void k_data_restore (void)
|
||||
{
|
||||
k_data_escape = k_data_escape_saved;
|
||||
os_data_restore ();
|
||||
}
|
||||
|
||||
void k_data_char (char new_char)
|
||||
{
|
||||
if (k_data_escape) {
|
||||
|
||||
@@ -183,7 +183,7 @@ int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf ("%01x: 0x%08lx - %s %s read\n", fslnum, num,
|
||||
printf ("%01x: 0x%08x - %s %s read\n", fslnum, num,
|
||||
blocking < 2 ? "non blocking" : "blocking",
|
||||
((blocking == 1) || (blocking == 3)) ? "control" : "data" );
|
||||
return 0;
|
||||
@@ -341,7 +341,7 @@ int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf ("%01x: 0x%08lx - %s %s write\n", fslnum, num,
|
||||
printf ("%01x: 0x%08x - %s %s write\n", fslnum, num,
|
||||
blocking < 2 ? "non blocking" : "blocking",
|
||||
((blocking == 1) || (blocking == 3)) ? "control" : "data" );
|
||||
return 0;
|
||||
@@ -382,7 +382,7 @@ int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
puts ("Unsupported register\n");
|
||||
return 1;
|
||||
}
|
||||
printf (": 0x%08lx\n", val);
|
||||
printf (": 0x%08x\n", val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||
}
|
||||
|
||||
cpuid = simple_strtoul(argv[1], NULL, 10);
|
||||
if (cpuid >= CONFIG_NR_CPUS) {
|
||||
if (cpuid >= CONFIG_NUM_CPUS) {
|
||||
printf ("Core num: %lu is out of range[0..%d]\n",
|
||||
cpuid, CONFIG_NR_CPUS - 1);
|
||||
cpuid, CONFIG_NUM_CPUS - 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,6 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
} else {
|
||||
start = simple_strtoul(argv[2], NULL, 10);
|
||||
end = simple_strtoul(argv[3], NULL, 10);
|
||||
start -= (unsigned long)onenand_chip.base;
|
||||
end -= (unsigned long)onenand_chip.base;
|
||||
|
||||
start >>= onenand_chip.erase_shift;
|
||||
end >>= onenand_chip.erase_shift;
|
||||
@@ -92,8 +90,6 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
size_t retlen = 0;
|
||||
int oob = strncmp(argv[1], "read.oob", 8) ? 0 : 1;
|
||||
|
||||
ofs -= (unsigned long)onenand_chip.base;
|
||||
|
||||
if (oob)
|
||||
onenand_read_oob(&onenand_mtd, ofs, len,
|
||||
&retlen, (u_char *) addr);
|
||||
@@ -111,8 +107,6 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
size_t len = simple_strtoul(argv[4], NULL, 16);
|
||||
size_t retlen = 0;
|
||||
|
||||
ofs -= (unsigned long)onenand_chip.base;
|
||||
|
||||
onenand_write(&onenand_mtd, ofs, len, &retlen,
|
||||
(u_char *) addr);
|
||||
printf("Done\n");
|
||||
|
||||
@@ -1457,7 +1457,7 @@ typedef struct malloc_chunk* mbinptr;
|
||||
indexing, maintain locality, and avoid some initialization tests.
|
||||
*/
|
||||
|
||||
#define top (bin_at(0)->fd) /* The topmost chunk */
|
||||
#define top (av_[2]) /* The topmost chunk */
|
||||
#define last_remainder (bin_at(1)) /* remainder from last split */
|
||||
|
||||
|
||||
@@ -1552,13 +1552,14 @@ void malloc_bin_reloc (void)
|
||||
|
||||
#define BINBLOCKWIDTH 4 /* bins per block */
|
||||
|
||||
#define binblocks (bin_at(0)->size) /* bitvector of nonempty blocks */
|
||||
#define binblocks_r ((INTERNAL_SIZE_T)av_[1]) /* bitvector of nonempty blocks */
|
||||
#define binblocks_w (av_[1])
|
||||
|
||||
/* bin<->block macros */
|
||||
|
||||
#define idx2binblock(ix) ((unsigned)1 << (ix / BINBLOCKWIDTH))
|
||||
#define mark_binblock(ii) (binblocks |= idx2binblock(ii))
|
||||
#define clear_binblock(ii) (binblocks &= ~(idx2binblock(ii)))
|
||||
#define mark_binblock(ii) (binblocks_w = (mbinptr)(binblocks_r | idx2binblock(ii)))
|
||||
#define clear_binblock(ii) (binblocks_w = (mbinptr)(binblocks_r & ~(idx2binblock(ii))))
|
||||
|
||||
|
||||
|
||||
@@ -2250,17 +2251,17 @@ Void_t* mALLOc(bytes) size_t bytes;
|
||||
search for best fitting chunk by scanning bins in blockwidth units.
|
||||
*/
|
||||
|
||||
if ( (block = idx2binblock(idx)) <= binblocks)
|
||||
if ( (block = idx2binblock(idx)) <= binblocks_r)
|
||||
{
|
||||
|
||||
/* Get to the first marked block */
|
||||
|
||||
if ( (block & binblocks) == 0)
|
||||
if ( (block & binblocks_r) == 0)
|
||||
{
|
||||
/* force to an even block boundary */
|
||||
idx = (idx & ~(BINBLOCKWIDTH - 1)) + BINBLOCKWIDTH;
|
||||
block <<= 1;
|
||||
while ((block & binblocks) == 0)
|
||||
while ((block & binblocks_r) == 0)
|
||||
{
|
||||
idx += BINBLOCKWIDTH;
|
||||
block <<= 1;
|
||||
@@ -2315,7 +2316,7 @@ Void_t* mALLOc(bytes) size_t bytes;
|
||||
{
|
||||
if ((startidx & (BINBLOCKWIDTH - 1)) == 0)
|
||||
{
|
||||
binblocks &= ~block;
|
||||
av_[1] = (mbinptr)(binblocks_r & ~block);
|
||||
break;
|
||||
}
|
||||
--startidx;
|
||||
@@ -2324,9 +2325,9 @@ Void_t* mALLOc(bytes) size_t bytes;
|
||||
|
||||
/* Get to the next possibly nonempty block */
|
||||
|
||||
if ( (block <<= 1) <= binblocks && (block != 0) )
|
||||
if ( (block <<= 1) <= binblocks_r && (block != 0) )
|
||||
{
|
||||
while ((block & binblocks) == 0)
|
||||
while ((block & binblocks_r) == 0)
|
||||
{
|
||||
idx += BINBLOCKWIDTH;
|
||||
block <<= 1;
|
||||
|
||||
@@ -66,7 +66,6 @@ void env_relocate_spec(void)
|
||||
size_t retlen;
|
||||
|
||||
env_addr = CFG_ENV_ADDR;
|
||||
env_addr -= (unsigned long) onenand_chip.base;
|
||||
|
||||
/* Check OneNAND exist */
|
||||
if (onenand_mtd.oobblock)
|
||||
@@ -101,7 +100,6 @@ int saveenv(void)
|
||||
|
||||
instr.len = CFG_ENV_SIZE;
|
||||
instr.addr = env_addr;
|
||||
instr.addr -= (unsigned long)onenand_chip.base;
|
||||
if (onenand_erase(&onenand_mtd, &instr)) {
|
||||
printf("OneNAND: erase failed at 0x%08lx\n", env_addr);
|
||||
return 1;
|
||||
@@ -111,7 +109,6 @@ int saveenv(void)
|
||||
env_ptr->crc =
|
||||
crc32(0, env_ptr->data, ONENAND_ENV_SIZE(onenand_mtd));
|
||||
|
||||
env_addr -= (unsigned long)onenand_chip.base;
|
||||
if (onenand_write(&onenand_mtd, env_addr, onenand_mtd.oobblock, &retlen,
|
||||
(u_char *) env_ptr)) {
|
||||
printf("OneNAND: write failed at 0x%08x\n", instr.addr);
|
||||
|
||||
@@ -189,7 +189,6 @@ int image_check_dcrc (image_header_t *hdr)
|
||||
return (dcrc == image_get_dcrc (hdr));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* image_multi_count - get component (sub-image) count
|
||||
* @hdr: pointer to the header of the multi component image
|
||||
@@ -833,7 +832,7 @@ int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
|
||||
rd_noffset = fit_conf_get_ramdisk_node (fit_hdr, cfg_noffset);
|
||||
if (rd_noffset < 0) {
|
||||
debug ("* ramdisk: no ramdisk in config\n");
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
21
common/lcd.c
21
common/lcd.c
@@ -678,6 +678,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
|
||||
/* Set color map */
|
||||
for (i=0; i<colors; ++i) {
|
||||
bmp_color_table_entry_t cte = bmp->color_table[i];
|
||||
#if !defined(CONFIG_ATMEL_LCD)
|
||||
ushort colreg =
|
||||
( ((cte.red) << 8) & 0xf800) |
|
||||
( ((cte.green) << 3) & 0x07e0) |
|
||||
@@ -691,6 +692,9 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
|
||||
cmap++;
|
||||
#elif defined(CONFIG_MPC823)
|
||||
cmap--;
|
||||
#endif
|
||||
#else /* CONFIG_ATMEL_LCD */
|
||||
lcd_setcolreg(i, cte.red, cte.green, cte.blue);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -727,7 +731,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
|
||||
for (i = 0; i < height; ++i) {
|
||||
WATCHDOG_RESET();
|
||||
for (j = 0; j < width ; j++)
|
||||
#if defined(CONFIG_PXA250)
|
||||
#if defined(CONFIG_PXA250) || defined(CONFIG_ATMEL_LCD)
|
||||
*(fb++) = *(bmap++);
|
||||
#elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
|
||||
*(fb++)=255-*(bmap++);
|
||||
@@ -740,6 +744,9 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_VIDEO_BMP_GZIP
|
||||
extern bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp);
|
||||
#endif
|
||||
|
||||
static void *lcd_logo (void)
|
||||
{
|
||||
@@ -761,6 +768,16 @@ static void *lcd_logo (void)
|
||||
addr = simple_strtoul(s, NULL, 16);
|
||||
do_splash = 0;
|
||||
|
||||
#ifdef CONFIG_VIDEO_BMP_GZIP
|
||||
bmp_image_t *bmp = (bmp_image_t *)addr;
|
||||
unsigned long len;
|
||||
|
||||
if (!((bmp->header.signature[0]=='B') &&
|
||||
(bmp->header.signature[1]=='M'))) {
|
||||
addr = (ulong)gunzip_bmp(addr, &len);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (lcd_display_bitmap (addr, 0, 0) == 0) {
|
||||
return ((void *)lcd_base);
|
||||
}
|
||||
@@ -776,7 +793,7 @@ static void *lcd_logo (void)
|
||||
sprintf (info, "%s (%s - %s) ", U_BOOT_VERSION, __DATE__, __TIME__);
|
||||
lcd_drawchars (LCD_INFO_X, LCD_INFO_Y, (uchar *)info, strlen(info));
|
||||
|
||||
sprintf (info, "(C) 2004 DENX Software Engineering");
|
||||
sprintf (info, "(C) 2008 DENX Software Engineering GmbH");
|
||||
lcd_drawchars (LCD_INFO_X, LCD_INFO_Y + VIDEO_FONT_HEIGHT,
|
||||
(uchar *)info, strlen(info));
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ static __inline__ int abortboot(int bootdelay)
|
||||
u_int i;
|
||||
|
||||
# ifdef CONFIG_AUTOBOOT_PROMPT
|
||||
printf(CONFIG_AUTOBOOT_PROMPT, bootdelay);
|
||||
printf(CONFIG_AUTOBOOT_PROMPT);
|
||||
# endif
|
||||
|
||||
# ifdef CONFIG_AUTOBOOT_DELAY_STR
|
||||
@@ -212,7 +212,7 @@ static __inline__ int abortboot(int bootdelay)
|
||||
int abort = 0;
|
||||
|
||||
#ifdef CONFIG_MENUPROMPT
|
||||
printf(CONFIG_MENUPROMPT, bootdelay);
|
||||
printf(CONFIG_MENUPROMPT);
|
||||
#else
|
||||
printf("Hit any key to stop autoboot: %2d ", bootdelay);
|
||||
#endif
|
||||
|
||||
@@ -81,12 +81,12 @@ void mx31_gpio_mux(unsigned long mode)
|
||||
{
|
||||
unsigned long reg, shift, tmp;
|
||||
|
||||
reg = IOMUXC_BASE + (mode & 0xfc);
|
||||
reg = IOMUXC_BASE + (mode & 0x1fc);
|
||||
shift = (~mode & 0x3) * 8;
|
||||
|
||||
tmp = __REG(reg);
|
||||
tmp &= ~(0xff << shift);
|
||||
tmp |= ((mode >> 8) & 0xff) << shift;
|
||||
tmp |= ((mode >> IOMUX_MODE_POS) & 0xff) << shift;
|
||||
__REG(reg) = tmp;
|
||||
}
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ int do_irqinfo (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
|
||||
|
||||
for (i = 0; i < CFG_INTC_0_NUM; i++) {
|
||||
if (act->handler != (interrupt_handler_t*) def_hdlr) {
|
||||
printf ("%02d %08lx %08lx %d\n", i,
|
||||
printf ("%02d %08x %08x %d\n", i,
|
||||
(int)act->handler, (int)act->arg, act->count);
|
||||
}
|
||||
act++;
|
||||
|
||||
@@ -76,7 +76,7 @@ void serial_setbrg (void)
|
||||
sd = (*sys_powerctrl & 0x03) + 2;
|
||||
|
||||
/* calulate 2x baudrate and round */
|
||||
divisorx2 = ((CFG_HZ/(sd * 16 * CONFIG_BAUDRATE)));
|
||||
divisorx2 = ((CFG_MIPS_TIMER_FREQ/(sd * 16 * CONFIG_BAUDRATE)));
|
||||
|
||||
if (divisorx2 & 0x01)
|
||||
divisorx2 = divisorx2 + 1;
|
||||
|
||||
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
|
||||
LIB = $(obj)lib$(CPU).a
|
||||
|
||||
START = start.o
|
||||
COBJS = traps.o cpu.o cpu_init.o speed.o interrupts.o serial.o fec.o i2c.o
|
||||
COBJS = traps.o cpu.o cpu_init.o speed.o interrupts.o serial.o fec.o i2c.o iopin.o
|
||||
|
||||
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
|
||||
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
|
||||
|
||||
@@ -131,22 +131,67 @@ void watchdog_reset (void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OF_LIBFDT
|
||||
void ft_cpu_setup(void *blob, bd_t *bd)
|
||||
|
||||
#ifdef CONFIG_OF_SUPPORT_OLD_DEVICE_TREES
|
||||
/*
|
||||
* fdt setup for old device trees
|
||||
* fix up
|
||||
* cpu clocks
|
||||
* soc clocks
|
||||
* ethernet addresses
|
||||
*/
|
||||
static void old_ft_cpu_setup(void *blob, bd_t *bd)
|
||||
{
|
||||
char *cpu_path = "/cpus/" OF_CPU;
|
||||
char *eth_path = "/" OF_SOC "/ethernet@2800";
|
||||
char *eth_path_old = "/" OF_SOC_OLD "/ethernet@2800";
|
||||
/*
|
||||
* avoid fixing up by path because that
|
||||
* produces scary error messages
|
||||
*/
|
||||
|
||||
do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
|
||||
do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
|
||||
do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
|
||||
do_fixup_by_path_u32(blob, "/" OF_SOC, "bus-frequency", bd->bi_ipsfreq, 1);
|
||||
do_fixup_by_path(blob, eth_path, "local-mac-address", bd->bi_enetaddr, 6, 0);
|
||||
|
||||
/* this is so old kernels with old device trees will boot */
|
||||
do_fixup_by_path_u32(blob, "/" OF_SOC_OLD, "bus-frequency", bd->bi_ipsfreq, 0);
|
||||
do_fixup_by_path(blob, eth_path_old, "local-mac-address",
|
||||
bd->bi_enetaddr, 6, 0);
|
||||
do_fixup_by_path(blob, eth_path_old, "address", bd->bi_enetaddr, 6, 0);
|
||||
/*
|
||||
* old device trees have ethernet nodes with
|
||||
* device_type = "network"
|
||||
*/
|
||||
do_fixup_by_prop(blob, "device_type", "network", 8,
|
||||
"local-mac-address", bd->bi_enetaddr, 6, 0);
|
||||
do_fixup_by_prop(blob, "device_type", "network", 8,
|
||||
"address", bd->bi_enetaddr, 6, 0);
|
||||
/*
|
||||
* old device trees have soc nodes with
|
||||
* device_type = "soc"
|
||||
*/
|
||||
do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
|
||||
"bus-frequency", bd->bi_ipsfreq, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void ft_clock_setup(void *blob, bd_t *bd)
|
||||
{
|
||||
char *cpu_path = "/cpus/" OF_CPU;
|
||||
|
||||
/*
|
||||
* fixup cpu clocks using path
|
||||
*/
|
||||
do_fixup_by_path_u32(blob, cpu_path,
|
||||
"timebase-frequency", OF_TBCLK, 1);
|
||||
do_fixup_by_path_u32(blob, cpu_path,
|
||||
"bus-frequency", bd->bi_busfreq, 1);
|
||||
do_fixup_by_path_u32(blob, cpu_path,
|
||||
"clock-frequency", bd->bi_intfreq, 1);
|
||||
/*
|
||||
* fixup soc clocks using compatible
|
||||
*/
|
||||
do_fixup_by_compat_u32(blob, OF_SOC_COMPAT,
|
||||
"bus-frequency", bd->bi_ipsfreq, 1);
|
||||
}
|
||||
|
||||
void ft_cpu_setup(void *blob, bd_t *bd)
|
||||
{
|
||||
#ifdef CONFIG_OF_SUPPORT_OLD_DEVICE_TREES
|
||||
old_ft_cpu_setup(blob, bd);
|
||||
#endif
|
||||
ft_clock_setup(blob, bd);
|
||||
#ifdef CONFIG_HAS_ETH0
|
||||
fdt_fixup_ethernet(blob, bd);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2008
|
||||
* Martha J Marx, Silicon Turnkey Express, mmarx@silicontkx.com
|
||||
* mpc512x I/O pin/pad initialization for the ADS5121 board
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
@@ -21,36 +21,29 @@
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
#include <common.h>
|
||||
#include <linux/types.h>
|
||||
#include <mpc512x.h>
|
||||
|
||||
void iopin_initialize(iopin_t *ioregs_init, int len)
|
||||
{
|
||||
. = 0x00000000;
|
||||
short i, j, p;
|
||||
u_long *reg;
|
||||
immap_t *im = (immap_t *)CFG_IMMR;
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
cpu/pxa/start.o (.text)
|
||||
*(.text)
|
||||
reg = (u_long *)&(im->io_ctrl.regs[0]);
|
||||
|
||||
if (sizeof(ioregs_init) == 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
for (p = 0, j = ioregs_init[i].p_offset / sizeof(u_long);
|
||||
p < ioregs_init[i].nr_pins; p++, j++) {
|
||||
if (ioregs_init[i].bit_or)
|
||||
reg[j] |= ioregs_init[i].val;
|
||||
else
|
||||
reg[j] = ioregs_init[i].val;
|
||||
}
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(.rodata) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.data : { *(.data) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.got : { *(.got) }
|
||||
|
||||
. = .;
|
||||
__u_boot_cmd_start = .;
|
||||
.u_boot_cmd : { *(.u_boot_cmd) }
|
||||
__u_boot_cmd_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
.bss (NOLOAD) : { *(.bss) }
|
||||
_end = .;
|
||||
return;
|
||||
}
|
||||
@@ -457,7 +457,7 @@ void pci_mpc8250_init (struct pci_controller *hose)
|
||||
void ft_pci_setup(void *blob, bd_t *bd)
|
||||
{
|
||||
do_fixup_by_prop_u32(blob, "device_type", "pci", 4,
|
||||
"clock-frequency", bd->pci_clk, 1);
|
||||
"clock-frequency", gd->pci_clk, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -162,6 +162,30 @@ int get_clocks (void)
|
||||
gd->cpu_clk = clkin;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
gd->pci_clk = clkin;
|
||||
|
||||
if (sccr & SCCR_PCI_MODE) {
|
||||
uint pci_div;
|
||||
uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
|
||||
|
||||
if (sccr & SCCR_PCI_MODCK) {
|
||||
pci_div = 2;
|
||||
if (pcidf == 9) {
|
||||
pci_div *= 5;
|
||||
} else if (pcidf == 0xB) {
|
||||
pci_div *= 6;
|
||||
} else {
|
||||
pci_div *= (pcidf + 1);
|
||||
}
|
||||
} else {
|
||||
pci_div = pcidf + 1;
|
||||
}
|
||||
|
||||
gd->pci_clk = (gd->cpm_clk * 2) / pci_div;
|
||||
}
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -220,26 +244,9 @@ int prt_8260_clks (void)
|
||||
|
||||
printf (" - cpu_clk %10ld, cpm_clk %10ld, bus_clk %10ld\n",
|
||||
gd->cpu_clk, gd->cpm_clk, gd->bus_clk);
|
||||
|
||||
if (sccr & SCCR_PCI_MODE) {
|
||||
uint pci_div;
|
||||
uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
|
||||
|
||||
if (sccr & SCCR_PCI_MODCK) {
|
||||
pci_div = 2;
|
||||
if (pcidf == 9) {
|
||||
pci_div *= 5;
|
||||
} else if (pcidf == 0xB) {
|
||||
pci_div *= 6;
|
||||
} else {
|
||||
pci_div *= (pcidf + 1);
|
||||
}
|
||||
} else {
|
||||
pci_div = pcidf + 1;
|
||||
}
|
||||
|
||||
printf (" - pci_clk %10ld\n", (gd->cpm_clk * 2) / pci_div);
|
||||
}
|
||||
#ifdef CONFIG_PCI
|
||||
printf (" - pci_clk %10ld\n", gd->pci_clk);
|
||||
#endif
|
||||
putc ('\n');
|
||||
|
||||
return (0);
|
||||
|
||||
@@ -147,7 +147,7 @@ static void pq3_mp_up(unsigned long bootpg)
|
||||
out_be32(&gur->devdisr, devdisr);
|
||||
|
||||
/* release the hounds */
|
||||
up = ((1 << CONFIG_NR_CPUS) - 1);
|
||||
up = ((1 << CONFIG_NUM_CPUS) - 1);
|
||||
bpcr = in_be32(&ecm->eebpcr);
|
||||
bpcr |= (up << 24);
|
||||
out_be32(&ecm->eebpcr, bpcr);
|
||||
@@ -157,7 +157,7 @@ static void pq3_mp_up(unsigned long bootpg)
|
||||
/* wait for everyone */
|
||||
while (timeout) {
|
||||
int i;
|
||||
for (i = 0; i < CONFIG_NR_CPUS; i++) {
|
||||
for (i = 0; i < CONFIG_NUM_CPUS; i++) {
|
||||
if (table[i * NUM_BOOT_ENTRY + BOOT_ENTRY_ADDR_LOWER])
|
||||
cpu_up_mask |= (1 << i);
|
||||
};
|
||||
|
||||
@@ -173,7 +173,7 @@ __secondary_start_page:
|
||||
.align L1_CACHE_SHIFT
|
||||
.globl __spin_table
|
||||
__spin_table:
|
||||
.space CONFIG_NR_CPUS*ENTRY_SIZE
|
||||
.space CONFIG_NUM_CPUS*ENTRY_SIZE
|
||||
|
||||
/* Fill in the empty space. The actual reset vector is
|
||||
* the last word of the page */
|
||||
|
||||
@@ -26,8 +26,10 @@
|
||||
* cpu_init.c - low level cpu init
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <common.h>
|
||||
#include <mpc86xx.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <asm/fsl_law.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
@@ -121,3 +123,26 @@ int cpu_init_r(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set up BAT registers */
|
||||
void setup_bats(void)
|
||||
{
|
||||
write_bat(DBAT0, CFG_DBAT0U, CFG_DBAT0L);
|
||||
write_bat(IBAT0, CFG_IBAT0U, CFG_IBAT0L);
|
||||
write_bat(DBAT1, CFG_DBAT1U, CFG_DBAT1L);
|
||||
write_bat(IBAT1, CFG_IBAT1U, CFG_IBAT1L);
|
||||
write_bat(DBAT2, CFG_DBAT2U, CFG_DBAT2L);
|
||||
write_bat(IBAT2, CFG_IBAT2U, CFG_IBAT2L);
|
||||
write_bat(DBAT3, CFG_DBAT3U, CFG_DBAT3L);
|
||||
write_bat(IBAT3, CFG_IBAT3U, CFG_IBAT3L);
|
||||
write_bat(DBAT4, CFG_DBAT4U, CFG_DBAT4L);
|
||||
write_bat(IBAT4, CFG_IBAT4U, CFG_IBAT4L);
|
||||
write_bat(DBAT5, CFG_DBAT5U, CFG_DBAT5L);
|
||||
write_bat(IBAT5, CFG_IBAT5U, CFG_IBAT5L);
|
||||
write_bat(DBAT6, CFG_DBAT6U, CFG_DBAT6L);
|
||||
write_bat(IBAT6, CFG_IBAT6U, CFG_IBAT6L);
|
||||
write_bat(DBAT7, CFG_DBAT7U, CFG_DBAT7L);
|
||||
write_bat(IBAT7, CFG_IBAT7U, CFG_IBAT7L);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -358,125 +358,6 @@ invalidate_bats:
|
||||
sync
|
||||
blr
|
||||
|
||||
|
||||
/* setup_bats - set them up to some initial state */
|
||||
/* Skip any BATS setup in early_bats */
|
||||
.globl setup_bats
|
||||
setup_bats:
|
||||
|
||||
addis r0, r0, 0x0000
|
||||
|
||||
/* IBAT 0 */
|
||||
addis r4, r0, CFG_IBAT0L@h
|
||||
ori r4, r4, CFG_IBAT0L@l
|
||||
addis r3, r0, CFG_IBAT0U@h
|
||||
ori r3, r3, CFG_IBAT0U@l
|
||||
mtspr IBAT0L, r4
|
||||
mtspr IBAT0U, r3
|
||||
isync
|
||||
|
||||
/* DBAT 0 */
|
||||
addis r4, r0, CFG_DBAT0L@h
|
||||
ori r4, r4, CFG_DBAT0L@l
|
||||
addis r3, r0, CFG_DBAT0U@h
|
||||
ori r3, r3, CFG_DBAT0U@l
|
||||
mtspr DBAT0L, r4
|
||||
mtspr DBAT0U, r3
|
||||
isync
|
||||
|
||||
/* IBAT 1 */
|
||||
addis r4, r0, CFG_IBAT1L@h
|
||||
ori r4, r4, CFG_IBAT1L@l
|
||||
addis r3, r0, CFG_IBAT1U@h
|
||||
ori r3, r3, CFG_IBAT1U@l
|
||||
mtspr IBAT1L, r4
|
||||
mtspr IBAT1U, r3
|
||||
isync
|
||||
|
||||
/* DBAT 1 */
|
||||
addis r4, r0, CFG_DBAT1L@h
|
||||
ori r4, r4, CFG_DBAT1L@l
|
||||
addis r3, r0, CFG_DBAT1U@h
|
||||
ori r3, r3, CFG_DBAT1U@l
|
||||
mtspr DBAT1L, r4
|
||||
mtspr DBAT1U, r3
|
||||
isync
|
||||
|
||||
/* IBAT 2 */
|
||||
addis r4, r0, CFG_IBAT2L@h
|
||||
ori r4, r4, CFG_IBAT2L@l
|
||||
addis r3, r0, CFG_IBAT2U@h
|
||||
ori r3, r3, CFG_IBAT2U@l
|
||||
mtspr IBAT2L, r4
|
||||
mtspr IBAT2U, r3
|
||||
isync
|
||||
|
||||
/* DBAT 2 */
|
||||
addis r4, r0, CFG_DBAT2L@h
|
||||
ori r4, r4, CFG_DBAT2L@l
|
||||
addis r3, r0, CFG_DBAT2U@h
|
||||
ori r3, r3, CFG_DBAT2U@l
|
||||
mtspr DBAT2L, r4
|
||||
mtspr DBAT2U, r3
|
||||
isync
|
||||
|
||||
/* IBAT 3 */
|
||||
addis r4, r0, CFG_IBAT3L@h
|
||||
ori r4, r4, CFG_IBAT3L@l
|
||||
addis r3, r0, CFG_IBAT3U@h
|
||||
ori r3, r3, CFG_IBAT3U@l
|
||||
mtspr IBAT3L, r4
|
||||
mtspr IBAT3U, r3
|
||||
isync
|
||||
|
||||
/* DBAT 3 */
|
||||
addis r4, r0, CFG_DBAT3L@h
|
||||
ori r4, r4, CFG_DBAT3L@l
|
||||
addis r3, r0, CFG_DBAT3U@h
|
||||
ori r3, r3, CFG_DBAT3U@l
|
||||
mtspr DBAT3L, r4
|
||||
mtspr DBAT3U, r3
|
||||
isync
|
||||
|
||||
/* IBAT 4 */
|
||||
addis r4, r0, CFG_IBAT4L@h
|
||||
ori r4, r4, CFG_IBAT4L@l
|
||||
addis r3, r0, CFG_IBAT4U@h
|
||||
ori r3, r3, CFG_IBAT4U@l
|
||||
mtspr IBAT4L, r4
|
||||
mtspr IBAT4U, r3
|
||||
isync
|
||||
|
||||
/* DBAT 4 */
|
||||
addis r4, r0, CFG_DBAT4L@h
|
||||
ori r4, r4, CFG_DBAT4L@l
|
||||
addis r3, r0, CFG_DBAT4U@h
|
||||
ori r3, r3, CFG_DBAT4U@l
|
||||
mtspr DBAT4L, r4
|
||||
mtspr DBAT4U, r3
|
||||
isync
|
||||
|
||||
/* IBAT 7 */
|
||||
addis r4, r0, CFG_IBAT7L@h
|
||||
ori r4, r4, CFG_IBAT7L@l
|
||||
addis r3, r0, CFG_IBAT7U@h
|
||||
ori r3, r3, CFG_IBAT7U@l
|
||||
mtspr IBAT7L, r4
|
||||
mtspr IBAT7U, r3
|
||||
isync
|
||||
|
||||
/* DBAT 7 */
|
||||
addis r4, r0, CFG_DBAT7L@h
|
||||
ori r4, r4, CFG_DBAT7L@l
|
||||
addis r3, r0, CFG_DBAT7U@h
|
||||
ori r3, r3, CFG_DBAT7U@l
|
||||
mtspr DBAT7L, r4
|
||||
mtspr DBAT7U, r3
|
||||
isync
|
||||
|
||||
sync
|
||||
blr
|
||||
|
||||
/*
|
||||
* early_bats:
|
||||
*
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <nios2.h>
|
||||
#include <nios2-io.h>
|
||||
#include <asm/types.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <common.h>
|
||||
|
||||
@@ -40,7 +40,7 @@ void display_sysid (void)
|
||||
stamp = readl (&sysid->timestamp);
|
||||
localtime_r (&stamp, &t);
|
||||
asctime_r (&t, asc);
|
||||
printf ("SYSID : %08x, %s", readl (&sysid->id), asc);
|
||||
printf ("SYSID : %08lx, %s", readl (&sysid->id), asc);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1150,50 +1150,50 @@ static void program_codt(unsigned long *dimm_populated,
|
||||
if (dimm_type == SDRAM_DDR2) {
|
||||
codt |= SDRAM_CODT_DQS_1_8_V_DDR2;
|
||||
if ((total_dimm == 1) && (firstSlot == TRUE)) {
|
||||
if (total_rank == 1) {
|
||||
if (total_rank == 1) { /* PUUU */
|
||||
codt |= CALC_ODT_R(0);
|
||||
modt0 = CALC_ODT_W(0);
|
||||
modt1 = 0x00000000;
|
||||
modt2 = 0x00000000;
|
||||
modt3 = 0x00000000;
|
||||
}
|
||||
if (total_rank == 2) {
|
||||
if (total_rank == 2) { /* PPUU */
|
||||
codt |= CALC_ODT_R(0) | CALC_ODT_R(1);
|
||||
modt0 = CALC_ODT_W(0);
|
||||
modt1 = CALC_ODT_W(0);
|
||||
modt0 = CALC_ODT_W(0) | CALC_ODT_W(1);
|
||||
modt1 = 0x00000000;
|
||||
modt2 = 0x00000000;
|
||||
modt3 = 0x00000000;
|
||||
}
|
||||
} else if ((total_dimm == 1) && (firstSlot != TRUE)) {
|
||||
if (total_rank == 1) {
|
||||
if (total_rank == 1) { /* UUPU */
|
||||
codt |= CALC_ODT_R(2);
|
||||
modt0 = 0x00000000;
|
||||
modt1 = 0x00000000;
|
||||
modt2 = CALC_ODT_W(2);
|
||||
modt3 = 0x00000000;
|
||||
}
|
||||
if (total_rank == 2) {
|
||||
if (total_rank == 2) { /* UUPP */
|
||||
codt |= CALC_ODT_R(2) | CALC_ODT_R(3);
|
||||
modt0 = 0x00000000;
|
||||
modt1 = 0x00000000;
|
||||
modt2 = CALC_ODT_W(2);
|
||||
modt3 = CALC_ODT_W(2);
|
||||
modt2 = CALC_ODT_W(2) | CALC_ODT_W(3);
|
||||
modt3 = 0x00000000;
|
||||
}
|
||||
}
|
||||
if (total_dimm == 2) {
|
||||
if (total_rank == 2) {
|
||||
if (total_rank == 2) { /* PUPU */
|
||||
codt |= CALC_ODT_R(0) | CALC_ODT_R(2);
|
||||
modt0 = CALC_ODT_RW(2);
|
||||
modt1 = 0x00000000;
|
||||
modt2 = CALC_ODT_RW(0);
|
||||
modt3 = 0x00000000;
|
||||
}
|
||||
if (total_rank == 4) {
|
||||
if (total_rank == 4) { /* PPPP */
|
||||
codt |= CALC_ODT_R(0) | CALC_ODT_R(1) |
|
||||
CALC_ODT_R(2) | CALC_ODT_R(3);
|
||||
modt0 = CALC_ODT_RW(2);
|
||||
modt0 = CALC_ODT_RW(2) | CALC_ODT_RW(3);
|
||||
modt1 = 0x00000000;
|
||||
modt2 = CALC_ODT_RW(0);
|
||||
modt2 = CALC_ODT_RW(0) | CALC_ODT_RW(1);
|
||||
modt3 = 0x00000000;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -559,11 +559,6 @@ mmc_init(int verbose)
|
||||
set_GPIO_mode(GPIO8_MMCCS0_MD);
|
||||
#endif
|
||||
CKEN |= CKEN12_MMC; /* enable MMC unit clock */
|
||||
#if defined(CONFIG_ADSVIX)
|
||||
/* turn on the power */
|
||||
GPCR(114) = GPIO_bit(114);
|
||||
udelay(1000);
|
||||
#endif
|
||||
|
||||
MMC_CLKRT = MMC_CLKRT_0_3125MHZ;
|
||||
MMC_RESTO = MMC_RES_TO_MAX;
|
||||
|
||||
@@ -114,10 +114,17 @@ What they do
|
||||
CONFIG_AUTOBOOT_PROMPT is displayed before the boot delay
|
||||
selected by CONFIG_BOOTDELAY starts. If it is not defined
|
||||
there is no output indicating that autoboot is in progress.
|
||||
If "%d" is included, it is replaced by the number of seconds
|
||||
remaining before autoboot will start, but it does not count
|
||||
down the seconds. "autoboot in %d seconds\n" is a reasonable
|
||||
prompt.
|
||||
|
||||
Note that CONFIG_AUTOBOOT_PROMPT is used as the (only)
|
||||
argument to a printf() call, so it may contain '%' format
|
||||
specifications, provided that it also includes, sepearated by
|
||||
commas exactly like in a printf statement, the required
|
||||
arguments. It is the responsibility of the user to select only
|
||||
such arguments that are valid in the given context. A
|
||||
reasonable prompt could be defined as
|
||||
|
||||
#define CONFIG_AUTOBOOT_PROMPT \
|
||||
"autoboot in %d seconds\n",bootdelay
|
||||
|
||||
If CONFIG_AUTOBOOT_DELAY_STR or "bootdelaykey" is specified
|
||||
and this string is received from console input before
|
||||
|
||||
@@ -15,4 +15,4 @@ create image:
|
||||
# dd of=flash bs=1k count=4k if=/dev/zero
|
||||
# dd of=flash bs=1k conv=notrunc if=u-boot.bin
|
||||
start it:
|
||||
# qemu-system-mips -pflash flash -monitor null -nographic
|
||||
# qemu-system-mips -M mips -pflash flash -monitor null -nographic
|
||||
|
||||
@@ -143,12 +143,15 @@ void
|
||||
i2c_init(int speed, int slaveadd)
|
||||
{
|
||||
struct fsl_i2c *dev;
|
||||
unsigned int temp;
|
||||
|
||||
dev = (struct fsl_i2c *) (CFG_IMMR + CFG_I2C_OFFSET);
|
||||
|
||||
writeb(0, &dev->cr); /* stop I2C controller */
|
||||
udelay(5); /* let it shutdown in peace */
|
||||
i2c_bus_speed[0] = set_i2c_bus_speed(dev, gd->i2c1_clk, speed);
|
||||
temp = set_i2c_bus_speed(dev, gd->i2c1_clk, speed);
|
||||
if (gd->flags & GD_FLG_RELOC)
|
||||
i2c_bus_speed[0] = temp;
|
||||
writeb(slaveadd << 1, &dev->adr); /* write slave address */
|
||||
writeb(0x0, &dev->sr); /* clear status register */
|
||||
writeb(I2C_CR_MEN, &dev->cr); /* start I2C controller */
|
||||
@@ -158,7 +161,9 @@ i2c_init(int speed, int slaveadd)
|
||||
|
||||
writeb(0, &dev->cr); /* stop I2C controller */
|
||||
udelay(5); /* let it shutdown in peace */
|
||||
i2c_bus_speed[1] = set_i2c_bus_speed(dev, gd->i2c2_clk, speed);
|
||||
temp = set_i2c_bus_speed(dev, gd->i2c2_clk, speed);
|
||||
if (gd->flags & GD_FLG_RELOC)
|
||||
i2c_bus_speed[1] = temp;
|
||||
writeb(slaveadd << 1, &dev->adr); /* write slave address */
|
||||
writeb(0x0, &dev->sr); /* clear status register */
|
||||
writeb(I2C_CR_MEN, &dev->cr); /* start I2C controller */
|
||||
@@ -168,12 +173,11 @@ i2c_init(int speed, int slaveadd)
|
||||
static __inline__ int
|
||||
i2c_wait4bus(void)
|
||||
{
|
||||
ulong timeval = get_timer(0);
|
||||
unsigned long long timeval = get_ticks();
|
||||
|
||||
while (readb(&i2c_dev[i2c_bus_num]->sr) & I2C_SR_MBB) {
|
||||
if (get_timer(timeval) > I2C_TIMEOUT) {
|
||||
if ((get_ticks() - timeval) > usec2ticks(I2C_TIMEOUT))
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -183,7 +187,7 @@ static __inline__ int
|
||||
i2c_wait(int write)
|
||||
{
|
||||
u32 csr;
|
||||
ulong timeval = get_timer(0);
|
||||
unsigned long long timeval = get_ticks();
|
||||
|
||||
do {
|
||||
csr = readb(&i2c_dev[i2c_bus_num]->sr);
|
||||
@@ -208,7 +212,7 @@ i2c_wait(int write)
|
||||
}
|
||||
|
||||
return 0;
|
||||
} while (get_timer (timeval) < I2C_TIMEOUT);
|
||||
} while ((get_ticks() - timeval) < usec2ticks(I2C_TIMEOUT));
|
||||
|
||||
debug("i2c_wait: timed out\n");
|
||||
return -1;
|
||||
|
||||
@@ -135,10 +135,10 @@ mmc_cmd(unsigned long cmd, unsigned long arg,
|
||||
status = mmci_readl(SR);
|
||||
} while (!(status & MMCI_BIT(CMDRDY)));
|
||||
|
||||
pr_debug("mmc: status 0x%08lx\n", status);
|
||||
pr_debug("mmc: status 0x%08x\n", status);
|
||||
|
||||
if (status & error_flags) {
|
||||
printf("mmc: command %lu failed (status: 0x%08lx)\n",
|
||||
printf("mmc: command %lu failed (status: 0x%08x)\n",
|
||||
cmd, status);
|
||||
return -EIO;
|
||||
}
|
||||
@@ -245,7 +245,7 @@ out:
|
||||
|
||||
read_error:
|
||||
mmc_cmd(MMC_CMD_SEND_STATUS, mmc_rca << 16, &card_status, R1 | NCR);
|
||||
printf("mmc: bread failed, status = %08x, card status = %08x\n",
|
||||
printf("mmc: bread failed, status = %08x, card status = %08lx\n",
|
||||
status, card_status);
|
||||
goto out;
|
||||
}
|
||||
@@ -284,13 +284,13 @@ static void sd_parse_cid(struct mmc_cid *cid, unsigned long *resp)
|
||||
|
||||
static void mmc_dump_cid(const struct mmc_cid *cid)
|
||||
{
|
||||
printf("Manufacturer ID: %02lX\n", cid->mid);
|
||||
printf("OEM/Application ID: %04lX\n", cid->oid);
|
||||
printf("Manufacturer ID: %02X\n", cid->mid);
|
||||
printf("OEM/Application ID: %04X\n", cid->oid);
|
||||
printf("Product name: %s\n", cid->pnm);
|
||||
printf("Product Revision: %lu.%lu\n",
|
||||
printf("Product Revision: %u.%u\n",
|
||||
cid->prv >> 4, cid->prv & 0x0f);
|
||||
printf("Product Serial Number: %lu\n", cid->psn);
|
||||
printf("Manufacturing Date: %02lu/%02lu\n",
|
||||
printf("Manufacturing Date: %02u/%02u\n",
|
||||
cid->mdt >> 4, cid->mdt & 0x0f);
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ int mmc_init(int verbose)
|
||||
mmc_blkdev.part_type = PART_TYPE_DOS;
|
||||
mmc_blkdev.block_read = mmc_bread;
|
||||
sprintf((char *)mmc_blkdev.vendor,
|
||||
"Man %02x%04x Snr %08x",
|
||||
"Man %02x%04x Snr %08lx",
|
||||
cid.mid, cid.oid, cid.psn);
|
||||
strncpy((char *)mmc_blkdev.product, cid.pnm,
|
||||
sizeof(mmc_blkdev.product));
|
||||
|
||||
@@ -158,13 +158,13 @@ static uint flash_offset_cfi[2] = { FLASH_OFFSET_CFI, FLASH_OFFSET_CFI_ALT };
|
||||
|
||||
/* use CFG_MAX_FLASH_BANKS_DETECT if defined */
|
||||
#ifdef CFG_MAX_FLASH_BANKS_DETECT
|
||||
static ulong bank_base[CFG_MAX_FLASH_BANKS_DETECT] = CFG_FLASH_BANKS_LIST;
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS_DETECT]; /* FLASH chips info */
|
||||
# define CFI_MAX_FLASH_BANKS CFG_MAX_FLASH_BANKS_DETECT
|
||||
#else
|
||||
static ulong bank_base[CFG_MAX_FLASH_BANKS] = CFG_FLASH_BANKS_LIST;
|
||||
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* FLASH chips info */
|
||||
# define CFI_MAX_FLASH_BANKS CFG_MAX_FLASH_BANKS
|
||||
#endif
|
||||
|
||||
flash_info_t flash_info[CFI_MAX_FLASH_BANKS]; /* FLASH chips info */
|
||||
|
||||
/*
|
||||
* Check if chip width is defined. If not, start detecting with 8bit.
|
||||
*/
|
||||
@@ -306,6 +306,9 @@ static void flash_make_cmd(flash_info_t *info, u32 cmd, void *cmdbuf)
|
||||
int i;
|
||||
int cword_offset;
|
||||
int cp_offset;
|
||||
#if defined(__LITTLE_ENDIAN) || defined(CFG_WRITE_SWAPPED_DATA)
|
||||
u32 cmd_le = cpu_to_le32(cmd);
|
||||
#endif
|
||||
uchar val;
|
||||
uchar *cp = (uchar *) cmdbuf;
|
||||
|
||||
@@ -313,7 +316,7 @@ static void flash_make_cmd(flash_info_t *info, u32 cmd, void *cmdbuf)
|
||||
cword_offset = (info->portwidth-i)%info->chipwidth;
|
||||
#if defined(__LITTLE_ENDIAN) || defined(CFG_WRITE_SWAPPED_DATA)
|
||||
cp_offset = info->portwidth - i;
|
||||
val = *((uchar*)&cmd + cword_offset);
|
||||
val = *((uchar*)&cmd_le + cword_offset);
|
||||
#else
|
||||
cp_offset = i - 1;
|
||||
val = *((uchar*)&cmd + sizeof(u32) - cword_offset - 1);
|
||||
@@ -1909,12 +1912,14 @@ unsigned long flash_init (void)
|
||||
char *s = getenv("unlock");
|
||||
#endif
|
||||
|
||||
#define BANK_BASE(i) (((unsigned long [CFI_MAX_FLASH_BANKS])CFG_FLASH_BANKS_LIST)[i])
|
||||
|
||||
/* Init: no FLASHes known */
|
||||
for (i = 0; i < CFG_MAX_FLASH_BANKS; ++i) {
|
||||
flash_info[i].flash_id = FLASH_UNKNOWN;
|
||||
|
||||
if (!flash_detect_legacy (bank_base[i], i))
|
||||
flash_get_size (bank_base[i], i);
|
||||
if (!flash_detect_legacy (BANK_BASE(i), i))
|
||||
flash_get_size (BANK_BASE(i), i);
|
||||
size += flash_info[i].size;
|
||||
if (flash_info[i].flash_id == FLASH_UNKNOWN) {
|
||||
#ifndef CFG_FLASH_QUIET_TEST
|
||||
|
||||
@@ -56,7 +56,7 @@ int AT91F_DataflashInit (void)
|
||||
switch (dfcode) {
|
||||
case AT45DB021:
|
||||
dataflash_info[i].Device.pages_number = 1024;
|
||||
dataflash_info[i].Device.pages_size = 263;
|
||||
dataflash_info[i].Device.pages_size = 264;
|
||||
dataflash_info[i].Device.page_offset = 9;
|
||||
dataflash_info[i].Device.byte_mask = 0x300;
|
||||
dataflash_info[i].Device.cs = cs[i].cs;
|
||||
@@ -65,6 +65,19 @@ int AT91F_DataflashInit (void)
|
||||
dataflash_info[i].id = dfcode;
|
||||
found[i] += dfcode;;
|
||||
break;
|
||||
|
||||
case AT45DB081:
|
||||
dataflash_info[i].Device.pages_number = 4096;
|
||||
dataflash_info[i].Device.pages_size = 264;
|
||||
dataflash_info[i].Device.page_offset = 9;
|
||||
dataflash_info[i].Device.byte_mask = 0x300;
|
||||
dataflash_info[i].Device.cs = cs[i].cs;
|
||||
dataflash_info[i].Desc.DataFlash_state = IDLE;
|
||||
dataflash_info[i].logical_address = cs[i].addr;
|
||||
dataflash_info[i].id = dfcode;
|
||||
found[i] += dfcode;;
|
||||
break;
|
||||
|
||||
case AT45DB161:
|
||||
dataflash_info[i].Device.pages_number = 4096;
|
||||
dataflash_info[i].Device.pages_size = 528;
|
||||
|
||||
@@ -680,13 +680,11 @@ int onenand_read_oob(struct mtd_info *mtd, loff_t from, size_t len,
|
||||
* onenand_verify_page - [GENERIC] verify the chip contents after a write
|
||||
* @param mtd MTD device structure
|
||||
* @param buf the databuffer to verify
|
||||
* @param block block address
|
||||
* @param page page address
|
||||
*
|
||||
* Check DataRAM area directly
|
||||
*/
|
||||
static int onenand_verify_page(struct mtd_info *mtd, u_char * buf,
|
||||
loff_t addr, int block, int page)
|
||||
loff_t addr)
|
||||
{
|
||||
struct onenand_chip *this = mtd->priv;
|
||||
void __iomem *dataram0, *dataram1;
|
||||
@@ -783,7 +781,7 @@ static int onenand_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
|
||||
written += thislen;
|
||||
|
||||
/* Only check verify write turn on */
|
||||
ret = onenand_verify_page(mtd, (u_char *) buf, to, block, page);
|
||||
ret = onenand_verify_page(mtd, (u_char *) buf, to);
|
||||
if (ret) {
|
||||
MTDDEBUG (MTD_DEBUG_LEVEL0,
|
||||
"onenand_write_ecc: verify failed %d\n", ret);
|
||||
|
||||
@@ -205,7 +205,7 @@ static int dataflash_write_at45(struct spi_flash *flash,
|
||||
byte_addr = 0;
|
||||
}
|
||||
|
||||
debug("SF: AT45: Successfully programmed %u bytes @ 0x%x\n",
|
||||
debug("SF: AT45: Successfully programmed %zu bytes @ 0x%x\n",
|
||||
len, offset);
|
||||
ret = 0;
|
||||
|
||||
@@ -268,7 +268,7 @@ int dataflash_erase_at45(struct spi_flash *flash, u32 offset, size_t len)
|
||||
page_addr++;
|
||||
}
|
||||
|
||||
debug("SF: AT45: Successfully erased %u bytes @ 0x%x\n",
|
||||
debug("SF: AT45: Successfully erased %zu bytes @ 0x%x\n",
|
||||
len, offset);
|
||||
ret = 0;
|
||||
|
||||
@@ -351,7 +351,7 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
|
||||
* params->blocks_per_sector
|
||||
* params->nr_sectors;
|
||||
|
||||
debug("SF: Detected %s with page size %u, total %u bytes\n",
|
||||
debug("SF: Detected %s with page size %lu, total %u bytes\n",
|
||||
params->name, page_size, asf->flash.size);
|
||||
|
||||
return &asf->flash;
|
||||
|
||||
@@ -513,9 +513,11 @@ e1000_read_mac_addr(struct eth_device *nic)
|
||||
nic->enetaddr[5] += 1;
|
||||
}
|
||||
#ifdef CONFIG_E1000_FALLBACK_MAC
|
||||
if ( *(u32*)(nic->enetaddr) == 0 || *(u32*)(nic->enetaddr) == ~0 )
|
||||
for ( i=0; i < NODE_ADDRESS_SIZE; i++ )
|
||||
nic->enetaddr[i] = (CONFIG_E1000_FALLBACK_MAC >> (8*(5-i))) & 0xff;
|
||||
if ( *(u32*)(nic->enetaddr) == 0 || *(u32*)(nic->enetaddr) == ~0 ) {
|
||||
unsigned char fb_mac[NODE_ADDRESS_SIZE] = CONFIG_E1000_FALLBACK_MAC;
|
||||
|
||||
memcpy (nic->enetaddr, fb_mac, NODE_ADDRESS_SIZE);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
/*
|
||||
@@ -531,10 +533,9 @@ e1000_read_mac_addr(struct eth_device *nic)
|
||||
DEBUGFUNC();
|
||||
|
||||
s = getenv ("ethaddr");
|
||||
if (s == NULL){
|
||||
if (s == NULL) {
|
||||
return -E1000_ERR_EEPROM;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
for(ii = 0; ii < 6; ii++) {
|
||||
nic->enetaddr[ii] = s ? simple_strtoul (s, &e, 16) : 0;
|
||||
if (s){
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "uccf.h"
|
||||
#include "uec.h"
|
||||
#include "uec_phy.h"
|
||||
#include "miiphy.h"
|
||||
|
||||
#if defined(CONFIG_QE)
|
||||
|
||||
@@ -125,6 +126,13 @@ static uec_info_t eth4_uec_info = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#define MAXCONTROLLERS (4)
|
||||
|
||||
static struct eth_device *devlist[MAXCONTROLLERS];
|
||||
|
||||
u16 phy_read (struct uec_mii_info *mii_info, u16 regnum);
|
||||
void phy_write (struct uec_mii_info *mii_info, u16 regnum, u16 val);
|
||||
|
||||
static int uec_mac_enable(uec_private_t *uec, comm_dir_e mode)
|
||||
{
|
||||
uec_t *uec_regs;
|
||||
@@ -629,6 +637,39 @@ static void phy_change(struct eth_device *dev)
|
||||
adjust_link(dev);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
|
||||
&& !defined(BITBANGMII)
|
||||
|
||||
/*
|
||||
* Read a MII PHY register.
|
||||
*
|
||||
* Returns:
|
||||
* 0 on success
|
||||
*/
|
||||
static int uec_miiphy_read(char *devname, unsigned char addr,
|
||||
unsigned char reg, unsigned short *value)
|
||||
{
|
||||
*value = uec_read_phy_reg(devlist[0], addr, reg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a MII PHY register.
|
||||
*
|
||||
* Returns:
|
||||
* 0 on success
|
||||
*/
|
||||
static int uec_miiphy_write(char *devname, unsigned char addr,
|
||||
unsigned char reg, unsigned short value)
|
||||
{
|
||||
uec_write_phy_reg(devlist[0], addr, reg, value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int uec_set_mac_address(uec_private_t *uec, u8 *mac_addr)
|
||||
{
|
||||
uec_t *uec_regs;
|
||||
@@ -1334,6 +1375,8 @@ int uec_initialize(int index)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
devlist[index] = dev;
|
||||
|
||||
uec->uec_info = uec_info;
|
||||
|
||||
sprintf(dev->name, "FSL UEC%d", index);
|
||||
@@ -1356,6 +1399,13 @@ int uec_initialize(int index)
|
||||
return err;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
|
||||
&& !defined(BITBANGMII)
|
||||
miiphy_register(dev->name, uec_miiphy_read, uec_miiphy_write);
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#endif /* CONFIG_QE */
|
||||
|
||||
@@ -25,18 +25,18 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB := $(obj)libserial.a
|
||||
|
||||
COBJS-y += atmel_usart.o
|
||||
COBJS-y += mcfuart.o
|
||||
COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
|
||||
COBJS-$(CONFIG_MCFUART) += mcfuart.o
|
||||
COBJS-y += ns9750_serial.o
|
||||
COBJS-y += ns16550.o
|
||||
COBJS-y += s3c4510b_uart.o
|
||||
COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
|
||||
COBJS-y += serial.o
|
||||
COBJS-y += serial_max3100.o
|
||||
COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
|
||||
COBJS-y += serial_pl010.o
|
||||
COBJS-y += serial_pl011.o
|
||||
COBJS-y += serial_xuartlite.o
|
||||
COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
|
||||
COBJS-y += serial_sh.o
|
||||
COBJS-y += usbtty.o
|
||||
COBJS-$(CONFIG_USB_TTY) += usbtty.o
|
||||
|
||||
COBJS := $(COBJS-y)
|
||||
SRCS := $(COBJS:.o=.c)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
#include <common.h>
|
||||
|
||||
#ifdef CONFIG_ATMEL_USART
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/clk.h>
|
||||
#include <asm/arch/memory-map.h>
|
||||
@@ -96,5 +95,3 @@ int serial_tstc(void)
|
||||
{
|
||||
return (usart3_readl(CSR) & USART3_BIT(RXRDY)) != 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ATMEL_USART */
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#ifdef CONFIG_MCFUART
|
||||
|
||||
#include <asm/immap.h>
|
||||
#include <asm/uart.h>
|
||||
|
||||
@@ -130,4 +128,3 @@ void serial_setbrg(void)
|
||||
|
||||
uart->ucr = UART_UCR_RX_ENABLED | UART_UCR_TX_ENABLED;
|
||||
}
|
||||
#endif /* CONFIG_MCFUART */
|
||||
|
||||
@@ -45,8 +45,6 @@
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#ifdef CONFIG_DRIVER_S3C4510_UART
|
||||
|
||||
#include <asm/hardware.h>
|
||||
#include "s3c4510b_uart.h"
|
||||
|
||||
@@ -212,5 +210,3 @@ void serial_puts (const char *s)
|
||||
uart->m_ctrl.bf.sendBreak = 0;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <common.h>
|
||||
#include <watchdog.h>
|
||||
|
||||
#ifdef CONFIG_MAX3100_SERIAL
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/**************************************************************/
|
||||
@@ -298,5 +296,3 @@ int serial_tstc(void)
|
||||
void serial_setbrg(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#include <config.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#ifdef CONFIG_XILINX_UARTLITE
|
||||
|
||||
#define RX_FIFO_OFFSET 0 /* receive FIFO, read only */
|
||||
#define TX_FIFO_OFFSET 4 /* transmit FIFO, write only */
|
||||
#define STATUS_REG_OFFSET 8 /* status register, read only */
|
||||
@@ -56,8 +54,8 @@ void serial_putc(const char c)
|
||||
{
|
||||
if (c == '\n')
|
||||
serial_putc('\r');
|
||||
while (in_be32(UARTLITE_STATUS) & SR_TX_FIFO_FULL);
|
||||
out_be32(UARTLITE_TX_FIFO, (unsigned char) (c & 0xff));
|
||||
while (in_be32((u32 *) UARTLITE_STATUS) & SR_TX_FIFO_FULL);
|
||||
out_be32((u32 *) UARTLITE_TX_FIFO, (unsigned char) (c & 0xff));
|
||||
}
|
||||
|
||||
void serial_puts(const char * s)
|
||||
@@ -69,13 +67,11 @@ void serial_puts(const char * s)
|
||||
|
||||
int serial_getc(void)
|
||||
{
|
||||
while (!(in_be32(UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA));
|
||||
return in_be32(UARTLITE_RX_FIFO) & 0xff;
|
||||
while (!(in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA));
|
||||
return in_be32((u32 *) UARTLITE_RX_FIFO) & 0xff;
|
||||
}
|
||||
|
||||
int serial_tstc(void)
|
||||
{
|
||||
return (in_be32(UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA);
|
||||
return (in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MICROBLZE */
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#ifdef CONFIG_USB_TTY
|
||||
|
||||
#include <circbuf.h>
|
||||
#include <devices.h>
|
||||
#include "usbtty.h"
|
||||
@@ -1007,6 +1005,3 @@ void usbtty_poll (void)
|
||||
udc_irq();
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,6 +25,8 @@ include $(TOPDIR)/config.mk
|
||||
|
||||
LIB := $(obj)libusb.a
|
||||
|
||||
COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
|
||||
|
||||
COBJS-y += isp116x-hcd.o
|
||||
COBJS-y += sl811_usb.o
|
||||
COBJS-y += usb_ohci.o
|
||||
|
||||
919
drivers/usb/r8a66597-hcd.c
Normal file
919
drivers/usb/r8a66597-hcd.c
Normal file
@@ -0,0 +1,919 @@
|
||||
/*
|
||||
* R8A66597 HCD (Host Controller Driver) for u-boot
|
||||
*
|
||||
* Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
|
||||
*
|
||||
* 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; version 2 of the License.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <usb.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include "r8a66597.h"
|
||||
|
||||
#ifdef R8A66597_DEBUG
|
||||
#define R8A66597_DPRINT printf
|
||||
#else
|
||||
#define R8A66597_DPRINT(...)
|
||||
#endif
|
||||
|
||||
static const char hcd_name[] = "r8a66597_hcd";
|
||||
static unsigned short clock = CONFIG_R8A66597_XTAL;
|
||||
static unsigned short vif = CONFIG_R8A66597_LDRV;
|
||||
static unsigned short endian = CONFIG_R8A66597_ENDIAN;
|
||||
static struct r8a66597 gr8a66597;
|
||||
|
||||
static void set_devadd_reg(struct r8a66597 *r8a66597, u8 r8a66597_address,
|
||||
u16 usbspd, u8 upphub, u8 hubport, int port)
|
||||
{
|
||||
u16 val;
|
||||
unsigned long devadd_reg = get_devadd_addr(r8a66597_address);
|
||||
|
||||
val = (upphub << 11) | (hubport << 8) | (usbspd << 6) | (port & 0x0001);
|
||||
r8a66597_write(r8a66597, val, devadd_reg);
|
||||
}
|
||||
|
||||
static int r8a66597_clock_enable(struct r8a66597 *r8a66597)
|
||||
{
|
||||
u16 tmp;
|
||||
int i = 0;
|
||||
|
||||
#if defined(CONFIG_SUPERH_ON_CHIP_R8A66597)
|
||||
do {
|
||||
r8a66597_write(r8a66597, SCKE, SYSCFG0);
|
||||
tmp = r8a66597_read(r8a66597, SYSCFG0);
|
||||
if (i++ > 1000) {
|
||||
printf("register access fail.\n");
|
||||
return -1;
|
||||
}
|
||||
} while ((tmp & SCKE) != SCKE);
|
||||
r8a66597_write(r8a66597, 0x04, 0x02);
|
||||
#else
|
||||
do {
|
||||
r8a66597_write(r8a66597, USBE, SYSCFG0);
|
||||
tmp = r8a66597_read(r8a66597, SYSCFG0);
|
||||
if (i++ > 1000) {
|
||||
printf("register access fail.\n");
|
||||
return -1;
|
||||
}
|
||||
} while ((tmp & USBE) != USBE);
|
||||
r8a66597_bclr(r8a66597, USBE, SYSCFG0);
|
||||
r8a66597_mdfy(r8a66597, clock, XTAL, SYSCFG0);
|
||||
|
||||
i = 0;
|
||||
r8a66597_bset(r8a66597, XCKE, SYSCFG0);
|
||||
do {
|
||||
udelay(1000);
|
||||
tmp = r8a66597_read(r8a66597, SYSCFG0);
|
||||
if (i++ > 500) {
|
||||
printf("register access fail.\n");
|
||||
return -1;
|
||||
}
|
||||
} while ((tmp & SCKE) != SCKE);
|
||||
#endif /* #if defined(CONFIG_SUPERH_ON_CHIP_R8A66597) */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void r8a66597_clock_disable(struct r8a66597 *r8a66597)
|
||||
{
|
||||
r8a66597_bclr(r8a66597, SCKE, SYSCFG0);
|
||||
udelay(1);
|
||||
#if !defined(CONFIG_SUPERH_ON_CHIP_R8A66597)
|
||||
r8a66597_bclr(r8a66597, PLLC, SYSCFG0);
|
||||
r8a66597_bclr(r8a66597, XCKE, SYSCFG0);
|
||||
r8a66597_bclr(r8a66597, USBE, SYSCFG0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void r8a66597_enable_port(struct r8a66597 *r8a66597, int port)
|
||||
{
|
||||
u16 val;
|
||||
|
||||
val = port ? DRPD : DCFM | DRPD;
|
||||
r8a66597_bset(r8a66597, val, get_syscfg_reg(port));
|
||||
r8a66597_bset(r8a66597, HSE, get_syscfg_reg(port));
|
||||
|
||||
r8a66597_write(r8a66597, BURST | CPU_ADR_RD_WR, get_dmacfg_reg(port));
|
||||
}
|
||||
|
||||
static void r8a66597_disable_port(struct r8a66597 *r8a66597, int port)
|
||||
{
|
||||
u16 val, tmp;
|
||||
|
||||
r8a66597_write(r8a66597, 0, get_intenb_reg(port));
|
||||
r8a66597_write(r8a66597, 0, get_intsts_reg(port));
|
||||
|
||||
r8a66597_port_power(r8a66597, port, 0);
|
||||
|
||||
do {
|
||||
tmp = r8a66597_read(r8a66597, SOFCFG) & EDGESTS;
|
||||
udelay(640);
|
||||
} while (tmp == EDGESTS);
|
||||
|
||||
val = port ? DRPD : DCFM | DRPD;
|
||||
r8a66597_bclr(r8a66597, val, get_syscfg_reg(port));
|
||||
r8a66597_bclr(r8a66597, HSE, get_syscfg_reg(port));
|
||||
}
|
||||
|
||||
static int enable_controller(struct r8a66597 *r8a66597)
|
||||
{
|
||||
int ret, port;
|
||||
|
||||
ret = r8a66597_clock_enable(r8a66597);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
r8a66597_bset(r8a66597, vif & LDRV, PINCFG);
|
||||
r8a66597_bset(r8a66597, USBE, SYSCFG0);
|
||||
|
||||
r8a66597_bset(r8a66597, INTL, SOFCFG);
|
||||
r8a66597_write(r8a66597, 0, INTENB0);
|
||||
r8a66597_write(r8a66597, 0, INTENB1);
|
||||
r8a66597_write(r8a66597, 0, INTENB2);
|
||||
|
||||
r8a66597_bset(r8a66597, endian & BIGEND, CFIFOSEL);
|
||||
r8a66597_bset(r8a66597, endian & BIGEND, D0FIFOSEL);
|
||||
r8a66597_bset(r8a66597, endian & BIGEND, D1FIFOSEL);
|
||||
r8a66597_bset(r8a66597, TRNENSEL, SOFCFG);
|
||||
|
||||
for (port = 0; port < R8A66597_MAX_ROOT_HUB; port++)
|
||||
r8a66597_enable_port(r8a66597, port);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void disable_controller(struct r8a66597 *r8a66597)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!(r8a66597_read(r8a66597, SYSCFG0) & USBE))
|
||||
return;
|
||||
|
||||
r8a66597_write(r8a66597, 0, INTENB0);
|
||||
r8a66597_write(r8a66597, 0, INTSTS0);
|
||||
|
||||
r8a66597_write(r8a66597, 0, D0FIFOSEL);
|
||||
r8a66597_write(r8a66597, 0, D1FIFOSEL);
|
||||
r8a66597_write(r8a66597, 0, DCPCFG);
|
||||
r8a66597_write(r8a66597, 0x40, DCPMAXP);
|
||||
r8a66597_write(r8a66597, 0, DCPCTR);
|
||||
|
||||
for (i = 0; i <= 10; i++)
|
||||
r8a66597_write(r8a66597, 0, get_devadd_addr(i));
|
||||
for (i = 1; i <= 5; i++) {
|
||||
r8a66597_write(r8a66597, 0, get_pipetre_addr(i));
|
||||
r8a66597_write(r8a66597, 0, get_pipetrn_addr(i));
|
||||
}
|
||||
for (i = 1; i < R8A66597_MAX_NUM_PIPE; i++) {
|
||||
r8a66597_write(r8a66597, 0, get_pipectr_addr(i));
|
||||
r8a66597_write(r8a66597, i, PIPESEL);
|
||||
r8a66597_write(r8a66597, 0, PIPECFG);
|
||||
r8a66597_write(r8a66597, 0, PIPEBUF);
|
||||
r8a66597_write(r8a66597, 0, PIPEMAXP);
|
||||
r8a66597_write(r8a66597, 0, PIPEPERI);
|
||||
}
|
||||
|
||||
for (i = 0; i < R8A66597_MAX_ROOT_HUB; i++)
|
||||
r8a66597_disable_port(r8a66597, i);
|
||||
|
||||
r8a66597_clock_disable(r8a66597);
|
||||
}
|
||||
|
||||
static void r8a66597_reg_wait(struct r8a66597 *r8a66597, unsigned long reg,
|
||||
u16 mask, u16 loop)
|
||||
{
|
||||
u16 tmp;
|
||||
int i = 0;
|
||||
|
||||
do {
|
||||
tmp = r8a66597_read(r8a66597, reg);
|
||||
if (i++ > 1000000) {
|
||||
printf("register%lx, loop %x is timeout\n", reg, loop);
|
||||
break;
|
||||
}
|
||||
} while ((tmp & mask) != loop);
|
||||
}
|
||||
|
||||
static void pipe_buffer_setting(struct r8a66597 *r8a66597,
|
||||
struct usb_device *dev, unsigned long pipe)
|
||||
{
|
||||
u16 val = 0;
|
||||
u16 pipenum, bufnum, maxpacket;
|
||||
|
||||
if (usb_pipein(pipe)) {
|
||||
pipenum = BULK_IN_PIPENUM;
|
||||
bufnum = BULK_IN_BUFNUM;
|
||||
maxpacket = dev->epmaxpacketin[usb_pipeendpoint(pipe)];
|
||||
} else {
|
||||
pipenum = BULK_OUT_PIPENUM;
|
||||
bufnum = BULK_OUT_BUFNUM;
|
||||
maxpacket = dev->epmaxpacketout[usb_pipeendpoint(pipe)];
|
||||
}
|
||||
|
||||
if (r8a66597->pipe_config & (1 << pipenum))
|
||||
return;
|
||||
r8a66597->pipe_config |= (1 << pipenum);
|
||||
|
||||
r8a66597_bset(r8a66597, ACLRM, get_pipectr_addr(pipenum));
|
||||
r8a66597_bclr(r8a66597, ACLRM, get_pipectr_addr(pipenum));
|
||||
r8a66597_write(r8a66597, pipenum, PIPESEL);
|
||||
|
||||
/* FIXME: This driver support bulk transfer only. */
|
||||
if (!usb_pipein(pipe))
|
||||
val |= R8A66597_DIR;
|
||||
else
|
||||
val |= R8A66597_SHTNAK;
|
||||
val |= R8A66597_BULK | R8A66597_DBLB | usb_pipeendpoint(pipe);
|
||||
r8a66597_write(r8a66597, val, PIPECFG);
|
||||
|
||||
r8a66597_write(r8a66597, (8 << 10) | bufnum, PIPEBUF);
|
||||
r8a66597_write(r8a66597, make_devsel(usb_pipedevice(pipe)) |
|
||||
maxpacket, PIPEMAXP);
|
||||
r8a66597_write(r8a66597, 0, PIPEPERI);
|
||||
r8a66597_write(r8a66597, SQCLR, get_pipectr_addr(pipenum));
|
||||
}
|
||||
|
||||
static int send_setup_packet(struct r8a66597 *r8a66597, struct usb_device *dev,
|
||||
struct devrequest *setup)
|
||||
{
|
||||
int i;
|
||||
unsigned short *p = (unsigned short *)setup;
|
||||
unsigned long setup_addr = USBREQ;
|
||||
u16 intsts1;
|
||||
int timeout = 3000;
|
||||
u16 devsel = setup->request == USB_REQ_SET_ADDRESS ? 0 : dev->devnum;
|
||||
|
||||
r8a66597_write(r8a66597, make_devsel(devsel) |
|
||||
(8 << dev->maxpacketsize), DCPMAXP);
|
||||
r8a66597_write(r8a66597, ~(SIGN | SACK), INTSTS1);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
r8a66597_write(r8a66597, le16_to_cpu(p[i]), setup_addr);
|
||||
setup_addr += 2;
|
||||
}
|
||||
r8a66597_write(r8a66597, ~0x0001, BRDYSTS);
|
||||
r8a66597_write(r8a66597, SUREQ, DCPCTR);
|
||||
|
||||
while (1) {
|
||||
intsts1 = r8a66597_read(r8a66597, INTSTS1);
|
||||
if (intsts1 & SACK)
|
||||
break;
|
||||
if (intsts1 & SIGN) {
|
||||
printf("setup packet send error\n");
|
||||
return -1;
|
||||
}
|
||||
if (timeout-- < 0) {
|
||||
printf("setup packet timeout\n");
|
||||
return -1;
|
||||
}
|
||||
udelay(500);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int send_bulk_packet(struct r8a66597 *r8a66597, struct usb_device *dev,
|
||||
unsigned long pipe, void *buffer, int transfer_len)
|
||||
{
|
||||
u16 tmp, bufsize;
|
||||
u16 *buf;
|
||||
size_t size;
|
||||
|
||||
R8A66597_DPRINT("%s\n", __func__);
|
||||
|
||||
r8a66597_mdfy(r8a66597, MBW | BULK_OUT_PIPENUM,
|
||||
MBW | CURPIPE, CFIFOSEL);
|
||||
r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, BULK_OUT_PIPENUM);
|
||||
tmp = r8a66597_read(r8a66597, CFIFOCTR);
|
||||
if ((tmp & FRDY) == 0) {
|
||||
printf("%s FRDY is not set (%x)\n", __func__, tmp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* prepare parameters */
|
||||
bufsize = dev->epmaxpacketout[usb_pipeendpoint(pipe)];
|
||||
buf = (u16 *)(buffer + dev->act_len);
|
||||
size = min((int)bufsize, transfer_len - dev->act_len);
|
||||
|
||||
/* write fifo */
|
||||
r8a66597_write(r8a66597, ~(1 << BULK_OUT_PIPENUM), BEMPSTS);
|
||||
if (buffer) {
|
||||
r8a66597_write_fifo(r8a66597, CFIFO, buf, size);
|
||||
r8a66597_write(r8a66597, BVAL, CFIFOCTR);
|
||||
}
|
||||
|
||||
/* update parameters */
|
||||
dev->act_len += size;
|
||||
|
||||
r8a66597_mdfy(r8a66597, PID_BUF, PID,
|
||||
get_pipectr_addr(BULK_OUT_PIPENUM));
|
||||
|
||||
while (!(r8a66597_read(r8a66597, BEMPSTS) & (1 << BULK_OUT_PIPENUM)))
|
||||
if (ctrlc())
|
||||
return -1;
|
||||
r8a66597_write(r8a66597, ~(1 << BULK_OUT_PIPENUM), BEMPSTS);
|
||||
|
||||
if (dev->act_len >= transfer_len)
|
||||
r8a66597_mdfy(r8a66597, PID_NAK, PID,
|
||||
get_pipectr_addr(BULK_OUT_PIPENUM));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int receive_bulk_packet(struct r8a66597 *r8a66597,
|
||||
struct usb_device *dev,
|
||||
unsigned long pipe,
|
||||
void *buffer, int transfer_len)
|
||||
{
|
||||
u16 tmp;
|
||||
u16 *buf;
|
||||
const u16 pipenum = BULK_IN_PIPENUM;
|
||||
int rcv_len;
|
||||
int maxpacket = dev->epmaxpacketin[usb_pipeendpoint(pipe)];
|
||||
|
||||
R8A66597_DPRINT("%s\n", __func__);
|
||||
|
||||
/* prepare */
|
||||
if (dev->act_len == 0) {
|
||||
r8a66597_mdfy(r8a66597, PID_NAK, PID,
|
||||
get_pipectr_addr(pipenum));
|
||||
r8a66597_write(r8a66597, ~(1 << pipenum), BRDYSTS);
|
||||
|
||||
r8a66597_write(r8a66597, TRCLR, get_pipetre_addr(pipenum));
|
||||
r8a66597_write(r8a66597,
|
||||
(transfer_len + maxpacket - 1) / maxpacket,
|
||||
get_pipetrn_addr(pipenum));
|
||||
r8a66597_bset(r8a66597, TRENB, get_pipetre_addr(pipenum));
|
||||
|
||||
r8a66597_mdfy(r8a66597, PID_BUF, PID,
|
||||
get_pipectr_addr(pipenum));
|
||||
}
|
||||
|
||||
r8a66597_mdfy(r8a66597, MBW | pipenum, MBW | CURPIPE, CFIFOSEL);
|
||||
r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, pipenum);
|
||||
|
||||
while (!(r8a66597_read(r8a66597, BRDYSTS) & (1 << pipenum)))
|
||||
if (ctrlc())
|
||||
return -1;
|
||||
r8a66597_write(r8a66597, ~(1 << pipenum), BRDYSTS);
|
||||
|
||||
tmp = r8a66597_read(r8a66597, CFIFOCTR);
|
||||
if ((tmp & FRDY) == 0) {
|
||||
printf("%s FRDY is not set. (%x)\n", __func__, tmp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
buf = (u16 *)(buffer + dev->act_len);
|
||||
rcv_len = tmp & DTLN;
|
||||
dev->act_len += rcv_len;
|
||||
|
||||
if (buffer) {
|
||||
if (rcv_len == 0)
|
||||
r8a66597_write(r8a66597, BCLR, CFIFOCTR);
|
||||
else
|
||||
r8a66597_read_fifo(r8a66597, CFIFO, buf, rcv_len);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int receive_control_packet(struct r8a66597 *r8a66597,
|
||||
struct usb_device *dev,
|
||||
void *buffer, int transfer_len)
|
||||
{
|
||||
u16 tmp;
|
||||
int rcv_len;
|
||||
|
||||
/* FIXME: limit transfer size : 64byte or less */
|
||||
|
||||
r8a66597_bclr(r8a66597, R8A66597_DIR, DCPCFG);
|
||||
r8a66597_mdfy(r8a66597, 0, ISEL | CURPIPE, CFIFOSEL);
|
||||
r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
|
||||
r8a66597_bset(r8a66597, SQSET, DCPCTR);
|
||||
r8a66597_write(r8a66597, BCLR, CFIFOCTR);
|
||||
r8a66597_mdfy(r8a66597, PID_BUF, PID, DCPCTR);
|
||||
|
||||
while (!(r8a66597_read(r8a66597, BRDYSTS) & 0x0001))
|
||||
if (ctrlc())
|
||||
return -1;
|
||||
r8a66597_write(r8a66597, ~0x0001, BRDYSTS);
|
||||
|
||||
r8a66597_mdfy(r8a66597, MBW, MBW | CURPIPE, CFIFOSEL);
|
||||
r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
|
||||
|
||||
tmp = r8a66597_read(r8a66597, CFIFOCTR);
|
||||
if ((tmp & FRDY) == 0) {
|
||||
printf("%s FRDY is not set. (%x)\n", __func__, tmp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rcv_len = tmp & DTLN;
|
||||
dev->act_len += rcv_len;
|
||||
|
||||
r8a66597_mdfy(r8a66597, PID_NAK, PID, DCPCTR);
|
||||
|
||||
if (buffer) {
|
||||
if (rcv_len == 0)
|
||||
r8a66597_write(r8a66597, BCLR, DCPCTR);
|
||||
else
|
||||
r8a66597_read_fifo(r8a66597, CFIFO, buffer, rcv_len);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int send_status_packet(struct r8a66597 *r8a66597,
|
||||
unsigned long pipe)
|
||||
{
|
||||
r8a66597_bset(r8a66597, SQSET, DCPCTR);
|
||||
r8a66597_mdfy(r8a66597, PID_NAK, PID, DCPCTR);
|
||||
|
||||
if (usb_pipein(pipe)) {
|
||||
r8a66597_bset(r8a66597, R8A66597_DIR, DCPCFG);
|
||||
r8a66597_mdfy(r8a66597, ISEL, ISEL | CURPIPE, CFIFOSEL);
|
||||
r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
|
||||
r8a66597_write(r8a66597, ~BEMP0, BEMPSTS);
|
||||
r8a66597_write(r8a66597, BCLR | BVAL, CFIFOCTR);
|
||||
} else {
|
||||
r8a66597_bclr(r8a66597, R8A66597_DIR, DCPCFG);
|
||||
r8a66597_mdfy(r8a66597, 0, ISEL | CURPIPE, CFIFOSEL);
|
||||
r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, 0);
|
||||
r8a66597_write(r8a66597, BCLR, CFIFOCTR);
|
||||
}
|
||||
r8a66597_mdfy(r8a66597, PID_BUF, PID, DCPCTR);
|
||||
|
||||
while (!(r8a66597_read(r8a66597, BEMPSTS) & 0x0001))
|
||||
if (ctrlc())
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port)
|
||||
{
|
||||
int count = R8A66597_MAX_SAMPLING;
|
||||
unsigned short syssts, old_syssts;
|
||||
|
||||
R8A66597_DPRINT("%s\n", __func__);
|
||||
|
||||
old_syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST);
|
||||
while (count > 0) {
|
||||
wait_ms(R8A66597_RH_POLL_TIME);
|
||||
|
||||
syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST);
|
||||
if (syssts == old_syssts) {
|
||||
count--;
|
||||
} else {
|
||||
count = R8A66597_MAX_SAMPLING;
|
||||
old_syssts = syssts;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void r8a66597_bus_reset(struct r8a66597 *r8a66597, int port)
|
||||
{
|
||||
wait_ms(10);
|
||||
r8a66597_mdfy(r8a66597, USBRST, USBRST | UACT, get_dvstctr_reg(port));
|
||||
wait_ms(50);
|
||||
r8a66597_mdfy(r8a66597, UACT, USBRST | UACT, get_dvstctr_reg(port));
|
||||
wait_ms(50);
|
||||
}
|
||||
|
||||
static int check_usb_device_connecting(struct r8a66597 *r8a66597)
|
||||
{
|
||||
int timeout = 10000; /* 100usec * 10000 = 1sec */
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
/* check a usb cable connect */
|
||||
while (!(r8a66597_read(r8a66597, INTSTS1) & ATTCH)) {
|
||||
if (timeout-- < 0) {
|
||||
printf("%s timeout.\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
udelay(100);
|
||||
}
|
||||
|
||||
/* check a data line */
|
||||
r8a66597_check_syssts(r8a66597, 0);
|
||||
|
||||
r8a66597_bus_reset(r8a66597, 0);
|
||||
r8a66597->speed = get_rh_usb_speed(r8a66597, 0);
|
||||
|
||||
if (!(r8a66597_read(r8a66597, INTSTS1) & DTCH)) {
|
||||
r8a66597->port_change = USB_PORT_STAT_C_CONNECTION;
|
||||
r8a66597->port_status = USB_PORT_STAT_CONNECTION |
|
||||
USB_PORT_STAT_ENABLE;
|
||||
return 0; /* success */
|
||||
}
|
||||
|
||||
R8A66597_DPRINT("USB device has detached. retry = %d\n", i);
|
||||
r8a66597_write(r8a66597, ~DTCH, INTSTS1);
|
||||
}
|
||||
|
||||
return -1; /* fail */
|
||||
}
|
||||
|
||||
/* based on usb_ohci.c */
|
||||
#define min_t(type, x, y) \
|
||||
({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
|
||||
/*-------------------------------------------------------------------------*
|
||||
* Virtual Root Hub
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
/* Device descriptor */
|
||||
static __u8 root_hub_dev_des[] =
|
||||
{
|
||||
0x12, /* __u8 bLength; */
|
||||
0x01, /* __u8 bDescriptorType; Device */
|
||||
0x10, /* __u16 bcdUSB; v1.1 */
|
||||
0x01,
|
||||
0x09, /* __u8 bDeviceClass; HUB_CLASSCODE */
|
||||
0x00, /* __u8 bDeviceSubClass; */
|
||||
0x00, /* __u8 bDeviceProtocol; */
|
||||
0x08, /* __u8 bMaxPacketSize0; 8 Bytes */
|
||||
0x00, /* __u16 idVendor; */
|
||||
0x00,
|
||||
0x00, /* __u16 idProduct; */
|
||||
0x00,
|
||||
0x00, /* __u16 bcdDevice; */
|
||||
0x00,
|
||||
0x00, /* __u8 iManufacturer; */
|
||||
0x01, /* __u8 iProduct; */
|
||||
0x00, /* __u8 iSerialNumber; */
|
||||
0x01 /* __u8 bNumConfigurations; */
|
||||
};
|
||||
|
||||
/* Configuration descriptor */
|
||||
static __u8 root_hub_config_des[] =
|
||||
{
|
||||
0x09, /* __u8 bLength; */
|
||||
0x02, /* __u8 bDescriptorType; Configuration */
|
||||
0x19, /* __u16 wTotalLength; */
|
||||
0x00,
|
||||
0x01, /* __u8 bNumInterfaces; */
|
||||
0x01, /* __u8 bConfigurationValue; */
|
||||
0x00, /* __u8 iConfiguration; */
|
||||
0x40, /* __u8 bmAttributes; */
|
||||
|
||||
0x00, /* __u8 MaxPower; */
|
||||
|
||||
/* interface */
|
||||
0x09, /* __u8 if_bLength; */
|
||||
0x04, /* __u8 if_bDescriptorType; Interface */
|
||||
0x00, /* __u8 if_bInterfaceNumber; */
|
||||
0x00, /* __u8 if_bAlternateSetting; */
|
||||
0x01, /* __u8 if_bNumEndpoints; */
|
||||
0x09, /* __u8 if_bInterfaceClass; HUB_CLASSCODE */
|
||||
0x00, /* __u8 if_bInterfaceSubClass; */
|
||||
0x00, /* __u8 if_bInterfaceProtocol; */
|
||||
0x00, /* __u8 if_iInterface; */
|
||||
|
||||
/* endpoint */
|
||||
0x07, /* __u8 ep_bLength; */
|
||||
0x05, /* __u8 ep_bDescriptorType; Endpoint */
|
||||
0x81, /* __u8 ep_bEndpointAddress; IN Endpoint 1 */
|
||||
0x03, /* __u8 ep_bmAttributes; Interrupt */
|
||||
0x02, /* __u16 ep_wMaxPacketSize; ((MAX_ROOT_PORTS + 1) / 8 */
|
||||
0x00,
|
||||
0xff /* __u8 ep_bInterval; 255 ms */
|
||||
};
|
||||
|
||||
static unsigned char root_hub_str_index0[] =
|
||||
{
|
||||
0x04, /* __u8 bLength; */
|
||||
0x03, /* __u8 bDescriptorType; String-descriptor */
|
||||
0x09, /* __u8 lang ID */
|
||||
0x04, /* __u8 lang ID */
|
||||
};
|
||||
|
||||
static unsigned char root_hub_str_index1[] =
|
||||
{
|
||||
34, /* __u8 bLength; */
|
||||
0x03, /* __u8 bDescriptorType; String-descriptor */
|
||||
'R', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'8', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'A', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'6', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'6', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'5', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'9', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'7', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
' ', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'R', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'o', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'o', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
't', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'H', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'u', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
'b', /* __u8 Unicode */
|
||||
0, /* __u8 Unicode */
|
||||
};
|
||||
|
||||
static int r8a66597_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
|
||||
void *buffer, int transfer_len, struct devrequest *cmd)
|
||||
{
|
||||
struct r8a66597 *r8a66597 = &gr8a66597;
|
||||
int leni = transfer_len;
|
||||
int len = 0;
|
||||
int stat = 0;
|
||||
__u16 bmRType_bReq;
|
||||
__u16 wValue;
|
||||
__u16 wIndex;
|
||||
__u16 wLength;
|
||||
unsigned char data[32];
|
||||
|
||||
R8A66597_DPRINT("%s\n", __func__);
|
||||
|
||||
if ((pipe & PIPE_INTERRUPT) == PIPE_INTERRUPT) {
|
||||
printf("Root-Hub submit IRQ: NOT implemented");
|
||||
return 0;
|
||||
}
|
||||
|
||||
bmRType_bReq = cmd->requesttype | (cmd->request << 8);
|
||||
wValue = cpu_to_le16 (cmd->value);
|
||||
wIndex = cpu_to_le16 (cmd->index);
|
||||
wLength = cpu_to_le16 (cmd->length);
|
||||
|
||||
switch (bmRType_bReq) {
|
||||
case RH_GET_STATUS:
|
||||
*(__u16 *)buffer = cpu_to_le16(1);
|
||||
len = 2;
|
||||
break;
|
||||
case RH_GET_STATUS | RH_INTERFACE:
|
||||
*(__u16 *)buffer = cpu_to_le16(0);
|
||||
len = 2;
|
||||
break;
|
||||
case RH_GET_STATUS | RH_ENDPOINT:
|
||||
*(__u16 *)buffer = cpu_to_le16(0);
|
||||
len = 2;
|
||||
break;
|
||||
case RH_GET_STATUS | RH_CLASS:
|
||||
*(__u32 *)buffer = cpu_to_le32(0);
|
||||
len = 4;
|
||||
break;
|
||||
case RH_GET_STATUS | RH_OTHER | RH_CLASS:
|
||||
*(__u32 *)buffer = cpu_to_le32(r8a66597->port_status |
|
||||
(r8a66597->port_change << 16));
|
||||
len = 4;
|
||||
break;
|
||||
case RH_CLEAR_FEATURE | RH_ENDPOINT:
|
||||
case RH_CLEAR_FEATURE | RH_CLASS:
|
||||
break;
|
||||
|
||||
case RH_CLEAR_FEATURE | RH_OTHER | RH_CLASS:
|
||||
switch (wValue) {
|
||||
case RH_C_PORT_CONNECTION:
|
||||
r8a66597->port_change &= ~USB_PORT_STAT_C_CONNECTION;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case RH_SET_FEATURE | RH_OTHER | RH_CLASS:
|
||||
switch (wValue) {
|
||||
case (RH_PORT_SUSPEND):
|
||||
break;
|
||||
case (RH_PORT_RESET):
|
||||
r8a66597_bus_reset(r8a66597, 0);
|
||||
break;
|
||||
case (RH_PORT_POWER):
|
||||
break;
|
||||
case (RH_PORT_ENABLE):
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case RH_SET_ADDRESS:
|
||||
gr8a66597.rh_devnum = wValue;
|
||||
break;
|
||||
case RH_GET_DESCRIPTOR:
|
||||
switch ((wValue & 0xff00) >> 8) {
|
||||
case (0x01): /* device descriptor */
|
||||
len = min_t(unsigned int,
|
||||
leni,
|
||||
min_t(unsigned int,
|
||||
sizeof(root_hub_dev_des),
|
||||
wLength));
|
||||
memcpy(buffer, root_hub_dev_des, len);
|
||||
break;
|
||||
case (0x02): /* configuration descriptor */
|
||||
len = min_t(unsigned int,
|
||||
leni,
|
||||
min_t(unsigned int,
|
||||
sizeof(root_hub_config_des),
|
||||
wLength));
|
||||
memcpy(buffer, root_hub_config_des, len);
|
||||
break;
|
||||
case (0x03): /* string descriptors */
|
||||
if (wValue == 0x0300) {
|
||||
len = min_t(unsigned int,
|
||||
leni,
|
||||
min_t(unsigned int,
|
||||
sizeof(root_hub_str_index0),
|
||||
wLength));
|
||||
memcpy(buffer, root_hub_str_index0, len);
|
||||
}
|
||||
if (wValue == 0x0301) {
|
||||
len = min_t(unsigned int,
|
||||
leni,
|
||||
min_t(unsigned int,
|
||||
sizeof(root_hub_str_index1),
|
||||
wLength));
|
||||
memcpy(buffer, root_hub_str_index1, len);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
stat = USB_ST_STALLED;
|
||||
}
|
||||
break;
|
||||
|
||||
case RH_GET_DESCRIPTOR | RH_CLASS:
|
||||
{
|
||||
__u32 temp = 0x00000001;
|
||||
|
||||
data[0] = 9; /* min length; */
|
||||
data[1] = 0x29;
|
||||
data[2] = temp & RH_A_NDP;
|
||||
data[3] = 0;
|
||||
if (temp & RH_A_PSM)
|
||||
data[3] |= 0x1;
|
||||
if (temp & RH_A_NOCP)
|
||||
data[3] |= 0x10;
|
||||
else if (temp & RH_A_OCPM)
|
||||
data[3] |= 0x8;
|
||||
|
||||
/* corresponds to data[4-7] */
|
||||
data[5] = (temp & RH_A_POTPGT) >> 24;
|
||||
data[7] = temp & RH_B_DR;
|
||||
if (data[2] < 7) {
|
||||
data[8] = 0xff;
|
||||
} else {
|
||||
data[0] += 2;
|
||||
data[8] = (temp & RH_B_DR) >> 8;
|
||||
data[10] = data[9] = 0xff;
|
||||
}
|
||||
|
||||
len = min_t(unsigned int, leni,
|
||||
min_t(unsigned int, data[0], wLength));
|
||||
memcpy(buffer, data, len);
|
||||
break;
|
||||
}
|
||||
|
||||
case RH_GET_CONFIGURATION:
|
||||
*(__u8 *) buffer = 0x01;
|
||||
len = 1;
|
||||
break;
|
||||
case RH_SET_CONFIGURATION:
|
||||
break;
|
||||
default:
|
||||
dbg("unsupported root hub command");
|
||||
stat = USB_ST_STALLED;
|
||||
}
|
||||
|
||||
wait_ms(1);
|
||||
|
||||
len = min_t(int, len, leni);
|
||||
|
||||
dev->act_len = len;
|
||||
dev->status = stat;
|
||||
|
||||
return stat;
|
||||
}
|
||||
|
||||
int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
|
||||
int transfer_len)
|
||||
{
|
||||
struct r8a66597 *r8a66597 = &gr8a66597;
|
||||
int ret = 0;
|
||||
|
||||
R8A66597_DPRINT("%s\n", __func__);
|
||||
R8A66597_DPRINT("pipe = %08x, buffer = %p, len = %d, devnum = %d\n",
|
||||
pipe, buffer, transfer_len, dev->devnum);
|
||||
|
||||
set_devadd_reg(r8a66597, dev->devnum, r8a66597->speed, 0, 0, 0);
|
||||
|
||||
pipe_buffer_setting(r8a66597, dev, pipe);
|
||||
|
||||
dev->act_len = 0;
|
||||
while (dev->act_len < transfer_len && ret == 0) {
|
||||
if (ctrlc())
|
||||
return -1;
|
||||
|
||||
if (usb_pipein(pipe))
|
||||
ret = receive_bulk_packet(r8a66597, dev, pipe, buffer,
|
||||
transfer_len);
|
||||
else
|
||||
ret = send_bulk_packet(r8a66597, dev, pipe, buffer,
|
||||
transfer_len);
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
dev->status = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int submit_control_msg(struct usb_device *dev, unsigned long pipe,
|
||||
void *buffer, int transfer_len, struct devrequest *setup)
|
||||
{
|
||||
struct r8a66597 *r8a66597 = &gr8a66597;
|
||||
u16 r8a66597_address = setup->request == USB_REQ_SET_ADDRESS ?
|
||||
0 : dev->devnum;
|
||||
|
||||
R8A66597_DPRINT("%s\n", __func__);
|
||||
if (usb_pipedevice(pipe) == r8a66597->rh_devnum)
|
||||
return r8a66597_submit_rh_msg(dev, pipe, buffer, transfer_len,
|
||||
setup);
|
||||
|
||||
R8A66597_DPRINT("%s: setup\n", __func__);
|
||||
set_devadd_reg(r8a66597, r8a66597_address, r8a66597->speed, 0, 0, 0);
|
||||
|
||||
if (send_setup_packet(r8a66597, dev, setup) < 0) {
|
||||
printf("setup packet send error\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (usb_pipein(pipe))
|
||||
if (receive_control_packet(r8a66597, dev, buffer,
|
||||
transfer_len) < 0)
|
||||
return -1;
|
||||
|
||||
if (send_status_packet(r8a66597, pipe) < 0)
|
||||
return -1;
|
||||
|
||||
dev->status = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
|
||||
int transfer_len, int interval)
|
||||
{
|
||||
/* no implement */
|
||||
R8A66597_DPRINT("%s\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void usb_event_poll(void)
|
||||
{
|
||||
/* no implement */
|
||||
R8A66597_DPRINT("%s\n", __func__);
|
||||
}
|
||||
|
||||
int usb_lowlevel_init(void)
|
||||
{
|
||||
struct r8a66597 *r8a66597 = &gr8a66597;
|
||||
|
||||
R8A66597_DPRINT("%s\n", __func__);
|
||||
|
||||
memset(r8a66597, 0, sizeof(r8a66597));
|
||||
r8a66597->reg = CONFIG_R8A66597_BASE_ADDR;
|
||||
|
||||
disable_controller(r8a66597);
|
||||
wait_ms(100);
|
||||
|
||||
enable_controller(r8a66597);
|
||||
r8a66597_port_power(r8a66597, 0 , 1);
|
||||
|
||||
/* check usb device */
|
||||
check_usb_device_connecting(r8a66597);
|
||||
|
||||
wait_ms(50);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usb_lowlevel_stop(void)
|
||||
{
|
||||
disable_controller(&gr8a66597);
|
||||
|
||||
return 0;
|
||||
}
|
||||
659
drivers/usb/r8a66597.h
Normal file
659
drivers/usb/r8a66597.h
Normal file
@@ -0,0 +1,659 @@
|
||||
/*
|
||||
* R8A66597 HCD (Host Controller Driver) for u-boot
|
||||
*
|
||||
* Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
|
||||
*
|
||||
* 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; version 2 of the License.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __R8A66597_H__
|
||||
#define __R8A66597_H__
|
||||
|
||||
#define SYSCFG0 0x00
|
||||
#define SYSCFG1 0x02
|
||||
#define SYSSTS0 0x04
|
||||
#define SYSSTS1 0x06
|
||||
#define DVSTCTR0 0x08
|
||||
#define DVSTCTR1 0x0A
|
||||
#define TESTMODE 0x0C
|
||||
#define PINCFG 0x0E
|
||||
#define DMA0CFG 0x10
|
||||
#define DMA1CFG 0x12
|
||||
#define CFIFO 0x14
|
||||
#define D0FIFO 0x18
|
||||
#define D1FIFO 0x1C
|
||||
#define CFIFOSEL 0x20
|
||||
#define CFIFOCTR 0x22
|
||||
#define CFIFOSIE 0x24
|
||||
#define D0FIFOSEL 0x28
|
||||
#define D0FIFOCTR 0x2A
|
||||
#define D1FIFOSEL 0x2C
|
||||
#define D1FIFOCTR 0x2E
|
||||
#define INTENB0 0x30
|
||||
#define INTENB1 0x32
|
||||
#define INTENB2 0x34
|
||||
#define BRDYENB 0x36
|
||||
#define NRDYENB 0x38
|
||||
#define BEMPENB 0x3A
|
||||
#define SOFCFG 0x3C
|
||||
#define INTSTS0 0x40
|
||||
#define INTSTS1 0x42
|
||||
#define INTSTS2 0x44
|
||||
#define BRDYSTS 0x46
|
||||
#define NRDYSTS 0x48
|
||||
#define BEMPSTS 0x4A
|
||||
#define FRMNUM 0x4C
|
||||
#define UFRMNUM 0x4E
|
||||
#define USBADDR 0x50
|
||||
#define USBREQ 0x54
|
||||
#define USBVAL 0x56
|
||||
#define USBINDX 0x58
|
||||
#define USBLENG 0x5A
|
||||
#define DCPCFG 0x5C
|
||||
#define DCPMAXP 0x5E
|
||||
#define DCPCTR 0x60
|
||||
#define PIPESEL 0x64
|
||||
#define PIPECFG 0x68
|
||||
#define PIPEBUF 0x6A
|
||||
#define PIPEMAXP 0x6C
|
||||
#define PIPEPERI 0x6E
|
||||
#define PIPE1CTR 0x70
|
||||
#define PIPE2CTR 0x72
|
||||
#define PIPE3CTR 0x74
|
||||
#define PIPE4CTR 0x76
|
||||
#define PIPE5CTR 0x78
|
||||
#define PIPE6CTR 0x7A
|
||||
#define PIPE7CTR 0x7C
|
||||
#define PIPE8CTR 0x7E
|
||||
#define PIPE9CTR 0x80
|
||||
#define PIPE1TRE 0x90
|
||||
#define PIPE1TRN 0x92
|
||||
#define PIPE2TRE 0x94
|
||||
#define PIPE2TRN 0x96
|
||||
#define PIPE3TRE 0x98
|
||||
#define PIPE3TRN 0x9A
|
||||
#define PIPE4TRE 0x9C
|
||||
#define PIPE4TRN 0x9E
|
||||
#define PIPE5TRE 0xA0
|
||||
#define PIPE5TRN 0xA2
|
||||
#define DEVADD0 0xD0
|
||||
#define DEVADD1 0xD2
|
||||
#define DEVADD2 0xD4
|
||||
#define DEVADD3 0xD6
|
||||
#define DEVADD4 0xD8
|
||||
#define DEVADD5 0xDA
|
||||
#define DEVADD6 0xDC
|
||||
#define DEVADD7 0xDE
|
||||
#define DEVADD8 0xE0
|
||||
#define DEVADD9 0xE2
|
||||
#define DEVADDA 0xE4
|
||||
|
||||
/* System Configuration Control Register */
|
||||
#define XTAL 0xC000 /* b15-14: Crystal selection */
|
||||
#define XTAL48 0x8000 /* 48MHz */
|
||||
#define XTAL24 0x4000 /* 24MHz */
|
||||
#define XTAL12 0x0000 /* 12MHz */
|
||||
#define XCKE 0x2000 /* b13: External clock enable */
|
||||
#define PLLC 0x0800 /* b11: PLL control */
|
||||
#define SCKE 0x0400 /* b10: USB clock enable */
|
||||
#define PCSDIS 0x0200 /* b9: not CS wakeup */
|
||||
#define LPSME 0x0100 /* b8: Low power sleep mode */
|
||||
#define HSE 0x0080 /* b7: Hi-speed enable */
|
||||
#define DCFM 0x0040 /* b6: Controller function select */
|
||||
#define DRPD 0x0020 /* b5: D+/- pull down control */
|
||||
#define DPRPU 0x0010 /* b4: D+ pull up control */
|
||||
#define USBE 0x0001 /* b0: USB module operation enable */
|
||||
|
||||
/* System Configuration Status Register */
|
||||
#define OVCBIT 0x8000 /* b15-14: Over-current bit */
|
||||
#define OVCMON 0xC000 /* b15-14: Over-current monitor */
|
||||
#define SOFEA 0x0020 /* b5: SOF monitor */
|
||||
#define IDMON 0x0004 /* b3: ID-pin monitor */
|
||||
#define LNST 0x0003 /* b1-0: D+, D- line status */
|
||||
#define SE1 0x0003 /* SE1 */
|
||||
#define FS_KSTS 0x0002 /* Full-Speed K State */
|
||||
#define FS_JSTS 0x0001 /* Full-Speed J State */
|
||||
#define LS_JSTS 0x0002 /* Low-Speed J State */
|
||||
#define LS_KSTS 0x0001 /* Low-Speed K State */
|
||||
#define SE0 0x0000 /* SE0 */
|
||||
|
||||
/* Device State Control Register */
|
||||
#define EXTLP0 0x0400 /* b10: External port */
|
||||
#define VBOUT 0x0200 /* b9: VBUS output */
|
||||
#define WKUP 0x0100 /* b8: Remote wakeup */
|
||||
#define RWUPE 0x0080 /* b7: Remote wakeup sense */
|
||||
#define USBRST 0x0040 /* b6: USB reset enable */
|
||||
#define RESUME 0x0020 /* b5: Resume enable */
|
||||
#define UACT 0x0010 /* b4: USB bus enable */
|
||||
#define RHST 0x0007 /* b1-0: Reset handshake status */
|
||||
#define HSPROC 0x0004 /* HS handshake is processing */
|
||||
#define HSMODE 0x0003 /* Hi-Speed mode */
|
||||
#define FSMODE 0x0002 /* Full-Speed mode */
|
||||
#define LSMODE 0x0001 /* Low-Speed mode */
|
||||
#define UNDECID 0x0000 /* Undecided */
|
||||
|
||||
/* Test Mode Register */
|
||||
#define UTST 0x000F /* b3-0: Test select */
|
||||
#define H_TST_PACKET 0x000C /* HOST TEST Packet */
|
||||
#define H_TST_SE0_NAK 0x000B /* HOST TEST SE0 NAK */
|
||||
#define H_TST_K 0x000A /* HOST TEST K */
|
||||
#define H_TST_J 0x0009 /* HOST TEST J */
|
||||
#define H_TST_NORMAL 0x0000 /* HOST Normal Mode */
|
||||
#define P_TST_PACKET 0x0004 /* PERI TEST Packet */
|
||||
#define P_TST_SE0_NAK 0x0003 /* PERI TEST SE0 NAK */
|
||||
#define P_TST_K 0x0002 /* PERI TEST K */
|
||||
#define P_TST_J 0x0001 /* PERI TEST J */
|
||||
#define P_TST_NORMAL 0x0000 /* PERI Normal Mode */
|
||||
|
||||
/* Data Pin Configuration Register */
|
||||
#define LDRV 0x8000 /* b15: Drive Current Adjust */
|
||||
#define VIF1 0x0000 /* VIF = 1.8V */
|
||||
#define VIF3 0x8000 /* VIF = 3.3V */
|
||||
#define INTA 0x0001 /* b1: USB INT-pin active */
|
||||
|
||||
/* DMAx Pin Configuration Register */
|
||||
#define DREQA 0x4000 /* b14: Dreq active select */
|
||||
#define BURST 0x2000 /* b13: Burst mode */
|
||||
#define DACKA 0x0400 /* b10: Dack active select */
|
||||
#define DFORM 0x0380 /* b9-7: DMA mode select */
|
||||
#define CPU_ADR_RD_WR 0x0000 /* Address + RD/WR mode (CPU bus) */
|
||||
#define CPU_DACK_RD_WR 0x0100 /* DACK + RD/WR mode (CPU bus) */
|
||||
#define CPU_DACK_ONLY 0x0180 /* DACK only mode (CPU bus) */
|
||||
#define SPLIT_DACK_ONLY 0x0200 /* DACK only mode (SPLIT bus) */
|
||||
#define DENDA 0x0040 /* b6: Dend active select */
|
||||
#define PKTM 0x0020 /* b5: Packet mode */
|
||||
#define DENDE 0x0010 /* b4: Dend enable */
|
||||
#define OBUS 0x0004 /* b2: OUTbus mode */
|
||||
|
||||
/* CFIFO/DxFIFO Port Select Register */
|
||||
#define RCNT 0x8000 /* b15: Read count mode */
|
||||
#define REW 0x4000 /* b14: Buffer rewind */
|
||||
#define DCLRM 0x2000 /* b13: DMA buffer clear mode */
|
||||
#define DREQE 0x1000 /* b12: DREQ output enable */
|
||||
#if defined(CONFIG_SUPERH_ON_CHIP_R8A66597)
|
||||
#define MBW 0x0800
|
||||
#else
|
||||
#define MBW 0x0400 /* b10: Maximum bit width for FIFO access */
|
||||
#endif
|
||||
#define MBW_8 0x0000 /* 8bit */
|
||||
#define MBW_16 0x0400 /* 16bit */
|
||||
#define BIGEND 0x0100 /* b8: Big endian mode */
|
||||
#define BYTE_LITTLE 0x0000 /* little dendian */
|
||||
#define BYTE_BIG 0x0100 /* big endifan */
|
||||
#define ISEL 0x0020 /* b5: DCP FIFO port direction select */
|
||||
#define CURPIPE 0x000F /* b2-0: PIPE select */
|
||||
|
||||
/* CFIFO/DxFIFO Port Control Register */
|
||||
#define BVAL 0x8000 /* b15: Buffer valid flag */
|
||||
#define BCLR 0x4000 /* b14: Buffer clear */
|
||||
#define FRDY 0x2000 /* b13: FIFO ready */
|
||||
#define DTLN 0x0FFF /* b11-0: FIFO received data length */
|
||||
|
||||
/* Interrupt Enable Register 0 */
|
||||
#define VBSE 0x8000 /* b15: VBUS interrupt */
|
||||
#define RSME 0x4000 /* b14: Resume interrupt */
|
||||
#define SOFE 0x2000 /* b13: Frame update interrupt */
|
||||
#define DVSE 0x1000 /* b12: Device state transition interrupt */
|
||||
#define CTRE 0x0800 /* b11: Control transfer stage transition interrupt */
|
||||
#define BEMPE 0x0400 /* b10: Buffer empty interrupt */
|
||||
#define NRDYE 0x0200 /* b9: Buffer not ready interrupt */
|
||||
#define BRDYE 0x0100 /* b8: Buffer ready interrupt */
|
||||
|
||||
/* Interrupt Enable Register 1 */
|
||||
#define OVRCRE 0x8000 /* b15: Over-current interrupt */
|
||||
#define BCHGE 0x4000 /* b14: USB us chenge interrupt */
|
||||
#define DTCHE 0x1000 /* b12: Detach sense interrupt */
|
||||
#define ATTCHE 0x0800 /* b11: Attach sense interrupt */
|
||||
#define EOFERRE 0x0040 /* b6: EOF error interrupt */
|
||||
#define SIGNE 0x0020 /* b5: SETUP IGNORE interrupt */
|
||||
#define SACKE 0x0010 /* b4: SETUP ACK interrupt */
|
||||
|
||||
/* BRDY Interrupt Enable/Status Register */
|
||||
#define BRDY9 0x0200 /* b9: PIPE9 */
|
||||
#define BRDY8 0x0100 /* b8: PIPE8 */
|
||||
#define BRDY7 0x0080 /* b7: PIPE7 */
|
||||
#define BRDY6 0x0040 /* b6: PIPE6 */
|
||||
#define BRDY5 0x0020 /* b5: PIPE5 */
|
||||
#define BRDY4 0x0010 /* b4: PIPE4 */
|
||||
#define BRDY3 0x0008 /* b3: PIPE3 */
|
||||
#define BRDY2 0x0004 /* b2: PIPE2 */
|
||||
#define BRDY1 0x0002 /* b1: PIPE1 */
|
||||
#define BRDY0 0x0001 /* b1: PIPE0 */
|
||||
|
||||
/* NRDY Interrupt Enable/Status Register */
|
||||
#define NRDY9 0x0200 /* b9: PIPE9 */
|
||||
#define NRDY8 0x0100 /* b8: PIPE8 */
|
||||
#define NRDY7 0x0080 /* b7: PIPE7 */
|
||||
#define NRDY6 0x0040 /* b6: PIPE6 */
|
||||
#define NRDY5 0x0020 /* b5: PIPE5 */
|
||||
#define NRDY4 0x0010 /* b4: PIPE4 */
|
||||
#define NRDY3 0x0008 /* b3: PIPE3 */
|
||||
#define NRDY2 0x0004 /* b2: PIPE2 */
|
||||
#define NRDY1 0x0002 /* b1: PIPE1 */
|
||||
#define NRDY0 0x0001 /* b1: PIPE0 */
|
||||
|
||||
/* BEMP Interrupt Enable/Status Register */
|
||||
#define BEMP9 0x0200 /* b9: PIPE9 */
|
||||
#define BEMP8 0x0100 /* b8: PIPE8 */
|
||||
#define BEMP7 0x0080 /* b7: PIPE7 */
|
||||
#define BEMP6 0x0040 /* b6: PIPE6 */
|
||||
#define BEMP5 0x0020 /* b5: PIPE5 */
|
||||
#define BEMP4 0x0010 /* b4: PIPE4 */
|
||||
#define BEMP3 0x0008 /* b3: PIPE3 */
|
||||
#define BEMP2 0x0004 /* b2: PIPE2 */
|
||||
#define BEMP1 0x0002 /* b1: PIPE1 */
|
||||
#define BEMP0 0x0001 /* b0: PIPE0 */
|
||||
|
||||
/* SOF Pin Configuration Register */
|
||||
#define TRNENSEL 0x0100 /* b8: Select transaction enable period */
|
||||
#define BRDYM 0x0040 /* b6: BRDY clear timing */
|
||||
#define INTL 0x0020 /* b5: Interrupt sense select */
|
||||
#define EDGESTS 0x0010 /* b4: */
|
||||
#define SOFMODE 0x000C /* b3-2: SOF pin select */
|
||||
#define SOF_125US 0x0008 /* SOF OUT 125us Frame Signal */
|
||||
#define SOF_1MS 0x0004 /* SOF OUT 1ms Frame Signal */
|
||||
#define SOF_DISABLE 0x0000 /* SOF OUT Disable */
|
||||
|
||||
/* Interrupt Status Register 0 */
|
||||
#define VBINT 0x8000 /* b15: VBUS interrupt */
|
||||
#define RESM 0x4000 /* b14: Resume interrupt */
|
||||
#define SOFR 0x2000 /* b13: SOF frame update interrupt */
|
||||
#define DVST 0x1000 /* b12: Device state transition interrupt */
|
||||
#define CTRT 0x0800 /* b11: Control transfer stage transition interrupt */
|
||||
#define BEMP 0x0400 /* b10: Buffer empty interrupt */
|
||||
#define NRDY 0x0200 /* b9: Buffer not ready interrupt */
|
||||
#define BRDY 0x0100 /* b8: Buffer ready interrupt */
|
||||
#define VBSTS 0x0080 /* b7: VBUS input port */
|
||||
#define DVSQ 0x0070 /* b6-4: Device state */
|
||||
#define DS_SPD_CNFG 0x0070 /* Suspend Configured */
|
||||
#define DS_SPD_ADDR 0x0060 /* Suspend Address */
|
||||
#define DS_SPD_DFLT 0x0050 /* Suspend Default */
|
||||
#define DS_SPD_POWR 0x0040 /* Suspend Powered */
|
||||
#define DS_SUSP 0x0040 /* Suspend */
|
||||
#define DS_CNFG 0x0030 /* Configured */
|
||||
#define DS_ADDS 0x0020 /* Address */
|
||||
#define DS_DFLT 0x0010 /* Default */
|
||||
#define DS_POWR 0x0000 /* Powered */
|
||||
#define DVSQS 0x0030 /* b5-4: Device state */
|
||||
#define VALID 0x0008 /* b3: Setup packet detected flag */
|
||||
#define CTSQ 0x0007 /* b2-0: Control transfer stage */
|
||||
#define CS_SQER 0x0006 /* Sequence error */
|
||||
#define CS_WRND 0x0005 /* Control write nodata status stage */
|
||||
#define CS_WRSS 0x0004 /* Control write status stage */
|
||||
#define CS_WRDS 0x0003 /* Control write data stage */
|
||||
#define CS_RDSS 0x0002 /* Control read status stage */
|
||||
#define CS_RDDS 0x0001 /* Control read data stage */
|
||||
#define CS_IDST 0x0000 /* Idle or setup stage */
|
||||
|
||||
/* Interrupt Status Register 1 */
|
||||
#define OVRCR 0x8000 /* b15: Over-current interrupt */
|
||||
#define BCHG 0x4000 /* b14: USB bus chenge interrupt */
|
||||
#define DTCH 0x1000 /* b12: Detach sense interrupt */
|
||||
#define ATTCH 0x0800 /* b11: Attach sense interrupt */
|
||||
#define EOFERR 0x0040 /* b6: EOF-error interrupt */
|
||||
#define SIGN 0x0020 /* b5: Setup ignore interrupt */
|
||||
#define SACK 0x0010 /* b4: Setup acknowledge interrupt */
|
||||
|
||||
/* Frame Number Register */
|
||||
#define OVRN 0x8000 /* b15: Overrun error */
|
||||
#define CRCE 0x4000 /* b14: Received data error */
|
||||
#define FRNM 0x07FF /* b10-0: Frame number */
|
||||
|
||||
/* Micro Frame Number Register */
|
||||
#define UFRNM 0x0007 /* b2-0: Micro frame number */
|
||||
|
||||
/* Default Control Pipe Maxpacket Size Register */
|
||||
/* Pipe Maxpacket Size Register */
|
||||
#define DEVSEL 0xF000 /* b15-14: Device address select */
|
||||
#define MAXP 0x007F /* b6-0: Maxpacket size of default control pipe */
|
||||
|
||||
/* Default Control Pipe Control Register */
|
||||
#define BSTS 0x8000 /* b15: Buffer status */
|
||||
#define SUREQ 0x4000 /* b14: Send USB request */
|
||||
#define CSCLR 0x2000 /* b13: complete-split status clear */
|
||||
#define CSSTS 0x1000 /* b12: complete-split status */
|
||||
#define SUREQCLR 0x0800 /* b11: stop setup request */
|
||||
#define SQCLR 0x0100 /* b8: Sequence toggle bit clear */
|
||||
#define SQSET 0x0080 /* b7: Sequence toggle bit set */
|
||||
#define SQMON 0x0040 /* b6: Sequence toggle bit monitor */
|
||||
#define PBUSY 0x0020 /* b5: pipe busy */
|
||||
#define PINGE 0x0010 /* b4: ping enable */
|
||||
#define CCPL 0x0004 /* b2: Enable control transfer complete */
|
||||
#define PID 0x0003 /* b1-0: Response PID */
|
||||
#define PID_STALL11 0x0003 /* STALL */
|
||||
#define PID_STALL 0x0002 /* STALL */
|
||||
#define PID_BUF 0x0001 /* BUF */
|
||||
#define PID_NAK 0x0000 /* NAK */
|
||||
|
||||
/* Pipe Window Select Register */
|
||||
#define PIPENM 0x0007 /* b2-0: Pipe select */
|
||||
|
||||
/* Pipe Configuration Register */
|
||||
#define R8A66597_TYP 0xC000 /* b15-14: Transfer type */
|
||||
#define R8A66597_ISO 0xC000 /* Isochronous */
|
||||
#define R8A66597_INT 0x8000 /* Interrupt */
|
||||
#define R8A66597_BULK 0x4000 /* Bulk */
|
||||
#define R8A66597_BFRE 0x0400 /* b10: Buffer ready interrupt mode select */
|
||||
#define R8A66597_DBLB 0x0200 /* b9: Double buffer mode select */
|
||||
#define R8A66597_CNTMD 0x0100 /* b8: Continuous transfer mode select */
|
||||
#define R8A66597_SHTNAK 0x0080 /* b7: Transfer end NAK */
|
||||
#define R8A66597_DIR 0x0010 /* b4: Transfer direction select */
|
||||
#define R8A66597_EPNUM 0x000F /* b3-0: Eendpoint number select */
|
||||
|
||||
/* Pipe Buffer Configuration Register */
|
||||
#define BUFSIZE 0x7C00 /* b14-10: Pipe buffer size */
|
||||
#define BUFNMB 0x007F /* b6-0: Pipe buffer number */
|
||||
#define PIPE0BUF 256
|
||||
#define PIPExBUF 64
|
||||
|
||||
/* Pipe Maxpacket Size Register */
|
||||
#define MXPS 0x07FF /* b10-0: Maxpacket size */
|
||||
|
||||
/* Pipe Cycle Configuration Register */
|
||||
#define IFIS 0x1000 /* b12: Isochronous in-buffer flush mode select */
|
||||
#define IITV 0x0007 /* b2-0: Isochronous interval */
|
||||
|
||||
/* Pipex Control Register */
|
||||
#define BSTS 0x8000 /* b15: Buffer status */
|
||||
#define INBUFM 0x4000 /* b14: IN buffer monitor (Only for PIPE1 to 5) */
|
||||
#define CSCLR 0x2000 /* b13: complete-split status clear */
|
||||
#define CSSTS 0x1000 /* b12: complete-split status */
|
||||
#define ATREPM 0x0400 /* b10: Auto repeat mode */
|
||||
#define ACLRM 0x0200 /* b9: Out buffer auto clear mode */
|
||||
#define SQCLR 0x0100 /* b8: Sequence toggle bit clear */
|
||||
#define SQSET 0x0080 /* b7: Sequence toggle bit set */
|
||||
#define SQMON 0x0040 /* b6: Sequence toggle bit monitor */
|
||||
#define PBUSY 0x0020 /* b5: pipe busy */
|
||||
#define PID 0x0003 /* b1-0: Response PID */
|
||||
|
||||
/* PIPExTRE */
|
||||
#define TRENB 0x0200 /* b9: Transaction counter enable */
|
||||
#define TRCLR 0x0100 /* b8: Transaction counter clear */
|
||||
|
||||
/* PIPExTRN */
|
||||
#define TRNCNT 0xFFFF /* b15-0: Transaction counter */
|
||||
|
||||
/* DEVADDx */
|
||||
#define UPPHUB 0x7800
|
||||
#define HUBPORT 0x0700
|
||||
#define USBSPD 0x00C0
|
||||
#define RTPORT 0x0001
|
||||
|
||||
#define R8A66597_MAX_NUM_PIPE 10
|
||||
#define R8A66597_BUF_BSIZE 8
|
||||
#define R8A66597_MAX_DEVICE 10
|
||||
#if defined(CONFIG_SUPERH_ON_CHIP_R8A66597)
|
||||
#define R8A66597_MAX_ROOT_HUB 1
|
||||
#else
|
||||
#define R8A66597_MAX_ROOT_HUB 2
|
||||
#endif
|
||||
#define R8A66597_MAX_SAMPLING 5
|
||||
#define R8A66597_RH_POLL_TIME 10
|
||||
|
||||
#define BULK_IN_PIPENUM 3
|
||||
#define BULK_IN_BUFNUM 8
|
||||
|
||||
#define BULK_OUT_PIPENUM 4
|
||||
#define BULK_OUT_BUFNUM 40
|
||||
|
||||
#define check_bulk_or_isoc(pipenum) ((pipenum >= 1 && pipenum <= 5))
|
||||
#define check_interrupt(pipenum) ((pipenum >= 6 && pipenum <= 9))
|
||||
#define make_devsel(addr) (addr << 12)
|
||||
|
||||
struct r8a66597 {
|
||||
unsigned long reg;
|
||||
unsigned short pipe_config; /* bit field */
|
||||
unsigned short port_status;
|
||||
unsigned short port_change;
|
||||
u16 speed; /* HSMODE or FSMODE or LSMODE */
|
||||
unsigned char rh_devnum;
|
||||
};
|
||||
|
||||
static inline u16 r8a66597_read(struct r8a66597 *r8a66597, unsigned long offset)
|
||||
{
|
||||
return inw(r8a66597->reg + offset);
|
||||
}
|
||||
|
||||
static inline void r8a66597_read_fifo(struct r8a66597 *r8a66597,
|
||||
unsigned long offset, void *buf,
|
||||
int len)
|
||||
{
|
||||
int i;
|
||||
#if defined(CONFIG_SUPERH_ON_CHIP_R8A66597)
|
||||
unsigned long fifoaddr = r8a66597->reg + offset;
|
||||
unsigned long count;
|
||||
unsigned long *p = buf;
|
||||
|
||||
count = len / 4;
|
||||
for (i = 0; i < count; i++)
|
||||
inl(p[i], r8a66597->reg + offset);
|
||||
|
||||
if (len & 0x00000003) {
|
||||
unsigned long tmp = inl(fifoaddr);
|
||||
memcpy((unsigned char *)buf + count * 4, &tmp, len & 0x03);
|
||||
}
|
||||
#else
|
||||
unsigned short *p = buf;
|
||||
|
||||
len = (len + 1) / 2;
|
||||
for (i = 0; i < len; i++)
|
||||
p[i] = inw(r8a66597->reg + offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void r8a66597_write(struct r8a66597 *r8a66597, u16 val,
|
||||
unsigned long offset)
|
||||
{
|
||||
outw(val, r8a66597->reg + offset);
|
||||
}
|
||||
|
||||
static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
|
||||
unsigned long offset, void *buf,
|
||||
int len)
|
||||
{
|
||||
int i;
|
||||
unsigned long fifoaddr = r8a66597->reg + offset;
|
||||
#if defined(CONFIG_SUPERH_ON_CHIP_R8A66597)
|
||||
unsigned long count;
|
||||
unsigned char *pb;
|
||||
unsigned long *p = buf;
|
||||
|
||||
count = len / 4;
|
||||
for (i = 0; i < count; i++)
|
||||
outl(p[i], fifoaddr);
|
||||
|
||||
if (len & 0x00000003) {
|
||||
pb = (unsigned char *)buf + count * 4;
|
||||
for (i = 0; i < (len & 0x00000003); i++) {
|
||||
if (r8a66597_read(r8a66597, CFIFOSEL) & BIGEND)
|
||||
outb(pb[i], fifoaddr + i);
|
||||
else
|
||||
outb(pb[i], fifoaddr + 3 - i);
|
||||
}
|
||||
}
|
||||
#else
|
||||
int odd = len & 0x0001;
|
||||
unsigned short *p = buf;
|
||||
|
||||
len = len / 2;
|
||||
for (i = 0; i < len; i++)
|
||||
outw(p[i], fifoaddr);
|
||||
|
||||
if (odd) {
|
||||
unsigned char *pb = (unsigned char *)(buf + len);
|
||||
outb(*pb, fifoaddr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void r8a66597_mdfy(struct r8a66597 *r8a66597,
|
||||
u16 val, u16 pat, unsigned long offset)
|
||||
{
|
||||
u16 tmp;
|
||||
tmp = r8a66597_read(r8a66597, offset);
|
||||
tmp = tmp & (~pat);
|
||||
tmp = tmp | val;
|
||||
r8a66597_write(r8a66597, tmp, offset);
|
||||
}
|
||||
|
||||
#define r8a66597_bclr(r8a66597, val, offset) \
|
||||
r8a66597_mdfy(r8a66597, 0, val, offset)
|
||||
#define r8a66597_bset(r8a66597, val, offset) \
|
||||
r8a66597_mdfy(r8a66597, val, 0, offset)
|
||||
|
||||
static inline unsigned long get_syscfg_reg(int port)
|
||||
{
|
||||
return port == 0 ? SYSCFG0 : SYSCFG1;
|
||||
}
|
||||
|
||||
static inline unsigned long get_syssts_reg(int port)
|
||||
{
|
||||
return port == 0 ? SYSSTS0 : SYSSTS1;
|
||||
}
|
||||
|
||||
static inline unsigned long get_dvstctr_reg(int port)
|
||||
{
|
||||
return port == 0 ? DVSTCTR0 : DVSTCTR1;
|
||||
}
|
||||
|
||||
static inline unsigned long get_dmacfg_reg(int port)
|
||||
{
|
||||
return port == 0 ? DMA0CFG : DMA1CFG;
|
||||
}
|
||||
|
||||
static inline unsigned long get_intenb_reg(int port)
|
||||
{
|
||||
return port == 0 ? INTENB1 : INTENB2;
|
||||
}
|
||||
|
||||
static inline unsigned long get_intsts_reg(int port)
|
||||
{
|
||||
return port == 0 ? INTSTS1 : INTSTS2;
|
||||
}
|
||||
|
||||
static inline u16 get_rh_usb_speed(struct r8a66597 *r8a66597, int port)
|
||||
{
|
||||
unsigned long dvstctr_reg = get_dvstctr_reg(port);
|
||||
|
||||
return r8a66597_read(r8a66597, dvstctr_reg) & RHST;
|
||||
}
|
||||
|
||||
static inline void r8a66597_port_power(struct r8a66597 *r8a66597, int port,
|
||||
int power)
|
||||
{
|
||||
unsigned long dvstctr_reg = get_dvstctr_reg(port);
|
||||
|
||||
if (power)
|
||||
r8a66597_bset(r8a66597, VBOUT, dvstctr_reg);
|
||||
else
|
||||
r8a66597_bclr(r8a66597, VBOUT, dvstctr_reg);
|
||||
}
|
||||
|
||||
#define get_pipectr_addr(pipenum) (PIPE1CTR + (pipenum - 1) * 2)
|
||||
#define get_pipetre_addr(pipenum) (PIPE1TRE + (pipenum - 1) * 4)
|
||||
#define get_pipetrn_addr(pipenum) (PIPE1TRN + (pipenum - 1) * 4)
|
||||
#define get_devadd_addr(address) (DEVADD0 + address * 2)
|
||||
|
||||
|
||||
/* USB HUB CONSTANTS (not OHCI-specific; see hub.h, based on usb_ohci.h) */
|
||||
|
||||
/* destination of request */
|
||||
#define RH_INTERFACE 0x01
|
||||
#define RH_ENDPOINT 0x02
|
||||
#define RH_OTHER 0x03
|
||||
|
||||
#define RH_CLASS 0x20
|
||||
#define RH_VENDOR 0x40
|
||||
|
||||
/* Requests: bRequest << 8 | bmRequestType */
|
||||
#define RH_GET_STATUS 0x0080
|
||||
#define RH_CLEAR_FEATURE 0x0100
|
||||
#define RH_SET_FEATURE 0x0300
|
||||
#define RH_SET_ADDRESS 0x0500
|
||||
#define RH_GET_DESCRIPTOR 0x0680
|
||||
#define RH_SET_DESCRIPTOR 0x0700
|
||||
#define RH_GET_CONFIGURATION 0x0880
|
||||
#define RH_SET_CONFIGURATION 0x0900
|
||||
#define RH_GET_STATE 0x0280
|
||||
#define RH_GET_INTERFACE 0x0A80
|
||||
#define RH_SET_INTERFACE 0x0B00
|
||||
#define RH_SYNC_FRAME 0x0C80
|
||||
/* Our Vendor Specific Request */
|
||||
#define RH_SET_EP 0x2000
|
||||
|
||||
/* Hub port features */
|
||||
#define RH_PORT_CONNECTION 0x00
|
||||
#define RH_PORT_ENABLE 0x01
|
||||
#define RH_PORT_SUSPEND 0x02
|
||||
#define RH_PORT_OVER_CURRENT 0x03
|
||||
#define RH_PORT_RESET 0x04
|
||||
#define RH_PORT_POWER 0x08
|
||||
#define RH_PORT_LOW_SPEED 0x09
|
||||
|
||||
#define RH_C_PORT_CONNECTION 0x10
|
||||
#define RH_C_PORT_ENABLE 0x11
|
||||
#define RH_C_PORT_SUSPEND 0x12
|
||||
#define RH_C_PORT_OVER_CURRENT 0x13
|
||||
#define RH_C_PORT_RESET 0x14
|
||||
|
||||
/* Hub features */
|
||||
#define RH_C_HUB_LOCAL_POWER 0x00
|
||||
#define RH_C_HUB_OVER_CURRENT 0x01
|
||||
|
||||
#define RH_DEVICE_REMOTE_WAKEUP 0x00
|
||||
#define RH_ENDPOINT_STALL 0x01
|
||||
|
||||
#define RH_ACK 0x01
|
||||
#define RH_REQ_ERR -1
|
||||
#define RH_NACK 0x00
|
||||
|
||||
/* OHCI ROOT HUB REGISTER MASKS */
|
||||
|
||||
/* roothub.portstatus [i] bits */
|
||||
#define RH_PS_CCS 0x00000001 /* current connect status */
|
||||
#define RH_PS_PES 0x00000002 /* port enable status*/
|
||||
#define RH_PS_PSS 0x00000004 /* port suspend status */
|
||||
#define RH_PS_POCI 0x00000008 /* port over current indicator */
|
||||
#define RH_PS_PRS 0x00000010 /* port reset status */
|
||||
#define RH_PS_PPS 0x00000100 /* port power status */
|
||||
#define RH_PS_LSDA 0x00000200 /* low speed device attached */
|
||||
#define RH_PS_CSC 0x00010000 /* connect status change */
|
||||
#define RH_PS_PESC 0x00020000 /* port enable status change */
|
||||
#define RH_PS_PSSC 0x00040000 /* port suspend status change */
|
||||
#define RH_PS_OCIC 0x00080000 /* over current indicator change */
|
||||
#define RH_PS_PRSC 0x00100000 /* port reset status change */
|
||||
|
||||
/* roothub.status bits */
|
||||
#define RH_HS_LPS 0x00000001 /* local power status */
|
||||
#define RH_HS_OCI 0x00000002 /* over current indicator */
|
||||
#define RH_HS_DRWE 0x00008000 /* device remote wakeup enable */
|
||||
#define RH_HS_LPSC 0x00010000 /* local power status change */
|
||||
#define RH_HS_OCIC 0x00020000 /* over current indicator change */
|
||||
#define RH_HS_CRWE 0x80000000 /* clear remote wakeup enable */
|
||||
|
||||
/* roothub.b masks */
|
||||
#define RH_B_DR 0x0000ffff /* device removable flags */
|
||||
#define RH_B_PPCM 0xffff0000 /* port power control mask */
|
||||
|
||||
/* roothub.a masks */
|
||||
#define RH_A_NDP (0xff << 0) /* number of downstream ports */
|
||||
#define RH_A_PSM (1 << 8) /* power switching mode */
|
||||
#define RH_A_NPS (1 << 9) /* no power switching */
|
||||
#define RH_A_DT (1 << 10) /* device type (mbz) */
|
||||
#define RH_A_OCPM (1 << 11) /* over current protection mode */
|
||||
#define RH_A_NOCP (1 << 12) /* no over current protection */
|
||||
#define RH_A_POTPGT (0xff << 24) /* power on to power good time */
|
||||
|
||||
#endif /* __R8A66597_H__ */
|
||||
@@ -552,7 +552,7 @@ struct urb *usbd_alloc_urb (struct usb_device_instance *device,
|
||||
struct urb *urb;
|
||||
|
||||
if (!(urb = (struct urb *) malloc (sizeof (struct urb)))) {
|
||||
usberr (" F A T A L: malloc(%u) FAILED!!!!",
|
||||
usberr (" F A T A L: malloc(%zu) FAILED!!!!",
|
||||
sizeof (struct urb));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#if defined(CONFIG_OMAP1510) && defined(CONFIG_USB_DEVICE)
|
||||
#if ((defined(CONFIG_OMAP1510) || defined(CONFIG_OMAP1610)) && defined(CONFIG_USB_DEVICE))
|
||||
|
||||
#include <asm/io.h>
|
||||
#ifdef CONFIG_OMAP_SX1
|
||||
@@ -1109,21 +1109,43 @@ int udc_init (void)
|
||||
*/
|
||||
outw ((1 << 4) | (1 << 5), CLOCK_CTRL);
|
||||
UDCREG (CLOCK_CTRL);
|
||||
|
||||
#ifdef CONFIG_OMAP1510
|
||||
/* This code was originally implemented for OMAP1510 and
|
||||
* therefore is only applicable for OMAP1510 boards. For
|
||||
* OMAP5912 or OMAP16xx the register APLL_CTRL does not
|
||||
* exist and DPLL_CTRL is already configured.
|
||||
*/
|
||||
|
||||
/* Set and check APLL */
|
||||
outw (0x0008, APLL_CTRL);
|
||||
UDCREG (APLL_CTRL);
|
||||
/* Set and check DPLL */
|
||||
outw (0x2210, DPLL_CTRL);
|
||||
UDCREG (DPLL_CTRL);
|
||||
/* Set and check SOFT */
|
||||
outw ((1 << 4) | (1 << 3) | 1, SOFT_REQ);
|
||||
#endif
|
||||
/* Set and check SOFT
|
||||
* The below line of code has been changed to perform a
|
||||
* read-modify-write instead of a simple write for
|
||||
* configuring the SOFT_REQ register. This allows the code
|
||||
* to be compatible with OMAP5912 and OMAP16xx devices
|
||||
*/
|
||||
outw ((1 << 4) | (1 << 3) | 1 | (inw(SOFT_REQ)), SOFT_REQ);
|
||||
|
||||
/* Short delay to wait for DPLL */
|
||||
udelay (1000);
|
||||
|
||||
/* Print banner with device revision */
|
||||
udc_rev = inw (UDC_REV) & 0xff;
|
||||
#ifdef CONFIG_OMAP1510
|
||||
printf ("USB: TI OMAP1510 USB function module rev %d.%d\n",
|
||||
udc_rev >> 4, udc_rev & 0xf);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OMAP1610
|
||||
printf ("USB: TI OMAP5912 USB function module rev %d.%d\n",
|
||||
udc_rev >> 4, udc_rev & 0xf);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OMAP_SX1
|
||||
i2c_read (0x32, 0x04, 1, &value, 1);
|
||||
|
||||
@@ -100,7 +100,11 @@ void lcd_ctrl_init(void *lcdbase)
|
||||
value << ATMEL_LCDC_CLKVAL_OFFSET);
|
||||
|
||||
/* Initialize control register 2 */
|
||||
#ifdef CONFIG_AVR32
|
||||
value = ATMEL_LCDC_MEMOR_BIG | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE;
|
||||
#else
|
||||
value = ATMEL_LCDC_MEMOR_LITTLE | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE;
|
||||
#endif
|
||||
if (panel_info.vl_tft)
|
||||
value |= ATMEL_LCDC_DISTYPE_TFT;
|
||||
|
||||
|
||||
@@ -751,24 +751,10 @@ void video_puts (const char *s)
|
||||
fb ++; \
|
||||
}
|
||||
|
||||
#if !defined(VIDEO_FB_16BPP_PIXEL_SWAP)
|
||||
#define FILL_15BIT_555RGB(r,g,b) { \
|
||||
*(unsigned short *)fb = SWAP16((unsigned short)(((r>>3)<<10) | ((g>>3)<<5) | (b>>3))); \
|
||||
fb += 2; \
|
||||
}
|
||||
#else
|
||||
static int tgl;
|
||||
static unsigned short p0;
|
||||
#define FILL_15BIT_555RGB(r,g,b) { \
|
||||
if (!tgl++) { \
|
||||
p0 = SWAP16((unsigned short)(((r>>3)<<10) | ((g>>3)<<5) | (b>>3))); \
|
||||
} else { \
|
||||
tgl=0; \
|
||||
*(unsigned long *)(fb-2) = (SWAP16((unsigned short)(((r>>3)<<10) | ((g>>3)<<5) | (b>>3)))<<16) | p0; \
|
||||
} \
|
||||
fb += 2; \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define FILL_16BIT_565RGB(r,g,b) { \
|
||||
*(unsigned short *)fb = SWAP16((unsigned short)((((r)>>3)<<11) | (((g)>>2)<<5) | ((b)>>3))); \
|
||||
@@ -796,6 +782,20 @@ static unsigned short p0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
|
||||
static void inline fill_555rgb_pswap(uchar *fb, int x,
|
||||
u8 r, u8 g, u8 b)
|
||||
{
|
||||
ushort *dst = (ushort *)fb;
|
||||
ushort color = (ushort)(((r >> 3) << 10) |
|
||||
((g >> 3) << 5) |
|
||||
(b >> 3));
|
||||
if (x & 1)
|
||||
*(--dst) = color;
|
||||
else
|
||||
*(++dst) = color;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Display the BMP file located at address bmp_image.
|
||||
@@ -927,11 +927,20 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
|
||||
break;
|
||||
case GDF_15BIT_555RGB:
|
||||
while (ycount--) {
|
||||
#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
|
||||
int xpos = x;
|
||||
#endif
|
||||
WATCHDOG_RESET ();
|
||||
xcount = width;
|
||||
while (xcount--) {
|
||||
cte = bmp->color_table[*bmap++];
|
||||
#if !defined(VIDEO_FB_16BPP_PIXEL_SWAP)
|
||||
FILL_15BIT_555RGB (cte.red, cte.green, cte.blue);
|
||||
#else
|
||||
fill_555rgb_pswap (fb, xpos++, cte.red,
|
||||
cte.green, cte.blue);
|
||||
fb += 2;
|
||||
#endif
|
||||
}
|
||||
bmap += padded_line;
|
||||
fb -= (VIDEO_VISIBLE_COLS + width) * VIDEO_PIXEL_SIZE;
|
||||
@@ -993,10 +1002,19 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
|
||||
break;
|
||||
case GDF_15BIT_555RGB:
|
||||
while (ycount--) {
|
||||
#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
|
||||
int xpos = x;
|
||||
#endif
|
||||
WATCHDOG_RESET ();
|
||||
xcount = width;
|
||||
while (xcount--) {
|
||||
#if !defined(VIDEO_FB_16BPP_PIXEL_SWAP)
|
||||
FILL_15BIT_555RGB (bmap[2], bmap[1], bmap[0]);
|
||||
#else
|
||||
fill_555rgb_pswap (fb, xpos++, bmap[2],
|
||||
bmap[1], bmap[0]);
|
||||
fb += 2;
|
||||
#endif
|
||||
bmap += 3;
|
||||
}
|
||||
bmap += padded_line;
|
||||
@@ -1071,7 +1089,9 @@ void logo_plot (void *screen, int width, int x, int y)
|
||||
int ycount = VIDEO_LOGO_HEIGHT;
|
||||
unsigned char r, g, b, *logo_red, *logo_blue, *logo_green;
|
||||
unsigned char *source;
|
||||
unsigned char *dest = (unsigned char *)screen + ((y * width * VIDEO_PIXEL_SIZE) + x);
|
||||
unsigned char *dest = (unsigned char *)screen +
|
||||
((y * width * VIDEO_PIXEL_SIZE) +
|
||||
x * VIDEO_PIXEL_SIZE);
|
||||
|
||||
#ifdef CONFIG_VIDEO_BMP_LOGO
|
||||
source = bmp_logo_bitmap;
|
||||
@@ -1101,6 +1121,9 @@ void logo_plot (void *screen, int width, int x, int y)
|
||||
}
|
||||
|
||||
while (ycount--) {
|
||||
#if defined(VIDEO_FB_16BPP_PIXEL_SWAP)
|
||||
int xpos = x;
|
||||
#endif
|
||||
xcount = VIDEO_LOGO_WIDTH;
|
||||
while (xcount--) {
|
||||
r = logo_red[*source - VIDEO_LOGO_LUT_OFFSET];
|
||||
@@ -1119,15 +1142,7 @@ void logo_plot (void *screen, int width, int x, int y)
|
||||
*(unsigned short *) dest =
|
||||
SWAP16 ((unsigned short) (((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3)));
|
||||
#else
|
||||
{
|
||||
if (!tgl++) {
|
||||
p0 = SWAP16 ((unsigned short) (((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3)));
|
||||
} else {
|
||||
*(unsigned long *)(dest-2) =
|
||||
(SWAP16 ((unsigned short) (((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3)))<<16) | p0;
|
||||
tgl=0;
|
||||
}
|
||||
}
|
||||
fill_555rgb_pswap (dest, xpos++, r, g, b);
|
||||
#endif
|
||||
break;
|
||||
case GDF_16BIT_565RGB:
|
||||
|
||||
@@ -126,6 +126,7 @@ typedef unsigned long lbastart_t;
|
||||
#define DT_STOR_SCSI 0x0020
|
||||
#define DT_STOR_USB 0x0040
|
||||
#define DT_STOR_MMC 0x0080
|
||||
#define DT_STOR_SATA 0x0100
|
||||
|
||||
#define DEV_STA_CLOSED 0x0000 /* invalid, closed */
|
||||
#define DEV_STA_OPEN 0x0001 /* open i.e. active */
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#ifndef AT91RM9200_H
|
||||
#define AT91RM9200_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
typedef volatile unsigned int AT91_REG; /* Hardware register definition */
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -780,4 +781,5 @@ typedef struct _AT91S_PDC
|
||||
#define AT91C_PIOB_ODR ((AT91_REG *) 0xFFFFF614) /* (PIOB) Output Disable Registerr */
|
||||
#define AT91C_PIOB_PDSR ((AT91_REG *) 0xFFFFF63C) /* (PIOB) Pin Data Status Register */
|
||||
|
||||
#endif
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* AT91RM9200_H */
|
||||
|
||||
@@ -126,17 +126,32 @@
|
||||
#define MUX_CTL_CSPI2_SS2 0x87
|
||||
#define MUX_CTL_CSPI2_MOSI 0x8b
|
||||
|
||||
/* The modes a specific pin can be in
|
||||
* these macros can be used in mx31_gpio_mux() and have the form
|
||||
/*
|
||||
* Helper macros for the MUX_[contact name]__[pin function] macros
|
||||
*/
|
||||
#define IOMUX_MODE_POS 9
|
||||
#define IOMUX_MODE(contact, mode) (((mode) << IOMUX_MODE_POS) | (contact))
|
||||
|
||||
/*
|
||||
* These macros can be used in mx31_gpio_mux() and have the form
|
||||
* MUX_[contact name]__[pin function]
|
||||
*/
|
||||
#define MUX_RXD1__UART1_RXD_MUX ((MUX_CTL_FUNC << 8) | MUX_CTL_RXD1)
|
||||
#define MUX_TXD1__UART1_TXD_MUX ((MUX_CTL_FUNC << 8) | MUX_CTL_TXD1)
|
||||
#define MUX_RTS1__UART1_RTS_B ((MUX_CTL_FUNC << 8) | MUX_CTL_RTS1)
|
||||
#define MUX_RTS1__UART1_CTS_B ((MUX_CTL_FUNC << 8) | MUX_CTL_CTS1)
|
||||
#define MUX_RXD1__UART1_RXD_MUX IOMUX_MODE(MUX_CTL_RXD1, MUX_CTL_FUNC)
|
||||
#define MUX_TXD1__UART1_TXD_MUX IOMUX_MODE(MUX_CTL_TXD1, MUX_CTL_FUNC)
|
||||
#define MUX_RTS1__UART1_RTS_B IOMUX_MODE(MUX_CTL_RTS1, MUX_CTL_FUNC)
|
||||
#define MUX_CTS1__UART1_CTS_B IOMUX_MODE(MUX_CTL_CTS1, MUX_CTL_FUNC)
|
||||
|
||||
#define MUX_CSPI2_MOSI__I2C2_SCL ((MUX_CTL_ALT1 << 8) | MUX_CTL_CSPI2_MOSI)
|
||||
#define MUX_CSPI2_MISO__I2C2_SCL ((MUX_CTL_ALT1 << 8) | MUX_CTL_CSPI2_MISO)
|
||||
#define MUX_CSPI2_SS0__CSPI2_SS0_B IOMUX_MODE(MUX_CTL_CSPI2_SS0, MUX_CTL_FUNC)
|
||||
#define MUX_CSPI2_SS1__CSPI2_SS1_B IOMUX_MODE(MUX_CTL_CSPI2_SS1, MUX_CTL_FUNC)
|
||||
#define MUX_CSPI2_SS2__CSPI2_SS2_B IOMUX_MODE(MUX_CTL_CSPI2_SS2, MUX_CTL_FUNC)
|
||||
#define MUX_CSPI2_MOSI__CSPI2_MOSI IOMUX_MODE(MUX_CTL_CSPI2_MOSI, MUX_CTL_FUNC)
|
||||
#define MUX_CSPI2_MISO__CSPI2_MISO IOMUX_MODE(MUX_CTL_CSPI2_MISO, MUX_CTL_FUNC)
|
||||
#define MUX_CSPI2_SPI_RDY__CSPI2_DATAREADY_B \
|
||||
IOMUX_MODE(MUX_CTL_CSPI2_SPI_RDY, MUX_CTL_FUNC)
|
||||
#define MUX_CSPI2_SCLK__CSPI2_CLK IOMUX_MODE(MUX_CTL_CSPI2_SCLK, MUX_CTL_FUNC)
|
||||
|
||||
#define MUX_CSPI2_MOSI__I2C2_SCL IOMUX_MODE(MUX_CTL_CSPI2_MOSI, MUX_CTL_ALT1)
|
||||
#define MUX_CSPI2_MISO__I2C2_SDA IOMUX_MODE(MUX_CTL_CSPI2_MISO, MUX_CTL_ALT1)
|
||||
|
||||
/*
|
||||
* Memory regions and CS
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#ifndef __ASM_AVR32_IO_H
|
||||
#define __ASM_AVR32_IO_H
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
|
||||
@@ -273,7 +273,9 @@
|
||||
| SYSREG_BF(name,value))
|
||||
|
||||
/* Register access macros */
|
||||
#define sysreg_read(reg) __builtin_mfsr(SYSREG_##reg)
|
||||
#define sysreg_write(reg, value) __builtin_mtsr(SYSREG_##reg, value)
|
||||
#define sysreg_read(reg) \
|
||||
((unsigned long)__builtin_mfsr(SYSREG_##reg))
|
||||
#define sysreg_write(reg, value) \
|
||||
__builtin_mtsr(SYSREG_##reg, value)
|
||||
|
||||
#endif /* __ASM_AVR32_SYSREG_H__ */
|
||||
|
||||
@@ -52,6 +52,9 @@ typedef unsigned long long u64;
|
||||
/* Dma addresses are 32-bits wide. */
|
||||
|
||||
typedef u32 dma_addr_t;
|
||||
|
||||
typedef unsigned long phys_addr_t;
|
||||
typedef unsigned long phys_size_t;
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __ASM_NIOS2_TYPES_H */
|
||||
|
||||
@@ -298,4 +298,13 @@
|
||||
#define LCRR_CLKDIV_4 0x00000004
|
||||
#define LCRR_CLKDIV_8 0x00000008
|
||||
|
||||
/* LTEDR - Transfer Error Check Disable Register
|
||||
*/
|
||||
#define LTEDR_BMD 0x80000000 /* Bus monitor disable */
|
||||
#define LTEDR_PARD 0x20000000 /* Parity error checking disabled */
|
||||
#define LTEDR_WPD 0x04000000 /* Write protect error checking diable */
|
||||
#define LTEDR_WARA 0x00800000 /* Write-after-read-atomic error checking diable */
|
||||
#define LTEDR_RAWA 0x00400000 /* Read-after-write-atomic error checking disable */
|
||||
#define LTEDR_CSD 0x00080000 /* Chip select error checking disable */
|
||||
|
||||
#endif /* __ASM_PPC_FSL_LBC_H */
|
||||
|
||||
@@ -51,6 +51,9 @@ typedef struct global_data {
|
||||
unsigned long cpm_clk;
|
||||
unsigned long scc_clk;
|
||||
unsigned long brg_clk;
|
||||
#ifdef CONFIG_PCI
|
||||
unsigned long pci_clk;
|
||||
#endif
|
||||
#endif
|
||||
unsigned long mem_clk;
|
||||
#if defined(CONFIG_MPC83XX)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user