r690 - developers/werner

werner at sita.openmoko.org werner at sita.openmoko.org
Tue Feb 6 09:09:41 CET 2007


Author: werner
Date: 2007-02-06 09:09:39 +0100 (Tue, 06 Feb 2007)
New Revision: 690

Modified:
   developers/werner/WALK-THROUGH
Log:
- added roles to section titles where they were missing
- added serial port recovery instructions
- added Flash instructions
- removed junk notes



Modified: developers/werner/WALK-THROUGH
===================================================================
--- developers/werner/WALK-THROUGH	2007-02-06 07:51:14 UTC (rev 689)
+++ developers/werner/WALK-THROUGH	2007-02-06 08:09:39 UTC (rev 690)
@@ -13,7 +13,8 @@
 # host(s) are set up, and also on the revision of the target platform.
 #
 # Instead, look at each step, read the instructions, and copy and paste what
-# makes sense for you, and adapt what you disagree with.
+# makes sense for you, and adapt what you disagree with. Links to original and
+# background material in the Wiki are included wherever useful.
 #
 # Please note that this file isn't actively maintained and is guaranteed to
 # suffer bit rot as I begin to use more and more shortcuts in the build
@@ -149,8 +150,13 @@
 #   https://wiki.openmoko.org/wiki/Debug_Board
 #   https://wiki.openmoko.org/wiki/Connecting_GTA01Bv2_with_Debug_Board
 #
-# - cards inserted in the SD/MMC card reader appear as /dev/uba on CARD
+# - cards inserted in the SD/MMC card reader appear as /dev/uba on CARD and can
+#   be mounted on /mnt/tmp (we'll specify the mount point explicitly, so it
+#   only has to be there, but we don't need /etc/fstab to reflect this).
 #
+#   If in doubt,
+#   mkdir -p /mnt/tmp
+#
 
 
 ###  OpenEmbedded build: initial downloads (BUILD)  ###########################
@@ -194,6 +200,7 @@
 
 # Set up the directories for the cache of upstream files and all material
 # related to local builds, then put our configuration file there:
+# https://wiki.openmoko.org/wiki/OpenMoko#Setting_up_an_OpenMoko_SDK
 
 mkdir -p sources build/conf build/tmp/stamps/armv4t-linux
 cat <<EOF >build/conf/local.conf
@@ -221,7 +228,7 @@
 wget http://us4.samba.org/samba/ftp/stable/samba-3.0.14a.tar.gz
 touch ../build/tmp/stamps/armv4t-linux/samba-3.0.14a-r15.do_fetch
 
-# ghastly patch
+# ghastly patch with CRLF and trailing blanks
 
 perl -pi.orig -e 's/ *$//;s/\r//g' \
   ../openembedded/packages/gcc/gcc-4.1.1/gcc-4.1.1-pr13685-1.patch
@@ -241,7 +248,7 @@
 touch ../build/tmp/stamps/armv4t-linux/openmoko-dates-0.1+svnnow-r0.do_fetch
 
 
-###  OpenEmbedded build  ######################################################
+###  OpenEmbedded build (BUILD)  ##############################################
 #
 
 # openmoko/trunk/oe/conf/site.conf expects the OpenMoko-specific OE packages in
@@ -259,13 +266,14 @@
 # to accept certificates. If you're not quick enough to respond, the underlying
 # session may time out. In this case, just restart "bitbake
 # openmoko-devel-image" and it pick up from where it left off.
-<*22:00> <22:26>
 #
-# The whole build process involved numerous downloads, takes about NNNN hours
+# The whole build process involved numerous downloads, takes several hours
 # on an Athlon 64 3200+, and ends with a message like this:
 #
+# <to do>
 #
 
+
 ###############################################################################
 ##      THE INSTRUCTIONS BELOW YIELD A SETUP WITHOUT BAD BLOCK HANDLING      ##
 ###############################################################################
@@ -274,11 +282,18 @@
 # that can skip bad blocks in the NAND Flash. If your NAND Flash has no bad
 # blocks, you can proceed safely, and migrate later.
 #
+# Note: if your OpenMoko tree is considerably newer than SVN revision 687, even
+# the default kernel may already support bad blocks. The instructions below
+# will then need updating.
+#
 
+
 ###  Flash boot loader into NAND (LAB)  #######################################
 #
 # As a first step, we transfer the u-boot bootloader into NAND Flash, through
-# the JTAG interface.
+# the JTAG interface. We use JTAG, since this is the most basic way for doing
+# this, ensuring that we don't depend on as little to work on the Neo as
+# possible.
 #
 # For this, the u-boot image for to right the board version and the desired
 # build date must be chosen. E.g., an image built for a gta01bv2 board on
@@ -288,14 +303,16 @@
 # If this is the first build, there will only be one image for each board
 # version, thus we can use wildcards. Change the gta01bv2 below to gta01v3 or
 # gta01v4, if necessary.
+#
+# https://wiki.openmoko.org/wiki/Sjf2410-linux
 # 
 
 cd $OMDIR/build/tmp/deploy/images
 
 ( echo 0; echo 0; echo 0; echo 2; ) |
-  ./sjf2410 /f:u-boot_nand-gta01bv2-*.bin
+  ./sjf2410 /f:`echo u-boot_nand-gta01bv2-*.bin`
 
-# This will take approximately NNN minutes.
+# This will take approximately 12 minutes.
 
 
 ###  Copy kernel and root FS to microSD card (CARD)  ##########################
@@ -330,7 +347,7 @@
 # (If you did anyway, don't worry. We'll power cycle it later.)
 
 
-###  Serial console  ##########################################################
+###  Serial console (LAB)  ####################################################
 #
 # We use a serial console connecting through the debug board. This example uses
 # "xc", which is a small and simple communications program. Many people prefer
@@ -348,61 +365,112 @@
 
 xc -l /dev/ttyS0 -t
 
-###  Start the Neo and enter the boot prompt  #################################
+
+###  Start the Neo and enter the boot prompt (LAB)  ###########################
 #
+# Our first interaction with the target. This this doesn't work, please check
+# that the debug board is connected properly to the serial port.
 #
 
-# Disconnect power, wait a couple of minutes, then connect power. Some people
-# have observed stability issued if the device was reset without power cycling,
-# yet details aren't very clear yet.
+# Disconnect power, wait a couple of minutes, then connect power. You may have
+# to press the power button on the Neo, next to the USB port, to turn it on.
 #
+# Some people have observed stability issues if the device was reset without
+# power cycling, yet details of what is really happening aren't very clear yet.
+#
 # On the serial console, a message like this should appear:
 # U-Boot 1.2.0 (Feb  3 2007 - 13:07:21)
 #
 # Press any key to enter the boot prompt:
 # GTA01Bv2 #
+#
+# Note that the boot prompt changes with the hardware revision you have. If the
+# message does not appear after a few seconds, try power cycling again.
 
-###  Flash kernel and root FS into NAND (LAB)  ################################
+# If xc responds to pressing a button with
+# "Verify that you are trying to use a valid and operational tty port."
+# the port may be stuck, waiting for DCD to be asserted. The quickest way to
+# get out of this situation is to disconnect the serial cable from the debug
+# board, run the following command
 #
+# while ! stty -F /dev/ttyS0 clocal; do : ; done
+#
+# stick with something metallic into the connector, and keep on fumbling with
+# it until DCD gets set and the loop above stops spitting out error messages.
 
 
+###  Flash kernel and root FS into NAND (LAB)  ################################
+#
+# We now load the kernel and the root FS from the microSD card into memory and
+# subsequently transfer them to NAND Flash. All this is done by entering
+# commands at the boot prompt.
+# https://wiki.openmoko.org/wiki/U-boot
 
+#
+# ---------- Before we start, we erase all the NAND Flash, except for the area
+# ---------- containing the boot loader itself (0 to 0x30000)
+#
+# GTA01Bv2 # nand erase 0x30000 0x3fd0000
+#
+# ---------- Initialize the SD/MMC interface. The "Product Name" shown will be
+# ---------- just binary garbage. This is expected behaviour.
+#
+# GTA01Bv2 # mmc
+#
+# ---------- Load the uImage file into memory. Note: this assumes we're using
+# ---------- FAT. Use "ext2load" instead if using ext2.
+#
+# GTA01Bv2 # fatload mmc 0 0x32000000 uImage
+#
+# ---------- Write the uImage from memory to NAND Flash
+#
+# GTA01Bv2 # nand write.e 0x32000000 0x00034000 0x200000
+#
+# ---------- The root file system is next. We need to specify the correct size,
+# ---------- which is shown at the end of "fatload" or "ext2load".
+#
+# GTA01Bv2 # fatload mmc 0 0x32000000 rootfs.jffs2
+#
+# ---------- It will say something like "22724608 bytes read"
+# ---------- You can convert this to hex, e.g., with bc:
+# ---------- % bc
+# ---------- obase=16
+# ---------- 22724608
+# ---------- 15AC000
+# ---------- ^D
+#
+# GTA01Bv2 # nand write.e 0x32000000 0x00634000 0x15AC000
+#
+# ---------- The last argument is the hex number obtained from "bc"
+#
 
-### The kernel ################################################################
 
+###  Configure the boot loader  ###############################################
+#
+# Last but not least, we have to set up the boot loader to automatically boot
+# from Flash. This is in fact easy, since we've already wiped out the
+# environment, and can thus simply let it restore the default settings.
+#
 
-wget http://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.14.tar.bz2
-tar xfj linux-2.6.17.14.tar.bz2
-cd linux-2.6.17.14
-QUILT_PATCHES=/home/moko/om/trunk/src/target/kernel/patches quilt push -a
-cp /home/moko/om/trunk/oe/packages/linux/linux-gta01/defconfig-fic-gta01 \
-  .config
-PATH=$OMDIR/build/tmp/cross/bin:$PATH \
-  make ARCH=arm CROSS_COMPILE=arm-linux- oldconfig
-PATH=$OMDIR/build/tmp/cross/bin:$PATH \
-  make ARCH=arm CROSS_COMPILE=arm-linux-
-cd ..
+#
+# ---------- We reset to force the boot loader to use the default settings.
+#
+# GTA01Bv2 # reset
+#
+# ---------- Wait until the "U-Boot [...]" message, then hit a key.
+# ---------- It will display 
+# ---------- "*** Warning - bad CRC or NAND, using default environment"
+#
+# ---------- Save the restored settings in NAND
+#
+# GTA01Bv2 # saveenv
+#
+# ---------- Power cycle to boot the Neo (see remarks above)
+#
 
 
-###  OpenOCD  #################################################################
-
-
-svn co http://svn.berlios.de/svnroot/repos/openocd/trunk openocd
-cd openocd
-./bootstrap
-./configure --enable-parport
-make
-cd ..
-
-
-### Serial console ############################################################
-
-
-
-
-mmc
-ext2load mmc 0 0x32000000 boot/uImage
-setenv bootargs root=/dev/mmcblk0p1 console=ttySAC0,115200 loglevel=8 rootdelay=10
-bootm 0x32000000
-
 ###  END  #####################################################################
+#
+# Congratulations ! You've just completed level 1 of the OpenMoko adventure.
+#
+###############################################################################





More information about the commitlog mailing list