CENTIPAD boot
Krassimir Slavchev
krassi at bulinfo.net
Wed Aug 8 13:35:22 UTC 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
These patches add support for CENTIPAD board to spi bootloader.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)
iD8DBQFGucaOxJBWvpalMpkRArxXAKCHKEJS2CNPpBCewjCIKPUOJBDQ9ACdE1gW
fnvGH+XU2uIqcXhGQfNq/xU=
=MBHf
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: boot0spi/main.c
===================================================================
RCS file: /home/ncvs/src/sys/boot/arm/at91/boot0spi/main.c,v
retrieving revision 1.5
diff -r1.5 main.c
50c50
< printf("Writing %u bytes to flash at %u\n", len, OFFSET);
---
> printf("Writing %u bytes to flash at %u\n", len, LOADER_OFFSET);
53c53
< off = i + OFFSET;
---
> off = i + LOADER_OFFSET;
Index: bootspi/loader_prompt.c
===================================================================
RCS file: /home/ncvs/src/sys/boot/arm/at91/bootspi/loader_prompt.c,v
retrieving revision 1.4
diff -r1.4 loader_prompt.c
32d31
< #include "ee.h"
289,290c288,290
< EEWrite(0, "This is a test", 15);
< EERead(0, buf, 15);
---
> strcpy(buf,"This is a test!");
> WriteEEPROM(0, buf, 15);
> ReadEEPROM(0, buf, 15);
Index: bootspi/main.c
===================================================================
RCS file: /home/ncvs/src/sys/boot/arm/at91/bootspi/main.c,v
retrieving revision 1.3
diff -r1.3 main.c
44c44
< #include "ee.h"
---
> #include "sd-card.h"
50c50
< EEInit();
---
> InitEEPROM();
55a56
> sdcard_init();
Index: libat91/Makefile
===================================================================
RCS file: /home/ncvs/src/sys/boot/arm/at91/libat91/Makefile,v
retrieving revision 1.9
diff -r1.9 Makefile
11c11
< SRCS+=ashldi3.c divsi3.c
---
> SRCS+=ashldi3.c divsi3.S
Index: libat91/arm_init.S
===================================================================
RCS file: /home/ncvs/src/sys/boot/arm/at91/libat91/arm_init.S,v
retrieving revision 1.2
diff -r1.2 arm_init.S
64c64
< #ifdef BOOT_BWCT
---
> #if defined(BOOT_BWCT) | defined(BOOT_CENTIPAD)
Index: libat91/eeprom.c
===================================================================
RCS file: /home/ncvs/src/sys/boot/arm/at91/libat91/eeprom.c,v
retrieving revision 1.3
diff -r1.3 eeprom.c
36c36,40
< #define TWSI_EEPROM_ADDRESS 0x50
---
> #ifdef BOOT_CENTIPAD
> #define TWSI_EEPROM_ADDRESS 0x57
> #else
> #define TWSI_EEPROM_ADDRESS 0x50
> #endif
Index: libat91/emac.c
===================================================================
RCS file: /home/ncvs/src/sys/boot/arm/at91/libat91/emac.c,v
retrieving revision 1.8
diff -r1.8 emac.c
324c324
< TFTP_ACK_Data(tftpHdr->data,
---
> TFTP_ACK_Data((char *)tftpHdr->data,
342c342
< AT91F_MII_ReadPhy (AT91PS_EMAC pEmac, unsigned char addr)
---
> AT91F_MII_ReadPhy (AT91PS_EMAC pEmac, unsigned char phyaddr, unsigned char addr)
344c344
< unsigned value = 0x60020000 | (addr << 18);
---
> unsigned value = 0x60020000 | ((phyaddr & 0x1f) << 23) | (addr << 18);
362c362
< AT91F_MII_WritePhy (AT91PS_EMAC pEmac, unsigned char addr, unsigned short s)
---
> AT91F_MII_WritePhy (AT91PS_EMAC pEmac, unsigned char phyaddr, unsigned char addr, unsigned short s)
364c364
< unsigned value = 0x50020000 | (addr << 18) | s;
---
> unsigned value = 0x50020000 | ((phyaddr & 0x1f) << 23) | (addr << 18) | s;
382a383
> unsigned char phyaddr = 0;
391c392,396
< #ifdef BOOT_BWCT
---
> #ifdef BOOT_CENTIPAD
> phyaddr = 0x10;
> #endif
>
> #if defined(BOOT_BWCT) | defined(BOOT_CENTIPAD)
398c403
< stat2 = AT91F_MII_ReadPhy(pEmac, MII_STS2_REG);
---
> stat2 = AT91F_MII_ReadPhy(pEmac, phyaddr, MII_STS2_REG);
410c415
< stat2 = AT91F_MII_ReadPhy(pEmac, MII_STS_REG);
---
> stat2 = AT91F_MII_ReadPhy(pEmac, phyaddr, MII_STS_REG);
421,422c426,427
< AT91F_MII_WritePhy(pEmac, 0x0, 0x8000);
< while (AT91F_MII_ReadPhy(pEmac, 0x0) & 0x8000) continue;
---
> AT91F_MII_WritePhy(pEmac, phyaddr, 0x0, 0x8000);
> while (AT91F_MII_ReadPhy(pEmac, phyaddr, 0x0) & 0x8000) continue;
425c430
< stat2 = AT91F_MII_ReadPhy(pEmac, MII_SPEC_STS_REG);
---
> stat2 = AT91F_MII_ReadPhy(pEmac, phyaddr, MII_SPEC_STS_REG);
Index: libat91/emac_init.c
===================================================================
RCS file: /home/ncvs/src/sys/boot/arm/at91/libat91/emac_init.c,v
retrieving revision 1.4
diff -r1.4 emac_init.c
97c97
< #if defined(BOOT_KB920X) | defined(BOOT_BWCT) /* Really !RMII */
---
> #if defined(BOOT_KB920X) | defined(BOOT_BWCT) | defined(BOOT_CENTIPAD) /* Really !RMII */
Index: libat91/spi_flash.c
===================================================================
RCS file: /home/ncvs/src/sys/boot/arm/at91/libat91/spi_flash.c,v
retrieving revision 1.4
diff -r1.4 spi_flash.c
122c122
< #ifdef BOOT_BWCT
---
> #if defined(BOOT_BWCT) | defined(BOOT_CENTIPAD)
180c180
< #ifdef BOOT_BWCT
---
> #if defined(BOOT_BWCT) | defined(BOOT_CENTIPAD)
259c259
< #ifdef BOOT_BWCT
---
> #if defined(BOOT_BWCT) | defined(BOOT_CENTIPAD)
Index: libat91/spi_flash.h
===================================================================
RCS file: /home/ncvs/src/sys/boot/arm/at91/libat91/spi_flash.h,v
retrieving revision 1.2
diff -r1.2 spi_flash.h
43c43
< #ifdef BOOT_BWCT
---
> #if defined(BOOT_BWCT) | defined(BOOT_CENTIPAD)
More information about the freebsd-arm
mailing list