Summary

APEX is a boot loader for embedded systems. It was written to support the Sharp LH series of wp:System_on_chip processors though it has been ported to a few other ARM targets including the Samsung S3C24xx series.

Easy to build. It depends only on shell utilities and GCC.

Easy to configure. There is a single configuration file and it uses the linux-2.6 Kconfig infrastructure.

src/apex/command.c (expand_variables): Revised expand_variables code to expand references within expanded references. This change permits us to define the kernel location, for example, as depending on the $serverip.

2009-01-23 Version 1.6.8

Makefile (SUBLEVEL): v1.6.8

src/mach-lh7a40x/initialize.c (target_init): Added code to the target initialization for Companion that initializes the modem.

2009-01-21 Version 1.6.7

Makefile (SUBLEVEL): v1.6.7 for push of new features.

src/drivers-lh/drv-mmc.c (mmc_report): Revised reporting to make it easier to troubleshoot cards.

2009-01-20 Version 1.6.6

include/mmc.h (mmc_card_acquired): Revised the card acquisition code so that we don't assume that the first byte of the CID register is non-zero. IMHO, our assumption was correct based on the SD association's documentation, but we found that the Eye-FI card has a bogus looking card ID (CID) register and we have to be lenient to see it.

Makefile (SUBLEVEL): v1.6.6 for Companion fixes so it can use a 1.6.x version of APEX.

src/drivers/relocate-nand.c: Revised NAND relocator to work with the LPD7A404. Considering that the only other user of the code is a test implemented for the LH79524, this should be safe to rework. The key difference is that the relocator will address each page in turn instead of depending on an unreliable feature of NAND flash that automatically loads successive sectors.

src/arch-arm/Kconfig: Changed the Companion bootstrap to use the NAND relocator. This allows us to have a loader that is larger than 80KiB, the size of SRAM. Added a page size configuration option for relocation from NAND flash.

src/apex/cmd-version.c (cmd_version): Fixed display of environment variables s.t. the >64KiB length is properly shown in the version command output.

src/apex/cmd-image.c (cmd_image): Added an option to relocate the ramdisk image s.t. the uBoot image format can be loaded with "image load" and then used to boot the system.

2009-01-05 Version 1.6.5

src/mach-orion5x/mv2120_config: Moving to the CodeSourcery compiler for thumb support.

src/arch-arm/lib/cp15-invalidate-dcache-va.c (invalidate_dcache_va): Conditionally compiling the invalidate-dcache-va function based on the presence of the macro and, therefore, the CP15 feature.

Makefile (SUBLEVEL): 1.6.5 for orion5x merge.

src/apex/cmd-flashusage.c (cmd_flashusage): New command to scan eraseblocks of a flash device for the presence of data.

src/mach-lh7952x/memory.h (RAM_BANK0_LENGTH): Fixed the declarations of the extents for the memory regions in the LH7952x. The macros were correct for the LH79524 but not the LH79520. This is now fixed.

src/drivers/drv-ext2.c (ext2_identify): Revised EXT2 driver to took for extended partitions and to cope with 64 bit IO.

include/driver.h: Support for 64 bit IO sizes. This is only necessary for large devices like those accessible via ATA/SATA. It is optional and somewhat expensive. Even the EXT2 driver will function without it, but it won't be able to see partitions past 2GiB. This change trickled into lots of areas of APEX because of the change of types in the descriptor structure. However, there should be no size or performance impact when the system is compiled without CONFIG_DRIVER_LONG_LONG_SIZE.

src/arch-arm/lib/muldi3.S: Inclusion of another kernel function for handling aeabi entry points. This was required by drv-ata when we compiled it with THUMB.

src/arch-arm/lib/cp15-wait.c: This and other cp15 functions so that cp15 operations can be invoked from THUMB code without THUMB2 support and without specialized code to detect the operation mode. These functions allow all code that lacks __asm's to be compiled with THUMB.

src/drivers/drv-fat.c (fat_open): Adding greater specificity to the region construction from the block_driver().

src/drivers/drv-ext2.c (ext2_open): Adding greater specificity to the region construction from the block_driver().

src/drivers/driver.c (parse_descriptor): Fix to disambiguate regions that could have path elements. The parser would not interpret driver:10k as having a start address of 10k when the driver could accept a path. Now, parser will interpret driver:bin as having a path of 'bin', but driver:10k as having a starting offset as 10k. The region can be unambiguously constructed using '@' and '/' appropriately.

src/mach-mx3/drv-i2c.c: New I2C driver for MX3x. Not complete, but working for writes to the I2C#1 controller.

src/mach-mx3/cmd-wm8955.c: New command for sending control messages to the WM8955L on the PSJL Karma.

src/drivers/driver.c (parse_descriptor): Fix for the parsing of FS descriptors such that the start address and length parameters may be set.(parse_descriptor): Added the '%' special character for combining one or more descriptors. This is used by the drivers that have a basis driver defined in an environment variable, s.t. the driver can specify a starting address and/or length without knowing the exact form specified by the

2008-12-18 Version 1.6.4

Makefile (SUBLEVEL): Rolling revision for PSJL implementation. 1.6.4.

src/drivers/drv-nor-cfi.c (nor_probe_chip): Support for broken AMD/Spansion NOR flash that does not properly report top-boot vs. bottom-boot.

src/drivers/drv-nor-cfi.c: In order to support the Micronix (Spansion compatible) NOR flash in the HP MediaVault 2120, we needed to completely fill out the Spansion support. There is support for a single byte wide bus and a 16 bit internal logic as is the case on the MV2120.

src/drivers/drv-nor-cfi.c (ReadArray): Changed the ReadArray command for Spansion to 0xf0.

src/arch-arm/lib/cp15.c (cp15_ctrl): Enhanced the cp15 report on the control register to be more readable and to show more bits (ARMv6).

src/apex/cmd-image.c (cmd_image): Adding descriptor_open() call to image load so that we can read from tftp.

2008-11-13 Version 1.6.3

Makefile (SUBLEVEL): Version 1.6.3 for dm9000. The initial orion patches are in as well, but not yet supported.

src/drivers/drv-dm9000.c (dm9000_read): Implementation of dm9000_{read,write} to round out support for dm9000 as a complete Ethernet MAC/PHY driver.

src/lib/strtol.c: Adding strtol as a separate library function, in case it is needed. The memlimit command will use this function.

src/mach-mx3/rosencrantz.h (CCM_PDR0_V): Override for the PDR0 so that the CSI clock scalar is non-default.

src/mach-mx3/mx31.h (CCM_UPCTL_266_V): Fixed the UPCTL initialization values. This PLL is based on the CKIH, so it doesn't need to change when the CPU clock speed changes. (CCM_PDR0_V): Allowing this value to be overridden by the board specific header.

src/drivers/drv-mem.c (cmd_memlimit): Revised memlimit to permit a negative offset which is then subtracted from the total system memory.

debian/rules (binary-arch): Adding apex-image to the tools installed in the debian package.

src/apex/cmd-image-uboot.c: Documentation for UBOOT image format. (verify_uboot_image): Added support for multi-images. Now loading UBOOT images the same way that UBOOT does.

src/apex/region-checksum.c (region_checksum): Fixed the checksum to account for incoming CRC value as is necessary for UBOOT image CRC computation.

src/apex/cmd-image-uboot.c: Added uboot image support. No multi-images, but the rest works OK.

src/apex/region-checksum.c (region_checksum): Added neglected check for whether or not the caller wants the length added to the checksum

src/apex/cmd-image-apex.c (handle_apex_image): Factored out the APEX image code so we can implement UBOOT in separate file with optional compilation.

src/arch-arm/entry/apex.lds.S: Renamed some of the sections to make the meanings clear. Preemtively fixed a vulnerability to section reordering. Fixed the setting of fSDRAMBoot so that it works for INLINE init mode and for the older form.

src/mach-ixp42x/initialize.c (bootstrap_sdram_pre): Revamped the initialization code for ixp42x to use inline mode. Took the opportunity to elide a lot of cruft from the routines. It isn't yet tested as written to flash as this requires setup of one of the wigglers. None of the typical uses of APEX on the ixp42x install APEX as the primary boot loader, so this can wait.

src/arch-arm/Kconfig: Configuration option to override the default SDRAM execution detection code. Most platforms can use the execution address to detect whether or not APEX is running in SDRAM. Some, like the ixp42x map flash over SDRAM, so we have to use a custom piece of code to detect this circumstance.

src/arch-arm/Kconfig: Added AEABI configuration option so that we can link APEX with an AEABI toolchain. Really, the only difference is the inclusion of a couple of math functions.

src/arch-arm/lib/lib1funcs.S: Added config.h to build of lib1funcs so that the configuration dependencies are checked.

2007-06-02 Version 1.5.6

src/arch-arm/entry/reset.c: Fixed a problem in the ordering of the reset sections that was illuminated by rwhitby's default compiler.

2007-06-01 Version 1.5.5

Makefile (SUBLEVEL): 1.5.5 for the SAVEATONCE option, very necessary for OneNAND stored environment.

src/lib/env.c: New option, CONFIG_ENV_SAVEATONCE implements a cached environment that is saved at one time to non-volatile storage instead of through incremental updates. This is necessary for some types of NAND flash where multiple writes to the same page are limited.

src/apex/*.c: Groomed error reporting for opening regions.

src/lib/env.c: Changed the environment region descriptor name to d_env so that it is easier to remember.

2007-05-30 Version 1.5.4

Makefile (SUBLEVEL): 1.5.4. Rolling revision for the sake of the xscale fixes.

src/mach-mx3/cmd-sleep.c (cmd_sleep): Test code for MX31 sleep modes.

src/mach-mx3/cmd-reset.c (cmd_reset): Command verified.

src/arch-arm/entry/reset.c: Added a jump to reset_exit() from reset() in the event that we disable the MMU at startup. The ixp42x needs this because the xscale MMU flush code allocates data in the text section.

src/mach-ixp42x/initialize-sdram.c (cmd_initialize_sdram): Fixed the scan of 256Mib SDRAM chips. A small change to the algorithm and we seem to be able to detect 64MiB of memory just fine.

src/arch-arm/entry/apex.lds.S: Reorganized the sections and the section names to be more readable and consistent.

src/arch-arm/entry/reset.c: Restructured to allow for cleaner startup code. Legacy implementations are still OK, but the new plumbing permits seamless transitions between various initialization elements to handle constrained boot situations. Also removed an onerous constraint on register usage in the relocate_apex() function. The caller is now forced to assume that no registers are saved.

src/apex/env.c: Improved the environment link so that it can exist even if there is no user-modifiable environment. This is to allow user-land to browse environment variables even if they cannot set them.

src/mach-mx3/initialize.c: Extra check in the initialization routine so that we don't alter the timing registers if the CPU is already in the target mode. It looks like the CPU doesn't like the PLLs being changed once it has booted. It may be the SDRAM that doesn't like the timing change.

src/arch-arm/entry/reset.c: Restored setting of the CPSR mode in the loader. The CPU boots in the undefined mode. We move to supervisor mode, though this doesn't appear to be necessary for the kernel to boot.

src/mach-mx3/ipu.c (ipu_report): Improved clarity of IPU report to break out fields and to describe the formats in English.

include/asm/cp15-armv6.h: Fixed the cache control macros for the ARMV6.

src/mach-mx3/ipu.c: More IPU debug code. The report function has a clean rendering of the registers.

src/mach-mx3/initialize.c: Added initialization of COSR even though we don't use it.

src/mach-mx3/Kconfig: New architecture number for Rosencrantz.

src/apex/services.c: Created this file to hold service init/release code.

src/apex/env.c: Added a "" to the startup command so that we can have an empty startup command.

Version 1.4 Series

2007-04-09 Version 1.4.18

1.4.18 for mx31 changes.\

src/drivers/drv-mem.c (memory_read): Fixed the memory read function so that it properly reads from word width regions.

src/mach-mx3/initialize.c: Fixed the usleep timer programming. There were two problems. First, the base frequency is not as advertized. The CPU can only use the IPG clock as the basis. Second, our programming of the timer was wrong and needed to be reworked so that we properly detected the timer expiration. (__section): Added DM9000 region initialization.

src/drivers/drv-mem.c (memory_write): Revised the drv-mem write function so that it does it's best to match the requested IO width when we're writing from the fill command. Other users should be unaffected.

2007-02-25 Version 1.4.17

1.4.17

src/drivers/drv-nor-cfi.c (nor_read): Fixed the nor-cfi driver cache support. It wasn't properly purging cache entries so the write and erase code was failing. Now, we invalidate entries for the area we've read. We still see the significant improvement in read throughput.

src/arch-arm/entry/mmu.c: Added comment about how it is the called who must purge the cache on marking a block uncacheable. This also removes a bit of code that did nothing.

src/mach-ixp42x/initialize-sdram.c (cmd_initialize_sdram): SDRAM initialization code for the ixp42x so that we can initialize SDRAM even though we're not the primary boot loader. It *looks* OK, but I haven't been able to test it with multi-chip slugs.

src/drivers/drv-nand.c: Revised the NAND flash initialization code to allow for better/more flexible detection of NAND chip organizations. Without a comprehensive directory of chip IDs, we're looking for an easy way represent the ID->organization mapping.

2007-02-14 Version 1.4.16

Makefile (SUBLEVEL): 1.4.16. Rev for fat-slug support.

src/drivers/drv-mem.c (memory_scan): Fixed error in memory scan that wasn't accoounting for the last block in a region. This probably would never have been a problem, but was noticed while testing the memscan function. (cmd_memscan): New command that scans a region of memory as if we're scanning memory when APEX starts. This is useful when debugging memory initialization issues. (cmd_memscan): Added -u switch to memscan so that we can update the memory map passed to the kernel after APEX has made it's pass at initialization time.

src/drivers/drv-nor-cfi.c: Added Spansion command support to the nor-cfi driver. This is a configuration time option. Only one command set/protocol may be selected at a time.

src/drivers/drv-nand.c: Augmented NAND driver to allow for both Toshiba style command and ST style commands. The ST stuff is incomplete, but reading ought to be OK.

2007-02-05 Version 1.4.15

Makefile (SUBLEVEL): 1.4.15, allows a wait of 0 for a check for ^C before continuing. Mainly done to release to debian.

debian/rules: Dumb typo when I revised the rules. The name of the output file changed and I didn't want it to.

src/apex/cmd-wait.c: Allowing a zero TIMEOUT.

src/apex/command.c (TIMECMD_INIT): Added command execution timer.

debian/rules: Cross-building support.

src/mach-ixp42x/serial.c: Minor change to the ixp42x serial driver to raise RTS for the same of systems that use it.

src/arch-arm/lib/lib1funcs.S: New version of lib1funcs so that armel is happy. This code was pulled directly from the Linux kernel source.

Added alternatives to Debian configs.

2007-01-29 Version 1.4.14

Makefile (SUBLEVEL): Rolled rev for block cache fix.

src/drivers/drv-ext2.c: inode/block cache flush was broken. Now, it is not.

usr/apex-env.8: Man page.

usr/link.h: Added cleanup code to Link object. It isn't strictly necessary, but it is good hygiene.

2007-01-27 Version 1.4.12

Makefile: 1.4.12 for new environment program and to prepare for publishing a new release.

usr/apex-env.cc: New user-mode program for updating the APEX environment once the system is booted. It replaces the printenv program that was only able to print the environment as it stood, combining the flash data with the defaults from APEX. This program is smart enough to be able to set/unset variables and erase the whole environment.

src/mach-lh7a40x/clcdc-companion.c: Removed the DDS hack form the LCD init on Companion. No DDS circuit present anymore.

src/lib/memtest.c (memory_test_0): Revised the memory test walking bit loop on advice from a collegue. Made the full memory test an option on top of the basic memory test.

src/mach-lh7a40x/variation-companion.c (variation_init): Added variation support to the Companion. Pressing three keys at power-on will activate the variation boot.

2007-01-09 Version 1.4.11

src/drivers/drv-fis.c (prescan_directory): Fixed the partition table swapped-ness check to a more robust comparison of the partition table entry's erase block with the erase block from which the table is being read.

2007-01-08 Version 1.4.10

1.4.10.

src/drivers/drv-fis.c (deleted_entry): Replaced the end_of_table() checks with deleted_entry checks. Really, we cannot be sure that we've seen the end of the table since a 0xff in the first byte indicates a deleted entry and we have to check for that first. We previously thought that (u32)~0 was the end of the table, but we cannot now be sure. Argh.

Applyied nas100d and dsmg600 patches as well as a slew of config file patches courtesy of rwhitby.

src/drivers/drv-nor-cfi.c (SWAP_ONE): Fixed the nor flash driver to properly write when in an endian mismatched mode. This may be peculiar to the nslu2 (and other ixp4xx systems) where flash is assumed to be written in one endian-ness while the system is executing in the opposite endian-ness.

src/mach-ixp42x/variation-nslu2.c (variation_init): Variation now uses the fact that the power button is depressed (instead of the reset button).

src/lib/dump.c (dumpw): Fixed the printability check on dump so that we don't write non-ascii characters.

src/apex/cmd-boot.c (atag_commandline): boot command performs lookup of the default command line that allows for alternatives.

src/arch-arm/Kconfig: Reworking of the environment configuration section. We now have options to set alternative kernel command line, kernel source region, and ramdisk region. Default variation suffix is a config parameter. The default startup command is more clearly controlled.

src/mach-ixp42x/variation-nslu2.c (variation_init): Added variation for nslu2. Holding the reset button while booting will select the alternative boot and set the variation to the configured value.

src/apex/command.c (expand_variables): Added '-' to the list of acceptable characters when scanning a command for variables to expand. This is helpful for variations.

src/lib/lookup.c (lookup_alias_or_env): Variation support added to the standard lookup function.

src/apex/command.c (parse_command): Added '-' command prefix that tells APEX to ignore the return value of a command. This is helpful in the startup command.

2006-11-07 Version 1.4.9

Makefile (SUBLEVEL): Rolling rev for memory test.

src/lib/memtest.c (memory_test_0): memory test for system setup. It checks SDRAM before copying the loader post-bootstrap. Works generally on any target, but requires that the initialize_bootstrap () function return TRUE when it initializes SDRAM.

src/drivers/drv-nand.c (cmd_nand): NAND commands moved to a configurable option. (nand_report): Fixed the display of the NAND status.

src/drivers/drv-fis.c (prescan_directory): Modified the check for swapped partitions to compare the address of the directory partition with the address being scanned. Should be more robust than the original test. Also added a further limit to directory scanning using the length of the directory partition.

src/arch-arm/entry/mmu-alloc.c (alloc_uncached_top_retain): Function returns a block of memory from the top of scanned RAM. It also removes the memory from the pool passed to the kernel.

src/drivers-lh/drv-clcdc.c (clcdc_init): New configuration option to allocate the frame buffer from the top of memory and remove it from the pool given the kernel. It also prevents the LCD display from being shut down when the loader passes control to the boot or go application.

2006-10-18 Version 1.4.7

Makefile: v1.4.7

src/mach-lh7a40x/preinitialization-companion.c: Preinitialization support to work-around limitation in Sharp Boot ROM. The ROM only loads 512 bytes from modern NAND parts. We need to pull more of this down in order to properly initialize the system and copy the loader to SDRAM.

src/drivers/drv-dm9000.c: Support for more than one DM9000 chip. It can write to both mac address roms as well.

src/drivers/drv-fis.c (compare_skips): Fixed the comparison function. The sign sense was wrong and it sorted to the wrong order.

2006-08-12 Version 1.4.3

Makefile (SUBLEVEL): v1.4.3

src/drivers/drv-fis.c (fis_report): Added skips to the report.

debian/rules: Removed headerization so that slugimage can be responsible for it.

src/drivers/drv-fis.c: Added skip descriptor handling. This means that partitions may include 'skips' where some data physically located in the partition is ignored when performing IO on the partition. This feature was added for the slug with a dumb version of Redboot that ignores the partition table when looking for the data it must copy to SDRAM.

debian/*: Fixed the control file and and changelog to properly reflect this release.

2006-07-30 Version 1.4.2

Makefile (SUBLEVEL): Rolling revision in preparation for release of the BSP. apex-1.4.2

src/mach-lh7952x/env.c: Moved all lh7952x's to use the amba-pl011 serial driver in the kernel.

src/drivers-lh/drv-clcdc.c (clcdc_release): Revised the order of the clcdc driver release so it works on the lh79520 which will disable the controller clock.

src/drivers/drv-cf.c (ready_wait): Recoded ready_wait to use the attribute pin replacement register. This doesn't really have an impact on performance, but it does require that the driver is properly configured in the drv_cf.h header.

src/drivers/drv-cf.c (cf_identify): Fixed attribute reading for some cards that return the value in the high and low bytes. Attribute memory is really only byte addressable. This fixes a problem with recognizing some brands of CF cards.

usr/printenv.cc: Rewritten printenv program to support the new environment memory format.

README_environment: New README about the environment.

Makefile: Removed envmagic.h and it's computation. The new environment is free-standing and removal of envmagic makes the build much quicker.

src/lib/env.c (_env_locate): New environment implementation is self-contained for both reading and writing.

src/mach-ixp42x/debian-nslu2-arm_config: Moved the start of the kernel and ramdisk regions to skip the 16 byte sercomm header.

src/drivers/drv-nor-cfi.c (nor_query): New query function allows a driver to return information about the device. NOR flash is the only implementer because it's the one that needs this most. (copy_from): Implementation of a byte swapping copy routine for the sake of BE/LE conversion.

src/drivers/drv-fis.c (prescan_directory): New directory prescan detemines if the flash directory has a different endian-ness from APEX. (map_region): New function to map the directory entry to a region. Now, the region use the underlying flash driver.

src/apex/cmd-copy.c (cmd_copy): Added -s option to copy for byte swapping data where the source is a different ending from APEX.

src/drivers/drv-mem.c (memory_read): Checks the width field and performs IO accordingly.

src/apex/cmd-help.c: Revised command line help.

include/driver.h: New descriptor field specifies the IO width. This allows, in particular, the memory driver to tailor the I/O to a specific width. Some regions must be read as words (CPU registers), others as bytes (CF).

src/apex/cmd-dump.c (cmd_dump): Here, and elsewhere, added alignment attributes so that byte arrays on the stack are word aligned. I had thought that this was a given but the 4.x compilers no longer make this true.