aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/arm/at91/libat91
Commit message (Collapse)AuthorAgeFilesLines
* Remove sys/boot/arm/at91 and ixp425Warner Losh2017-10-2532-6530/+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
* 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-302-8/+8
| | | | | | | 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
* 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
* 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-061-0/+1
| | | | | | | 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-131-1/+1
| | | | | | | | | 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
* Use the pin number rather than the hybrid pin number + name.Warner Losh2012-07-156-31/+31
| | | | Notes: svn path=/head/; revision=238463
* Allow other SOCs to be compiled in, first step.Warner Losh2012-07-071-1/+3
| | | | Notes: svn path=/head/; revision=238187
* 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
* BWCT boards can have 128MB SDRAM.Bernd Walter2010-03-091-1/+1
| | | | Notes: svn path=/head/; revision=204900
* BWCT boards uses two different SPI flash chipsBernd Walter2007-12-231-2/+3
| | | | | | | check for both status codes Notes: svn path=/head/; revision=174877
* 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
* 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-135-5/+17
| | | | | | | | | | | | | 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
* 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
* 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-151-1/+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
* MFp4: differences for bwct ethernet attachmentWarner Losh2006-12-202-3/+13
| | | | Notes: svn path=/head/; revision=165401
* MFp4: Differences in flash part for bwct. need a more generic way to cope.Warner Losh2006-12-202-0/+35
| | | | Notes: svn path=/head/; revision=165400
* MFp4: Add timeout to eeprom access for lame eeprom that go awolWarner Losh2006-12-202-4/+8
| | | | Notes: svn path=/head/; revision=165399
* MFp4: bwct memory size and PLL parametersWarner Losh2006-12-201-0/+8
| | | | Notes: svn path=/head/; revision=165398
* MFp4: bwct boot rom is different. need a more generic way to cope long term.Warner Losh2006-12-201-0/+4
| | | | Notes: svn path=/head/; revision=165397
* Mfp4: Remove mci_device.c. It should have been removed when it wasWarner Losh2006-11-161-575/+0
| | | | | | | merged ito sd-card.c, but this is an imperfect world. Notes: svn path=/head/; revision=164324
* Move to using a common arm_init.S. These things are more similar thanWarner Losh2006-11-161-0/+125
| | | | | | | different at this point. Notes: svn path=/head/; revision=164323
* MFp4: boot on KB9202 correctly. Also, reduce the size of the SD/MMC driverWarner Losh2006-11-0915-163/+331
| | | | | | | somewhat. Notes: svn path=/head/; revision=164137
* There's no fpga.c, so omit it.Warner Losh2006-10-201-1/+1
| | | | Notes: svn path=/head/; revision=163542
* MFp4:Warner Losh2006-10-2022-1058/+793
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=163533
* MFp4: First cut at making spi and/or sd card booting work, needs workWarner Losh2006-08-1611-87/+2297
| | | | Notes: svn path=/head/; revision=161370
* MFp4: remove obsolete filesWarner Losh2006-08-102-109/+0
| | | | Notes: svn path=/head/; revision=161198
* MFp4:Warner Losh2006-08-103-2/+294
| | | | | | | | Remove obsolete files in list Add spi flash reading routines Notes: svn path=/head/; revision=161197
* MFp4: Numerous changes from p4 to try to improve tftp downloading,Warner Losh2006-08-102-242/+230
| | | | | | | | reduce code footprint, etc. While some problems still remain, the reliability of tftp is much improved. Notes: svn path=/head/; revision=161196
* MFp4: consolidate #include files down to lib.hWarner Losh2006-08-104-69/+24
| | | | Notes: svn path=/head/; revision=161195
* MFp4: These will migrate to the boot specific directories because theyWarner Losh2006-08-102-633/+0
| | | | | | | are too hard to share between the different boot loaders. Notes: svn path=/head/; revision=161194
* MFp4: Make it clearer that the address passed to the eeprom routines isWarner Losh2006-08-101-8/+8
| | | | | | | really an offset within the eeprom device, and not a IIC address. Notes: svn path=/head/; revision=161193
* MFp4: Catchup with migration of some defines.Warner Losh2006-08-101-317/+1
| | | | Notes: svn path=/head/; revision=161192
* MFp4: Tweaks for our board.Warner Losh2006-08-101-1/+1
| | | | Notes: svn path=/head/; revision=161191
* MFp4: Increase character timeout to 10. Make it a #define for easierWarner Losh2006-08-101-8/+9
| | | | | | | | | | 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'. Notes: svn path=/head/; revision=161190
* MFp4:Warner Losh2006-04-211-2/+2
| | | | | | | | Make getc(0) polling (this has the happy side effect of saving 8 bytes in the generated code). Notes: svn path=/head/; revision=157940
* MFp4: Loop forever getting characters... A kludge for now.Warner Losh2006-04-211-1/+1
| | | | Notes: svn path=/head/; revision=157939
* MFp4: Integrate support for building tag support for linux booting.Warner Losh2006-04-211-0/+7
| | | | Notes: svn path=/head/; revision=157938
* MFp4:Warner Losh2006-04-211-1/+13
| | | | | | | | On the KB9202 go ahead and enable the flash controller so the boot loader can access the parallel flash. Notes: svn path=/head/; revision=157924