Commit Graph

33 Commits

Author SHA1 Message Date
Warner Losh
bc5676e30c RTC_TIMR's RTC_SEC field is BCD. That makes it unsuitable for
GetSeconds().  Instead, use CRTR register shifted right 15.  This
gives us a range of 32 seconds we can do for timeout.

Shift to using == rather than < or > for calculating the timeout,
since if we can't read the ST_CTRT register twice in a second we have
even bigger problems to worry about, and == deals with the 'wrap'
issue.

This lets me type at the boot2 prompt again!  Woo Hoo!

Bogusness noticed by: tisco
Pointy Hat to: That silly imp guy
2007-03-28 22:40:37 +00:00
Warner Losh
d63927b199 Since we're about to set ST_RTMR to 1 to increase the accuracy of the
CRTR register to be 1/32768th of a second in init, we don't need to do
it here.
2007-03-28 22:38:01 +00:00
Warner Losh
304d0536ab All SD cards have a block size of 512. The READ_BL_LEN field in the
CSD is usually 512 (well, 9), but for 2GB (and the rogue 4GB SD cards)
it is 1024 (or 2048 for 4GB).  This value doesn't work for the block
read commands (which really want 512).  Hardcode 512 for those.  This
may break really old MMC cards that don't have a 512 block size (I've
never seen one: make my day and send me one :-), but since the MMC
side of the house is currently broken, it should only have the effect
that 2GB (and non-conforming 4GB) SD cards will work.

My 'non-conforming' 4GB SD card also works now too.  The
non-conforming 4GB SD cards were sold for a while before the SD
association was worried they would be (a) incompatible (different FAT
flavor on them) and (b) confusing for the new SDHC standard and
cracked down on suppliers' bogus use of the SD trademark...
2007-03-28 22:31:32 +00:00
Warner Losh
5a8da39aa7 Fix problem where memcmp would return true in the case where the
character after the character that was the same.

Submitted by: jhay
2007-03-28 21:15:50 +00:00
Warner Losh
a480291907 Fix off by one error in length of the string.
Submitted by: jhay
2007-03-28 21:12:43 +00:00
Warner Losh
ae65af401c Remove vestiges of very specific fpga support for my company's board.
It isn't relevant to FreeBSD as a whole, breaks the build, and isn't
even needed for my company's boards anymore...

MFC After: 2 weeks
2007-03-15 03:31:49 +00:00
Warner Losh
6be1e1ff38 MFp4: differences for bwct ethernet attachment 2006-12-20 18:26:37 +00:00
Warner Losh
452f9afb5e MFp4: Differences in flash part for bwct. need a more generic way to cope. 2006-12-20 18:25:16 +00:00
Warner Losh
a9295f4074 MFp4: Add timeout to eeprom access for lame eeprom that go awol 2006-12-20 18:19:52 +00:00
Warner Losh
a082bf6243 MFp4: bwct memory size and PLL parameters 2006-12-20 18:18:24 +00:00
Warner Losh
b0785d970d MFp4: bwct boot rom is different. need a more generic way to cope long term. 2006-12-20 18:16:49 +00:00
Warner Losh
f358fbffa9 Mfp4: Remove mci_device.c. It should have been removed when it was
merged ito sd-card.c, but this is an imperfect world.
2006-11-16 00:55:24 +00:00
Warner Losh
e2302bcc3d Move to using a common arm_init.S. These things are more similar than
different at this point.
2006-11-16 00:53:28 +00:00
Warner Losh
338cfe36cf MFp4: boot on KB9202 correctly. Also, reduce the size of the SD/MMC driver
somewhat.
2006-11-09 20:32:36 +00:00
Warner Losh
f8b97a442a There's no fpga.c, so omit it. 2006-10-20 16:57:30 +00:00
Warner Losh
184ed5f988 MFp4:
Massive update.  The highlights:
	o dramatically cut memory usage by writing better, less intertwingled
	  code.
	o implement booting off mmc/sd cards (sd only tested one at the moment)
	o start to split out board specific stuff for boot2.
2006-10-20 09:12:05 +00:00
Warner Losh
fc96acb9c7 MFp4: First cut at making spi and/or sd card booting work, needs work 2006-08-16 23:39:58 +00:00
Warner Losh
20311a8e46 MFp4: remove obsolete files 2006-08-10 18:19:45 +00:00
Warner Losh
87ad01e6e3 MFp4:
Remove obsolete files in list
	Add spi flash reading routines
2006-08-10 18:14:35 +00:00
Warner Losh
d4a46cca62 MFp4: Numerous changes from p4 to try to improve tftp downloading,
reduce code footprint, etc.  While some problems still remain, the
reliability of tftp is much improved.
2006-08-10 18:11:22 +00:00
Warner Losh
cabd3e547a MFp4: consolidate #include files down to lib.h 2006-08-10 18:07:49 +00:00
Warner Losh
592c5848a6 MFp4: These will migrate to the boot specific directories because they
are too hard to share between the different boot loaders.
2006-08-10 18:07:01 +00:00
Warner Losh
98de821987 MFp4: Make it clearer that the address passed to the eeprom routines is
really an offset within the eeprom device, and not a IIC address.
2006-08-10 18:03:50 +00:00
Warner Losh
7492b55513 MFp4: Catchup with migration of some defines. 2006-08-10 18:02:27 +00:00
Warner Losh
5c35a13adf MFp4: Tweaks for our board. 2006-08-10 17:59:22 +00:00
Warner Losh
b51b3172ba MFp4: Increase character timeout to 10. Make it a #define for easier
changes in the future.  This helps with getting started and to
overcome the really sucky level of granuality this timeout has in
getc.  A timeout of 1 means 'wait until top of next second' rather
than 'wait for at least a second'.
2006-08-10 17:54:51 +00:00
Warner Losh
7ea1357336 MFp4:
Make getc(0) polling (this has the happy side effect of saving
	8 bytes in the generated code).
2006-04-21 13:58:51 +00:00
Warner Losh
69f5220b21 MFp4: Loop forever getting characters... A kludge for now. 2006-04-21 13:56:26 +00:00
Warner Losh
750f97a294 MFp4: Integrate support for building tag support for linux booting. 2006-04-21 13:51:47 +00:00
Warner Losh
ac1e0174a6 MFp4:
On the KB9202 go ahead and enable the flash controller so the boot
loader can access the parallel flash.
2006-04-21 07:29:14 +00:00
Warner Losh
42ed626f87 MFp4:
Make this compile, assuming that you have linux installed in a
sensible place.  tag_list is disabled by default, since we don't
distribute linux, but it is desirable to allow the boot loader to boot
Linux or FreeBSD (mostly for testing).
2006-04-21 07:19:22 +00:00
Warner Losh
9ac58632a3 MFp4:
Minor diffs to reduce diffs to p4.
2006-04-21 07:12:12 +00:00
Warner Losh
ae78672c56 MFp4 (checkpoint of work in progress):
o Use a directory layout that is more akin to the i386 boot layout.
o Create a libat91 for library routines that are used by one or more
  of the boot loaders.
o Create bootiic for booting from an iic part.
o Create bootspi for booting from an spi part.
o Optimize the size of many of these routines (especially emac.c).  Except
  for the emac.c optimizations, all these have been tested.
o eliminate the inc directory, libat91 superceeds it.
o Move linker.cfg up a layer to allow it to be shared.
2006-04-19 17:16:49 +00:00