Putting a space between a function name and the parenthesis following
it ain't the One True K&R Way.
Signed-off-by: Werner Almesberger <werner@openmoko.org>
This puts the loop body in a new function called try_this_kernel.
As an added benefit, we can drop one level of indentation.
This change is hard to read as a patch. It gets better if one just
applies it and then looks at it with "git diff -w" or similar.
Signed-off-by: Werner Almesberger <werner@openmoko.org>
On Ubuntu 8.04.1 there can be spaces inside the initial bracketed
uptime number after a reboot. These spaces disappear once the uptime
is large enough. Therefore, use sed to filter out these spaces so
that the cut command that extracts SD card size will always work.
Signed-off-by: Christopher Hall <hsw@openmoko.com>
There's not enough time between Glamo init (now after pcf50633 init)
and the completion of machine init before we try to use the boot device
in the case of GTA02 and SD boot. So we add rootdelay=1 to the SD
card boot cases
Signed-off-by: Andy Green <andy@openmoko.com>
This patch effectively doubles maximum time allowed for retries performed by
mmc_init. Also, the delay was shortened to lower the average time needed to
init a card. Without it, i was unable to boot from Transcend TS8GUSDHC4
(appending rootdelay=1 was necessary as well).
Change to input / pulldown on most GPIO. With no battery and just
USB power, this gets us into suspend with 9.5mA at 5V consumption... but
Ben Dooks told that we don't put the mDDR into deep sleep yet in the
platform pm code, so this should come right down when we have that.
The suspend is otherwise real though, PWREN to the PMU goes down, and
when we wake the device Qi is able to see it is a resume wake and jumps
back into Linux, where we currently die due to issues on s3c6410 platform
code getting worked on.
Signed-off-by: Andy Green <andy@openmoko.com>
Make sure WLAN module power is off by default - this controls
a P-Channel MOSFET that gates all the power there
Signed-off-by: Andy Green <andy@openmoko.com>
First go at resume processing for 6410, can't test it until Ben Dooks
confirms operation of Linux side on SMDK
Signed-off-by: Andy Green <andy@openmoko.com>
This patch turns on the SYS and BAT monitoring filters, and checks if the battery
meets the BAT OK threshold. If it doesn't, which is the case if the battery is
not present, it disables the "indicator" (eg, LED, vibrator) stuff and holds the
CPU at 200MHz during the boot into Linux.
This allows the GTA02 A6 here to boot with no battery up to the point it is
going to bring up backlight, and this with 100mA limit on USB at PMU. Enabling
the threshold filters for battery and SYS seems to have been critical in
getting any stability with this.
Signed-off-by: Andy Green <andy@openmoko.com>
tty0 is the LCM... this patch changes the defaults so that the kernel
always treats tty0 as a console, but it also sets the loglevel so that
only KERN_ERR or worse will be printed there. With matching changes
to the kernel, most of the noise at KERN_ERR is reduced to KERN_INFO,
so it gets the behviour the LCM by default is not cluttered with
messages unless they are important during boot.
Signed-off-by: Andy Green <andy@openmoko.com>
Allow a board to "indicate" events if it likes on whatever it has
On GTA02 we light AUX during boot and run the vibrator briefly when we
skip a partition or device.
Signed-off-by: Andy Green <andy@openmoko.com>
Despite what the docs say, steppingstone is always resident at
0x40000000 on s3c2442, this patch changes our linker script to
stick all steppingstone code there. The mapping of steppingstone
at 0x0 is broken by OM[] bus change dynamically caused for example
by GTA02 AUX button actuation.
Signed-off-by: Andy Green <andy@openmoko.com>
Recent addition of append and noboot file checks broke NAND
Reported-by: Micael Henriksson <micael.h@gmail.com>
Signed-off-by: Andy Green <andy@openmoko.com>
This adds two features that can be set in the rootfs that Qi is checking.
- if it finds /boot/noboot-<device>, eg /boot/noboot-GTA02 then it will
skip the rootfs for booting and try the next one if any
- if it finds /boot/append-<device>, eg, /boot/append-GTA02 then it will
append the contents of this file to the kernel commandline.
Signed-off-by: Andy Green <andy@openmoko.com>
We dedicate 256MB for bootloader in GTA03 SD image, but actually they're
around 25KB currently. Reduce the stage2 pull to 32KByte.
Signed-off-by: Andy Green <andy@openmoko.com>
This patch changes Qi to insist to fetch device-specific kernels from
filesystems that have named kernels. The kernels looked for are now
called
GTA01: /boot/uImage-GTA01.bin
GTA02: /boot/uImage-GTA02.bin
GTA03: /boot/uImage-GTA03.bin
This is part of the support for single rootfs that can be run on
multiple devices with correct kernel and module handling by the
bootloader.
Signed-off-by: Andy Green <andy@openmoko.com>
The hack to find the number of sectors turns out to be
sensitive to the host kernel. This is a workaround until
we find something in /proc or /sys that has the same info
in a more accessible way.
Signed-off-by: Christopher Hall <hsw@openmoko.com>
The first revision for GTA03 A1 is "1", but we only populated
the info for revision 0.
Reported-by: Christopher Hall <hsw@openmoko.org>
Signed-off-by: Andy Green <andy@openmoko.com>
We don't have card detect connected. Try to fake it better by
enabling the peripheral fuction to the ball and forcing pulldown
(card detect is active-low).
Signed-off-by: Andy Green <andy@openmoko.com>
Prefer GTA03, enable dual mDDR init (killing SMDK compatability for now)
fix bugs in GPIO register offsets, set loglevel=8 for GTA03
Signed-off-by: Andy Green <andy@openmoko.com>
This gives compatability with SD Cards using the old U-Boot scheme of an initial
VFAT part for kernel and then ext2. If you put the kernel you actually want to
use in /boot/uImage.bin in the ext2 partition, it can boot these cards then.
Signed-off-by: Andy Green <andy@openmoko.com>
This makes a new behaviour for Qi, when there are no valid kernels then it
performs the memory test. It means you can either move kernels out of the way
to get the memory test, or make an SD Card just with normal Qi on it and no
kernels to get a memory test.
Signed-off-by: Andy Green <andy@openmoko.com>
Some of utils.c isn't used until the full Qi image has been loaded into
memory, to save space in 4K steppingstone case on 2442, we split utils.c now
so only the interesting routines for steppingstone time take up space there.
Signed-off-by: Andy Green <andy@openmoko.com>
We need putc even when we are operating entirely from steppingstone.
Arrange that the board-specific putc code is in a section that goes into
steppingstone, and adapt the utils.c putc() so that it no longer needs to
indirect through the board_api struct that is in main memory.
Signed-off-by: Andy Green <andy@openmoko.com>
This adds the memory testing code to Qi. It tests the range of memory with
several constants and then a 32-bit walking 1 pattern, and repeats forever.
The entire main SDRAM can be tested due to the fact this runs out of
steppingstone only and does not need to store anything outside of it.
It introduces a steppingstone-based stack for use entirely in steppingstone.
Signed-off-by: Andy Green <andy@openmoko.com>
Improve glamo-mmc so that it uses MMC_READ_MULTIPLE_BLOCK and copes with
64 blocks in one command (and STOP sent after each set), instead of sending
a new command per-block
Signed-off-by: Andy Green <andy@openmoko.com>
Little cleanup and new code that collects and defers contiguous sector reads
into one potentially more efficient larger sequential read action.
This matters for example on SD Card protocol.
Signed-off-by: Andy Green <andy@openmoko.com>
Naughty bug bug U-Boot ext2 implementation -- cut and paste of stanza above for
indir1 check used for indir2 but not all the check was not updated.
This removes hundreds of repeated reads of same sector during kernel load.
Signed-off-by: Andy Green <andy@openmoko.com>
There was a bug about dealing with last ext2 sector of file
because we failed to return the number of sectors pulled
Signed-off-by: Andy Green <andy@openmoko.com>
This heavily adapts the Samsung U-Boot hs_mmc code and combines it with the
SD / SDHC startup code written for glamo-mci stuff that is known to work OK
with common SD and SDHC.
tla01 is changed to use the implementation.
Signed-off-by: Andy Green <andy@openmoko.com>
We want utils stuffs in steppingstone part, it's too expensive to have
CRC32 in there. Bust it out into its own file that appears only in
everything_else section in second bootloader stage.
Signed-off-by: Andy Green <andy@openmoko.com>
This patch adds a small script that knows how to partition, format and
prepare with a bootloader image an SD Card for usage with SD Card boot
on 6410.
You use it like this:
./6410-partition-sd.sh sde sdhc ./image/qi-s3c6410-andy_495294c60f2f1432
This will prepare your card with three partitions and put the bootloader
images at the end as required by 6410 iROM.
If you put anything on the fourth parameter, it skips the fdisk and the
formatting stages and just updates the bootloader.
Signed-off-by: Andy Green <andy@openmoko.com>
This patch makes qi source structure cpu-centric, and allows multiple CPUs
to be handled with the board definitions inside the CPU dirs.
You have to make a particular CPU version of Qi now, which you can do by
a shell command like this:
make clean ; make CPU=s3c2442 && make CPU=s3c6410
which gets you
$ ls -l image/
total 744
-rwxrwxr-x 1 agreen agreen 25372 2008-10-17 18:25 qi-s3c2442-andy_77c1fcdddc3e2cbf
-rw-rw-r-- 1 agreen agreen 237100 2008-10-17 18:25 qi-s3c2442-andy_77c1fcdddc3e2cbf.dis
-rw-rw-r-- 1 agreen agreen 25388 2008-10-17 18:25 qi-s3c2442-andy_77c1fcdddc3e2cbf.udfu
-rwxrwxr-x 1 agreen agreen 22736 2008-10-17 18:25 qi-s3c6410-andy_77c1fcdddc3e2cbf
-rw-rw-r-- 1 agreen agreen 216294 2008-10-17 18:25 qi-s3c6410-andy_77c1fcdddc3e2cbf.dis
-rw-rw-r-- 1 agreen agreen 22752 2008-10-17 18:25 qi-s3c6410-andy_77c1fcdddc3e2cbf.udfu
The 6410 support in there is enough to send a character "U" on the 6410 SMDK
Because the product naming is not defined, currently the device targeted for 6410
is called "TLA01"
Signed-off-by: Andy Green <andy@openmoko.com>
Before leaving for Linux, gratuitously clear down the totrst / timeout counter
to help stop us dying partway through boot on effective power-off.
In the case we have no battery or battery < ~3V, we still somehow need to do
more in kernel because it can switch itself off more than 8 seconds
after this point.
Signed-off-by: Andy Green <andy@openmoko.com>
Part of the effort to save power during booting so we can do it inside the
500mW budget from un-enumerated USB connection.
Signed-off-by: Andy Green <andy@openmoko.com>