aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/arm/at91
Commit message (Collapse)AuthorAgeFilesLines
* Remove sys/boot/arm/at91 and ixp425Warner Losh2017-10-2565-9321/+0
| | | | | | | | | | | | | Remove at91 bootloader. It only worked on AT91RM9200, and only specific boards that were all EOLd 10 years ago. Remove ixp425. It doesn't build anymore and is for boards that were EOLd 8 years ago. Sponsored by: Netflix Notes: svn path=/head/; revision=324982
* Make at91 boot loader compile again.Warner Losh2017-10-221-1/+8
| | | | | | | No clue if it actually still works, but it might. Notes: svn path=/head/; revision=324878
* Revert r321969Enji Cooper2017-08-033-14/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My change had good intentions, but the implementation was incorrect: - printf was returning the number of characters in the format string plus the NUL, but failed in two regards implementation wise: -- the pathological case, printf(""), wasn't being handled properly since the pointer is always incremented, so the value returned would be off-by-one. -- printf(3) reports the number of characters printed post-conversion via vfprintf, etc. - putchar(3) should return the character printed or EOF, not the number of characters output to the screen. My goal in making the change (again) was to increase parity, but as bde pointed out these are freestanding functions, so they don't have to conform to libc/POSIX. I argued that the functions should be named differently since the implementation is different enough to warrant it and to allow boot2 code to be usable when linked against sys/boot and libstand and other libraries in base. I have no interest in pushing this change forward more though, as the original concern I had behind the change with zfsboottest was resolved in r321849 and r321852. The next person that updates the toolchain gets to deal with the inconsistency if it's flagged by a newer compiler. MFC after: 1 month Reported by: ed, markj Notes: svn path=/head/; revision=321991
* Fix the return types for printf and putchar to match their libc andEnji Cooper2017-08-033-11/+14
| | | | | | | | | | | | | | | POSIX equivalents Both printf and putchar return int, not void. This will allow code that leverages the libcalls and checks/rely on the return type to interchangeably between loader code and non-loader code. MFC after: 1 month Notes: svn path=/head/; revision=321969
* sys/boot: spelling fixes in comments.Pedro F. Giffuni2016-04-304-10/+10
| | | | | | | No functional change. Notes: svn path=/head/; revision=298826
* Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni2016-04-101-1/+1
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
* RBX_ defines are in rbx.h, move it there.Warner Losh2016-01-261-36/+1
| | | | | | | Differential Revision: https://reviews.freebsd.org/D5038 Notes: svn path=/head/; revision=294766
* Move all the separate copies of the same strings into paths.h. There'sWarner Losh2016-01-261-4/+3
| | | | | | | | | nothing machine specific about these. Differential Revision: https://reviews.freebsd.org/D5038 Notes: svn path=/head/; revision=294765
* Enable at91 systems to boot from high capacity SD cards.Ian Lepore2014-07-263-142/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also fixes a few minor violations of the SD protocol, such as running the bus at high speed during the card identification sequence. The sdcard_init() routine now probes for SDHC cards so that later read requests can make needed adjustments between block and byte offsets based on card type. There is a new MCI_readblocks() function that takes block number and block count parameters instead of byte-offset values. Using this routine, boot loader code can load a kernel from any location on an SDHC or standard SD. The old MCI_read() interface remains unchanged so that existing customized boot loader code will still keep working without changes. Using this routine, boot loaders can load a kernel from anywhere in the first 4GB of an SDHC card (or of course any location on a standard SD card). A new sdcard_use4wire() routine allows boot loaders to request 4-bit transfers; it should be called after sdcard_init(). The sdcard_init() routine no longer assumes the hardware is 4-wire capable and by default sets things up for 1-bit transfers. (4-wire mode is unreliable on at91rm9200, works on later SoCs.) PR: 155894 Submitted by: me. years ago. Notes: svn path=/head/; revision=269113
* The 'flags' variable is conflicting with some inline code in a header fileIan Lepore2014-07-261-2/+2
| | | | | | | | ("variable flags shadows a global..."), just rename this variable to wish away the problem. Notes: svn path=/head/; revision=269112
* Eliminate "no previous prototype for main" warnings.Ian Lepore2014-07-266-1/+14
| | | | Notes: svn path=/head/; revision=269111
* Silence a clang warning about a while loop with an empty body.Ian Lepore2014-07-261-2/+4
| | | | Notes: svn path=/head/; revision=269110
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-062-0/+3
| | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* NO_MAN= has been deprecated in favor of MAN= for some time, go aheadWarner Losh2014-04-137-7/+7
| | | | | | | | | and finish the job. ncurses is now the only Makefile in the tree that uses it since it wasn't a simple mechanical change, and will be addressed in a future commit. Notes: svn path=/head/; revision=264400
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisEitan Adler2013-11-301-1/+1
| | | | | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva Notes: svn path=/head/; revision=258780
* Convert old make variable modifiers :U and :L to bmake :tu and :tl.Tijl Coosemans2013-06-022-2/+2
| | | | | | | Reviewed by: sjg Notes: svn path=/head/; revision=251250
* Use the pin number rather than the hybrid pin number + name.Warner Losh2012-07-157-35/+35
| | | | Notes: svn path=/head/; revision=238463
* Generalize this for loading the loader into the SPI. Plus trim aboutWarner Losh2012-07-071-11/+5
| | | | | | | | | 100 bytes from the binary with silly tricks. Hope to get this small enough to run on the models that have 4k SRAM. We are close compiled for the at91rm9200, but still need to trim for the target. Notes: svn path=/head/; revision=238188
* Allow other SOCs to be compiled in, first step.Warner Losh2012-07-071-1/+3
| | | | Notes: svn path=/head/; revision=238187
* Strip out the useless junk. All we really care about is the text,Warner Losh2012-07-071-232/+0
| | | | | | | | data and bss sections. All the rest is needed for normal binaries, but boot loaders aren't normal. Notes: svn path=/head/; revision=238186
* Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and preventGleb Kurtsou2012-05-251-4/+3
| | | | | | | | | unnecessary 64-bit math on 32-bit machines. Sponsored by: Google Summer of Code 2011 Notes: svn path=/head/; revision=235988
* Add support for passing in the board ID.Warner Losh2012-05-111-2/+3
| | | | | | | | | | | # This doesn't implement the full Linux boot ABI for arm yet. # since there's no ATAGs list passed in for r2, and r0 has # boot options rather than 0 as specified in the standard. # Commited code to the tree won't touch any of this anyway, but # future code may be able to use this. Notes: svn path=/head/; revision=235272
* Hack to unbreak boot2 for at91rm9200 boot loader. When the at91samWarner Losh2012-05-111-0/+2
| | | | | | | | | code came in, it moved things around which wound up breaking the build. We have to do this bit of a hack to avoid duplication of a lot of #defines. Notes: svn path=/head/; revision=235271
* Replace `inline static' by `static inline'.Ed Schouten2011-12-131-2/+2
| | | | | | | | | If I interpret the C standard correctly, the storage specifier should be placed before the inline keyword. While at it, replace __inline by inline in the files affected. Notes: svn path=/head/; revision=228471
* Look for /boot/config in addition to /boot.config, with the former takingDag-Erling Smørgrav2011-10-181-2/+4
| | | | | | | | | precedence over the latter if it exists. MFC after: 3 weeks Notes: svn path=/head/; revision=226506
* No need to list an obsolete arm compiler here.Warner Losh2011-01-202-2/+0
| | | | Notes: svn path=/head/; revision=217663
* Don't need __DYNAMIC here. it is commented out and a.out only -- these are ↵Warner Losh2011-01-201-2/+0
| | | | | | | all ELF. Notes: svn path=/head/; revision=217657
* BWCT boards can have 128MB SDRAM.Bernd Walter2010-03-092-2/+6
| | | | Notes: svn path=/head/; revision=204900
* fix signed warningBernd Walter2010-03-091-1/+1
| | | | Notes: svn path=/head/; revision=204899
* More diff reductions against ixp425/boot2/boot2.c. This time, weWarner Losh2008-10-071-0/+87
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=183673
* Bring in the trivial differences between this code and John Hay's newWarner Losh2008-10-051-17/+26
| | | | | | | | | | | | | | | 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@ Notes: svn path=/head/; revision=183636
* Remove XMODEM_DL support. It never was complete and only serves toWarner Losh2008-10-053-14/+0
| | | | | | | increase the diffs with other arm boot2 loaders. Notes: svn path=/head/; revision=183635
* Indent with 8-space tabs. This reduces the diffs to the newer ixp425Warner Losh2008-10-051-165/+169
| | | | | | | boot2 and may make it easier to merge these files in the future... Notes: svn path=/head/; revision=183634
* Enable GCC stack protection (aka Propolice) for userland:Ruslan Ermilov2008-06-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | - 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> Notes: svn path=/head/; revision=180012
* - remove code from oroginal file, which is not required on BWCT boardsBernd Walter2007-12-231-52/+86
| | | | | | | | | | - Be more chatty on startup, since we have enough code space on AT91RM9200 - init DS1672 charging - init USART GPIO Notes: svn path=/head/; revision=174878
* BWCT boards uses two different SPI flash chipsBernd Walter2007-12-231-2/+3
| | | | | | | check for both status codes Notes: svn path=/head/; revision=174877
* Use the smaller cgbase() macro in ufsread.c if UFS_SMALL_CGBASE isJohn Baldwin2007-10-261-0/+1
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=173040
* Fix signedness to make gcc happy.Olivier Houchard2007-10-253-4/+4
| | | | Notes: svn path=/head/; revision=172991
* Load the bytes into the EMAC's MAC address register in the properWarner Losh2007-10-251-2/+2
| | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=172952
* Don't pass RB_BOOTINFO to the kernel. There's no bootinfo actuallyWarner Losh2007-08-171-1/+1
| | | | | | | | | | passed into the kernel, and the kernel will soon grow that ability on arm. Approved by: re@ (blanket) Notes: svn path=/head/; revision=171876
* Use the .S version for now. I have a version optimized for size p4,Warner Losh2007-08-091-1/+1
| | | | | | | | | | but I'm unsure of its provenance, so rather than add it here, revert the migration to it. Approved by: re@ (blanket) Notes: svn path=/head/; revision=171794
* MFp4:Warner Losh2007-07-1311-34/+197
| | | | | | | | | | | | | 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@ Notes: svn path=/head/; revision=171426
* Loop on sdcard init. This helps if one hasn't plugged in the cardWarner Losh2007-04-021-1/+2
| | | | | | | fast enough, or there's other issues that cause the first try to fail. Notes: svn path=/head/; revision=168279
* RTC_TIMR's RTC_SEC field is BCD. That makes it unsuitable forWarner Losh2007-03-284-8/+13
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=168013
* Since we're about to set ST_RTMR to 1 to increase the accuracy of theWarner Losh2007-03-281-3/+0
| | | | | | | | CRTR register to be 1/32768th of a second in init, we don't need to do it here. Notes: svn path=/head/; revision=168012
* All SD cards have a block size of 512. The READ_BL_LEN field in theWarner Losh2007-03-281-4/+6
| | | | | | | | | | | | | | | | | | | 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... Notes: svn path=/head/; revision=168011
* Various buglets fixed (from submitter):Warner Losh2007-03-281-6/+7
| | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=168007
* Fix problem where memcmp would return true in the case where theWarner Losh2007-03-281-1/+1
| | | | | | | | | character after the character that was the same. Submitted by: jhay Notes: svn path=/head/; revision=168006
* Fix off by one error in length of the string.Warner Losh2007-03-281-1/+1
| | | | | | | Submitted by: jhay Notes: svn path=/head/; revision=168005
* Remove vestiges of very specific fpga support for my company's board.Warner Losh2007-03-152-38/+1
| | | | | | | | | | 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 Notes: svn path=/head/; revision=167586