Commit Graph

95 Commits

Author SHA1 Message Date
Sam Leffler
656c23db6e add delays around 16-bit enable/disable a la the driver; w/o this
operation on my ixp435 Cambria board is unreliable
2008-12-19 00:56:47 +00:00
Sam Leffler
4173c22644 merge WIP multi-board support; tested on Avila and Cambria, still
needs Proghorn testing
2008-12-13 02:56:08 +00:00
Rafal Jaworowski
8504549387 Let ARM loader(8) build with the man page. 2008-11-27 16:53:01 +00:00
Rafal Jaworowski
11cdd0c0c2 Initial storage functionality for U-Boot support library.
- Only non-sliced bsdlabel style partitioning is currently supported (but provisions
  are made towards GPT support, which should follow soon)
- Enable storage support in loader on ARM

Obtained from:	Semihalf
2008-11-19 17:34:28 +00:00
Rafal Jaworowski
0ed948780c Initial support of loader(8) for ARM machines running U-Boot.
This uses the common U-Boot support lib (sys/boot/uboot, already used on
FreeBSD/powerpc), and assumes the underlying firmware has the modern API for
stand-alone apps enabled in the config (CONFIG_API).

Only netbooting is supported at the moment.

Obtained from:	Marvell, Semihalf
2008-10-14 10:11:14 +00:00
Warner Losh
63b90047fc More diff reductions against ixp425/boot2/boot2.c. This time, we
bring in FIXUP_BOOT_DRV functionality as an #ifdef.  This is not
enabled at this time, and the md5 remains constant with this change.
Apart from the 'accept any partitioning scheme on the device' changes,
this was the biggest delta...

# and yes, we'll merge these into one source file if we can do that in a
# way that makes sense.

Obtained from:	sys/boot/arm/ixp425/boot2/boot2.c
2008-10-07 17:44:04 +00:00
Warner Losh
d7798997d7 Diff reduction with boot/arm/at91/boot2/boot2.c: indent this statement
correctly.
2008-10-07 17:27:37 +00:00
Sam Leffler
6497012386 don't hardcode cc
Submitted by:	Andrey Eltsov
2008-10-07 16:39:17 +00:00
John Hay
563db8c39c Add a boot loader for ixp425 based boards like the Gateworks Avila
and ADI Pronghorn Metro with Redboot on them.
2008-10-06 19:38:10 +00:00
Warner Losh
8af5ac823c Bring in the trivial differences between this code and John Hay's new
code.  Added a copyright for the work I did to this file a couple of
years ago.  Add John's copyright too, since I'm sure I'll be pulling
more into this code.  This also implements a new -n option to not
allow breaking into the boot sequence which was original in the patch
John posted (not in the original i386 code I based this boot2.c on,
only the name is the same).  I haven't checked to see if he did that,
or if it was one of Sam's improvements.

Submitted by:	jhay@
2008-10-05 23:59:52 +00:00
Warner Losh
6f07042ef4 Remove XMODEM_DL support. It never was complete and only serves to
increase the diffs with other arm boot2 loaders.
2008-10-05 23:39:28 +00:00
Warner Losh
06afbca3c8 Indent with 8-space tabs. This reduces the diffs to the newer ixp425
boot2 and may make it easier to merge these files in the future...
2008-10-05 23:37:03 +00:00
Ruslan Ermilov
042df2e2da Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
  turned opt-in for stable branches depending on the consensus.  You
  can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
  It is harmless to steal the knob as SSP symbols have been provided
  by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
  (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
  libc will be automatically downgraded to -fstack-protector because it
  breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by:	Jeremie Le Hen <jeremie@le-hen.org>
2008-06-25 21:33:28 +00:00
Bernd Walter
36782b8ef3 - remove code from oroginal file, which is not required on BWCT boards
- Be more chatty on startup, since we have enough code space on
  AT91RM9200
- init DS1672 charging
- init USART GPIO
2007-12-23 14:57:35 +00:00
Bernd Walter
fc29b8c535 BWCT boards uses two different SPI flash chips
check for both status codes
2007-12-23 14:46:30 +00:00
John Baldwin
fd6d060f0d Use the smaller cgbase() macro in ufsread.c if UFS_SMALL_CGBASE is
defined.  This lets each boot program choose which version of cgbase() it
wants to use rather than forcing ufsread.c to have that knowledge.

MFC after:	1 week
Discussed with:	imp
2007-10-26 21:02:31 +00:00
Olivier Houchard
26989574c9 Fix signedness to make gcc happy. 2007-10-25 22:50:25 +00:00
Warner Losh
3e6468f751 Load the bytes into the EMAC's MAC address register in the proper
order.  The kernel used to shuffle them around to get things right,
but that was recently fixed.  This makes our boot loader match the
behavior of most other boot loaders for the atmel parts.  This bug was
inherited from the Kwikbyte loader that we started from.

This bug was discovered by Bj.ANvrn KNvnig back in June, but fell on the
floor.  He provided patches to the kernel, include backwards
compatibility options that were similar to Olivier's if_ate.c commit.
2007-10-25 07:05:38 +00:00
Warner Losh
eb2e7f82ff Don't pass RB_BOOTINFO to the kernel. There's no bootinfo actually
passed into the kernel, and the kernel will soon grow that ability on
arm.

Approved by: re@ (blanket)
2007-08-17 18:22:31 +00:00
Warner Losh
4ced8fb56a Use the .S version for now. I have a version optimized for size p4,
but I'm unsure of its provenance, so rather than add it here, revert
the migration to it.

Approved by: re@ (blanket)
2007-08-09 05:16:55 +00:00
Warner Losh
229af622b8 MFp4:
Add support for the CENTIPAD board (http://www.harerod.de/centipad/index.html)
	(which is a very cool, very small ARM board)
Add support for KB9202B (it has different memory)
Make BOOT_FLAVOR settable
Minor cleanup nits

Approved by: re@
2007-07-13 14:27:05 +00:00
Warner Losh
cf5bdd4446 Loop on sdcard init. This helps if one hasn't plugged in the card
fast enough, or there's other issues that cause the first try to fail.
2007-04-02 20:26:04 +00:00
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
89e75021fa Various buglets fixed (from submitter):
The changes to getstr() is so that the character that is
	passed in to it, is also processed just as the rest. I also
	removed one of the getc() calls otherwise you loose every
	second character.

	I also changed the strcpy of kname, so that it only happens if
	kname is '\0'. This is so that one can pass a kernel in
	through /boot.config.

	The last change to boot2.c is in parse(). If you tried to type
	a kernel name to boot, the first character was lost, the arg--
	fix that.

Submitted by: jhay
2007-03-28 21:18:45 +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
1962e68df3 MFp4: Delay a second or two after the upload before printing Done.
Add an automatic reset for remote operational luvin' goodness.
2006-12-20 17:50:02 +00:00
Warner Losh
ea705f59a6 MFp4: bwct is a new board choice. 2006-12-20 17:47:54 +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
a2288572aa MFp4: Don't fix the size at 8k, and some minor cleanups. andre@ contributed
to fixing this problem.
2006-11-16 00:49:50 +00:00
Warner Losh
b9f3efc87a MFp4: Improvements, including the ability to download to an arbitrary
part of the spi flash.
2006-11-16 00:48:53 +00:00
Warner Losh
1920635c8e Tweaks for better boot flavor support. 2006-11-16 00:48:04 +00:00
Warner Losh
88009adfcf Mfp4: We no longer need ee.h included here. 2006-11-16 00:47:31 +00:00
Warner Losh
f31202e5dd MFp4: boot2 should now build 2006-11-09 20:45:22 +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
ee9a71cdf5 MFp4: Support KB9202 booting better 2006-11-09 20:23:51 +00:00
Warner Losh
9b1ab45dc1 Fix typo 2006-11-09 20:08:46 +00:00
Warner Losh
e2a7a4c11c MFp4: Make boot2 work on Kwikbyte KB9202 boards. 2006-11-09 20:07:26 +00:00
Warner Losh
c2c2926f9e MFp4: Merge a slightly more generic build infrastructure. 2006-11-09 19:58:14 +00:00
Warner Losh
728ba3929d MFp4: Remove bogus \r 2006-11-09 19:55:25 +00:00
Warner Losh
ecaaf14497 Don't descend into at91 until we sort out the boot loader issues more generally 2006-10-23 00:05:28 +00:00