NSLU2-Linux
view · edit · print · history

Debian.FatSlug History

Hide minor edits - Show changes to markup

November 19, 2007, at 04:32 PM by fcarolo -- formatting
Changed line 34 from:
 $ slugimage.pl -p -o di-nslu2-newapex.bin -b RedBoot -s SysConf? \\
to:
 $ slugimage.pl -p -o di-nslu2-newapex.bin -b RedBoot -s SysConf \\
November 19, 2007, at 04:31 PM by fcarolo -- formatting
Changed lines 6-7 from:

Editing this page as I just got my VeryFatSlug? to work. That is, a 256MiB NSLU2, using 4 chips (double-stacked), 512Mib each, 16bits wide, using this wiki and more importantly, this wiki.

to:

Editing this page as I just got my VeryFatSlug to work. That is, a 256MiB NSLU2, using 4 chips (double-stacked), 512Mib each, 16bits wide, using this wiki and more importantly, this wiki.

Added line 14:

[@

Changed lines 30-31 from:
to:

@]

Added lines 82-83:

[@

Changed lines 88-89 from:
to:

@]

April 16, 2007, at 02:19 AM by Rob Lockhart -- added note about ATAG_MEM and memscan
Changed lines 63-64 from:

(NOTE: dunno if no quotes or double quotes are needed - I used no quotes and it worked! With quotes, it doesn't work. -RobLockhart?)

to:

(NOTE: dunno if no quotes or double quotes are needed - I used no quotes and it worked! With quotes, it doesn't work. Note also that the "-u" passes ATAG_MEM to kernel)

April 14, 2007, at 05:52 PM by Rob Lockhart -- fixed inconsistencies in versions used in wiki
Changed line 33 from:
       -L apex-debian-nslu2-arm-1.4.17.bin -k vmlinuz -r ramdisk.gz \\
to:
       -L apex-debian-nslu2-arm-1.4.18.bin -k vmlinuz -r ramdisk.gz \\
Changed line 79 from:

Just for kicks, I tried the commands above on the 1.4.17 Apex boot loader:

to:

Just for kicks, I tried the commands above on the 1.4.18 Apex boot loader:

April 14, 2007, at 05:39 PM by Rob Lockhart -- updated with latest instructions (known to work)
Changed lines 8-11 from:

First, you'll need the newer Apex 1.4.17. This has a new command, called sdram-init.

I loosely followed this website instructions. Except, I didn't use the user-land command "apex-env". I was luckily enough to have Rod Whitby recompile apex-1.4.17 binary using the source file and using the modified config file from the binary, modified for 2nd-stage boot. Note that the binary image above for the NSLU2 will not work as a second-stage bootloader. I tried it, and the NSLU2 continually rebooted back into Apex.

to:

First, you'll need the newer Apex, with a new command, called sdram-init. You can get Apex 1.4.18

I loosely followed this website instructions. Except, I didn't use the user-land command "apex-env". I compiled Apex 1.4.18 using the source file and using the instructions here. Note that the pre-compiled binary image for the NSLU2 will not work as a second-stage bootloader. I tried it, and the NSLU2 continually rebooted back into Apex.

Changed lines 30-31 from:

Now, I just have to replace the apex.bin with the one made for Apex 1.4.17.

to:

Now, I just have to replace the apex.bin with the one made for Apex 1.4.18.

Changed lines 63-64 from:

(NOTE: dunno if no quotes or double quotes are needed - I used no quotes and it worked! -RobLockhart?)

to:

(NOTE: dunno if no quotes or double quotes are needed - I used no quotes and it worked! With quotes, it doesn't work. -RobLockhart?)

Changed line 82 from:
 # memscan -u 0+256m
to:
 # memscan -u 0+512m
Changed lines 85-90 from:

So, now I am in the process of installing Debian Installer with a VeryFatSlug?.

Seems like now we need a way to copy the entire flash, modify the second-stage Apex boot loader with slugimage, and then flashing the new slugimage back to the NSLU2. I tried the instructions above, and the boot loader works!

to:

(note: memscan only showed 256MiB which is correct)

Note that I did try to install with FatSlug, but I couldn't get my FatSlug to detect properly (at first), so I went ahead and installed D-I RC2?, then after getting it working, modified the Apex bootloader and then got it to work per the above instructions. I think that if you were to install with FatSlug, the extra memory would be recognized by the installer and perhaps more options would be available.

April 12, 2007, at 05:21 AM by Rob Lockhart -- added notes in not using quotes and it works
Changed line 59 from:
 apex> setenv startup 'sdram-init; memscan -u 0+256m; copy -s $kernelsrc \\
to:
 apex> setenv startup sdram-init; memscan -u 0+256m; copy -s $kernelsrc \\
Changed lines 61-67 from:
   autoboot.; boot'

Typing "printenv" again doesn't show the startup command correctly, so apparently the single-quote doesn't work. Next, I try double-quotes and that seems to work:

 apex> setenv startup "sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; 
copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot"
to:
   autoboot.; boot

(NOTE: dunno if no quotes or double quotes are needed - I used no quotes and it worked! -RobLockhart?)

Changed lines 87-89 from:

Seems like now we need a way to copy the entire flash, modify the second-stage Apex boot loader with slugimage, and then flashing the new slugimage back to the NSLU2. I tried the instructions above, and the boot loader hangs. Without the sdram-init, the "memscan" only detects 32MiB of memory, and boots just fine. Even if I do the sdram-init and then only specify 64m instead of 256m, it boots just fine too. More details will follow, as I work on my NSLU2.

to:

Seems like now we need a way to copy the entire flash, modify the second-stage Apex boot loader with slugimage, and then flashing the new slugimage back to the NSLU2. I tried the instructions above, and the boot loader works!

April 11, 2007, at 06:23 AM by Rob Lockhart -- changed prompt for RedBoot
Changed lines 43-46 from:
 # ip_address -l 192.168.0.10 -h 192.168.0.99
 # load -r -v -b 0x01000000 -h 192.168.0.99 di-nslu2-newapex.bin
 # cksum
to:
 RedBoot> ip_address -l 192.168.0.10 -h 192.168.0.99
 RedBoot> load -r -v -b 0x01000000 -h 192.168.0.99 di-nslu2-newapex.bin
 RedBoot> cksum
Changed lines 49-51 from:
 # fis write -f 0x50060000 -b 0x01060000 -l 0x7a0000
 # reset
to:
 RedBoot> fis write -f 0x50060000 -b 0x01060000 -l 0x7a0000
 RedBoot> reset
April 10, 2007, at 06:39 AM by Rob Lockhart -- warranty disclaimer added
Added lines 3-5:

*Obviously* this will void the warranty of your SLUG.

April 07, 2007, at 12:34 AM by Rob Lockhart -- added some extra notes about sdram-init
Changed lines 87-91 from:

Seems like now we need a way to copy the entire flash, modify the second-stage Apex boot loader with slugimage, and then flashing the new slugimage back to the NSLU2.

Rob Lockhart

to:

Seems like now we need a way to copy the entire flash, modify the second-stage Apex boot loader with slugimage, and then flashing the new slugimage back to the NSLU2. I tried the instructions above, and the boot loader hangs. Without the sdram-init, the "memscan" only detects 32MiB of memory, and boots just fine. Even if I do the sdram-init and then only specify 64m instead of 256m, it boots just fine too. More details will follow, as I work on my NSLU2.

April 07, 2007, at 12:31 AM by Rob Lockhart -- changed link of cygwin
Changed lines 9-10 from:

Then, I downloaded slugimage and ran it as follows (to disassemble the Debian-Installer RC2 binary image). Note that I changed the Perl file to have .pl extension, so I knew it was a Perl script. I ran this from Cygwin.

to:

Then, I downloaded slugimage and ran it as follows (to disassemble the Debian-Installer RC2 binary image). Note that I changed the Perl file to have .pl extension, so I knew it was a Perl script. I ran this from Cygwin.

March 28, 2007, at 05:47 AM by Rob Lockhart -- page breaks mod
Changed lines 29-30 from:
 $ slugimage.pl -p -o di-nslu2-newapex.bin -b RedBoot -s SysConf?        -L apex-debian-nslu2-arm-1.4.17.bin -k vmlinuz -r ramdisk.gz \
to:
 $ slugimage.pl -p -o di-nslu2-newapex.bin -b RedBoot -s SysConf? 
-L apex-debian-nslu2-arm-1.4.17.bin -k vmlinuz -r ramdisk.gz \\
Changed line 53 from:
 startup *= copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; \
to:
 startup *= copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; \\
Changed lines 56-57 from:
 apex> setenv startup 'sdram-init; memscan -u 0+256m; copy -s $kernelsrc    $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel \
to:
 apex> setenv startup 'sdram-init; memscan -u 0+256m; copy -s $kernelsrc 
$bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel \\
Changed line 62 from:
 apex> setenv startup "sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; \
to:
 apex> setenv startup "sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; \\
Changed line 75 from:
 startup = sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; \
to:
 startup = sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; \\
March 28, 2007, at 05:45 AM by Rob Lockhart -- added page breaks for ease of viewing
Changed lines 53-60 from:
 startup *= copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C  to cancel autoboot.; boot

 apex> setenv startup 'sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot'

 typing "printenv" again doesn't show the startup command correctly, so apparently the single-quote doesn't work.  Next, I try double-quotes and that seems to work:

 apex> setenv startup "sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot"
to:
 startup *= copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr;    wait 10 Type ^C  to cancel autoboot.; boot

 apex> setenv startup 'sdram-init; memscan -u 0+256m; copy -s $kernelsrc    $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel    autoboot.; boot'

Typing "printenv" again doesn't show the startup command correctly, so apparently the single-quote doesn't work. Next, I try double-quotes and that seems to work:

 apex> setenv startup "sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr;    copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot"
Changed lines 75-77 from:
 startup = sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc  $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot
to:
 startup = sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr;    copy -s $ramdisksrc  $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot
March 28, 2007, at 05:43 AM by Rob Lockhart -- change of formatting only
Changed lines 11-26 from:

$ ./slugimage.pl -u -i di-nslu2.bin Read 2 blocks into <RedBoot> Read 0x00006 bytes into <EthAddr?> Read 1 blocks into <SysConf?> Read 0x1FFE0 bytes into <Loader> Read 11 blocks into <Kernel> Read 32 blocks into <Ramdisk> Read 1 blocks into <FIS directory> Read 0x00010 bytes into <Trailer> Wrote 0x00040000 bytes from <RedBoot> into "RedBoot" Wrote 0x00020000 bytes from <SysConf?> into "SysConf?" Wrote 0x0001FFE0 bytes from <Loader> into "apex.bin" Wrote 0x00140004 bytes from <Kernel> into "vmlinuz" Wrote 0x00400000 bytes from <Ramdisk> into "ramdisk.gz" Wrote 0x00000010 bytes from <Trailer> into "Trailer"

to:
 $ ./slugimage.pl -u -i di-nslu2.bin
 Read 2 blocks into <RedBoot>
 Read 0x00006 bytes into <EthAddr?>
 Read 1 blocks into <SysConf?>
 Read 0x1FFE0 bytes into <Loader>
 Read 11 blocks into <Kernel>
 Read 32 blocks into <Ramdisk>
 Read 1 blocks into <FIS directory>
 Read 0x00010 bytes into <Trailer>
 Wrote 0x00040000 bytes from <RedBoot> into "RedBoot"
 Wrote 0x00020000 bytes from <SysConf?> into "SysConf?"
 Wrote 0x0001FFE0 bytes from <Loader> into "apex.bin"
 Wrote 0x00140004 bytes from <Kernel> into "vmlinuz"
 Wrote 0x00400000 bytes from <Ramdisk> into "ramdisk.gz"
 Wrote 0x00000010 bytes from <Trailer> into "Trailer"
Changed line 29 from:

$ slugimage.pl -p -o di-nslu2-newapex.bin -b RedBoot -s SysConf? \

to:
 $ slugimage.pl -p -o di-nslu2-newapex.bin -b RedBoot -s SysConf? \
Changed lines 40-42 from:
  1. ip_address -l 192.168.0.10 -h 192.168.0.99
  2. load -r -v -b 0x01000000 -h 192.168.0.99 di-nslu2-newapex.bin
  3. cksum
to:
 # ip_address -l 192.168.0.10 -h 192.168.0.99
 # load -r -v -b 0x01000000 -h 192.168.0.99 di-nslu2-newapex.bin
 # cksum
Changed lines 45-47 from:
  1. fis write -f 0x50060000 -b 0x01060000 -l 0x7a0000
  2. reset
to:
 # fis write -f 0x50060000 -b 0x01060000 -l 0x7a0000
 # reset
Changed lines 51-73 from:

apex> printenv ... startup *= copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot

apex> setenv startup 'sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot'

typing "printenv" again doesn't show the startup command correctly, so apparently the single-quote doesn't work. Next, I try double-quotes and that seems to work:

apex> setenv startup "sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot"

apex> printenv fis-drv *= nor:0x7e0000+4k cmdline *= console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug cmdline-alt *= console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug bootaddr *= 0x00008000 ramdiskaddr *= 0x01000000 kernelsrc *= fis://kernel kernelsrc-alt *= fis://kernel ramdisksrc *= fis://ramdisk ramdisksrc-alt *= fis://ramdisk startup = sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot

to:
 apex> printenv
 ...
 startup *= copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C  to cancel autoboot.; boot

 apex> setenv startup 'sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot'

 typing "printenv" again doesn't show the startup command correctly, so apparently the single-quote doesn't work.  Next, I try double-quotes and that seems to work:

 apex> setenv startup "sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot"

 apex> printenv
 fis-drv *= nor:0x7e0000+4k
 cmdline *= console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug
 cmdline-alt *= console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug
 bootaddr *= 0x00008000
 ramdiskaddr *= 0x01000000
 kernelsrc *= fis://kernel
 kernelsrc-alt *= fis://kernel
 ramdisksrc *= fis://ramdisk
 ramdisksrc-alt *= fis://ramdisk
 startup = sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc  $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot
Changed lines 75-79 from:
  1. sdram-init
 2 banks of 2 512Mib chips
  1. memscan -u 0+256m
 0x0 0x10000000 (256 MiB?)
to:
 # sdram-init
  2 banks of 2 512Mib chips
 # memscan -u 0+256m
  0x0 0x10000000 (256 MiB?)
March 28, 2007, at 05:39 AM by Rob Lockhart -- using Apex 1.4.17
Added lines 3-86:

Editing this page as I just got my VeryFatSlug? to work. That is, a 256MiB NSLU2, using 4 chips (double-stacked), 512Mib each, 16bits wide, using this wiki and more importantly, this wiki.

First, you'll need the newer Apex 1.4.17. This has a new command, called sdram-init.

I loosely followed this website instructions. Except, I didn't use the user-land command "apex-env". I was luckily enough to have Rod Whitby recompile apex-1.4.17 binary using the source file and using the modified config file from the binary, modified for 2nd-stage boot. Note that the binary image above for the NSLU2 will not work as a second-stage bootloader. I tried it, and the NSLU2 continually rebooted back into Apex.

Then, I downloaded slugimage and ran it as follows (to disassemble the Debian-Installer RC2 binary image). Note that I changed the Perl file to have .pl extension, so I knew it was a Perl script. I ran this from Cygwin.

$ ./slugimage.pl -u -i di-nslu2.bin Read 2 blocks into <RedBoot> Read 0x00006 bytes into <EthAddr?> Read 1 blocks into <SysConf?> Read 0x1FFE0 bytes into <Loader> Read 11 blocks into <Kernel> Read 32 blocks into <Ramdisk> Read 1 blocks into <FIS directory> Read 0x00010 bytes into <Trailer> Wrote 0x00040000 bytes from <RedBoot> into "RedBoot" Wrote 0x00020000 bytes from <SysConf?> into "SysConf?" Wrote 0x0001FFE0 bytes from <Loader> into "apex.bin" Wrote 0x00140004 bytes from <Kernel> into "vmlinuz" Wrote 0x00400000 bytes from <Ramdisk> into "ramdisk.gz" Wrote 0x00000010 bytes from <Trailer> into "Trailer"

Now, I just have to replace the apex.bin with the one made for Apex 1.4.17.

$ slugimage.pl -p -o di-nslu2-newapex.bin -b RedBoot -s SysConf? -L apex-debian-nslu2-arm-1.4.17.bin -k vmlinuz -r ramdisk.gz -t Trailer

Now, I booted into Redboot via CTRL-C of console when I saw the "+" upon rebooting (using SerialPortMod wiki). I suppose you could telnet into Redboot instead but I was lazy.

Next, I put the file "di-nslu2-newapex.bin" on my TFTP server in /tftpboot directory, and then followed these instructions to retrieve the file via TFTP into RAM, then do cksum on both NSLU2 and linux server, then copy file from RAM into flash.

I did the following (assuming TFTP server on 0.99 and NSLU2 is 0.10):

  1. ip_address -l 192.168.0.10 -h 192.168.0.99
  2. load -r -v -b 0x01000000 -h 192.168.0.99 di-nslu2-newapex.bin
  3. cksum

(do this on both the NSLU2 and the TFTP server and verify equal checksums)

  1. fis write -f 0x50060000 -b 0x01060000 -l 0x7a0000
  2. reset

Now, I verified that the installer would boot. It did, going first into Redboot, then Apex bootloader (2nd stage). However, it still doesn't detect 256MiB. Now, gotta change the boot config parameters for Apex per this page. When I replaced Redboot with Apex, I could not modify the environment parameters. With this new Apex 2nd stage loader, I notice that the parameters don't work via the apex "setenv" command, as copied per this page. The commands of interest are shown below:

apex> printenv ... startup *= copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot

apex> setenv startup 'sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot'

typing "printenv" again doesn't show the startup command correctly, so apparently the single-quote doesn't work. Next, I try double-quotes and that seems to work:

apex> setenv startup "sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot"

apex> printenv fis-drv *= nor:0x7e0000+4k cmdline *= console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug cmdline-alt *= console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug bootaddr *= 0x00008000 ramdiskaddr *= 0x01000000 kernelsrc *= fis://kernel kernelsrc-alt *= fis://kernel ramdisksrc *= fis://ramdisk ramdisksrc-alt *= fis://ramdisk startup = sdram-init; memscan -u 0+256m; copy -s $kernelsrc $bootaddr; copy -s $ramdisksrc $ramdiskaddr; wait 10 Type ^C to cancel autoboot.; boot

Just for kicks, I tried the commands above on the 1.4.17 Apex boot loader:

  1. sdram-init
 2 banks of 2 512Mib chips
  1. memscan -u 0+256m
 0x0 0x10000000 (256 MiB?)

So, now I am in the process of installing Debian Installer with a VeryFatSlug?.

Seems like now we need a way to copy the entire flash, modify the second-stage Apex boot loader with slugimage, and then flashing the new slugimage back to the NSLU2.

Rob Lockhart

======================old info below====================

December 29, 2006, at 03:21 AM by dumfrac --
Changed lines 3-4 from:

This page is based on work by Gerardo Martínez Bernat. Original instructions were translated by the work of Dave Nash.

to:

This page is based on work by Gerardo Martínez Bernat. Original instructions were are in Spanish and were translated by Dave Nash.

December 29, 2006, at 03:21 AM by dumfrac --
Changed lines 3-4 from:

This page is based on work by Gerardo Martínez Bernat. Original instruction were translated by the work of Dave Nash.

to:

This page is based on work by Gerardo Martínez Bernat. Original instructions were translated by the work of Dave Nash.

December 29, 2006, at 03:15 AM by dumfrac -- Fix translation errors pointed out by Gerado in email
Changed lines 41-47 from:

Now go to Platform Setup to configure the loader for your upgraded memory. If you have 2 chips choose Enable SDRAM bank 0 and leave Enable SDRAM bank 1 unselected. If you have 4 chips then enable both. In Size, in bytes, of each SDRAM bank enter in hexadecimal, the number of bytes of each pair of chips. In my case I have 64Mb in a single bank (two chips) so I selected only bank 0 and entered 0x04000000 for the size.

[Not sure of this: Ya que estamos liados tambien conviene dejarlo todo para que si usamos openslug se pueda utilizar toda la memoria]

Now...???...if you use Openslug you can use all the memory.

to:

Now go to Platform Setup to configure the loader for your upgraded memory. If you have 2 chips choose Enable SDRAM bank 0 and leave Enable SDRAM bank 1 unselected. If you have 4 chips then enable both. In Size, in bytes, of each SDRAM bank enter in hexadecimal, the number of bytes of each pair of chips. In my case I have 64Mb in a single bank (two chips) so I selected only bank 0 and entered 0x04000000 for the size.

Once we are working on this, it's recommendabable to add the kernel command line so in case we use OpenSlug, it will be able to use all the memory.

Changed lines 102-104 from:

If all has gone well up to this point, you can overwrite RedBoot. To do so enter the following:

to:

If all has gone well up to this point, you can overwrite RedBoot. To do so enter the following:

Changed lines 112-114 from:

[Not quite sure about the following line] Make sure you transfer by xmodem the image you previously saved in RAM. Now restart the Slug and see if Apex boots correctly.

to:

It is not necessary to do another xmodem transfer of apex because we will flash the image previously saved in RAM. Now restart the Slug and see if Apex boots correctly.

December 29, 2006, at 03:05 AM by dumfrac -- Change \"casero\" to \"home made\"
Changed line 14 from:
  • a JTAG interface, you can make a Wiggler-type [casero] (optional but recommended to help things go well)
to:
  • a JTAG interface, you can make a home made Wiggler-type (optional but recommended to help things go well)
December 29, 2006, at 02:54 AM by dumfrac -- Acknowledge Dave Nash
Changed lines 3-4 from:

This page is based on work by Gerardo Martínez Bernat (please update this credit).

to:

This page is based on work by Gerardo Martínez Bernat. Original instruction were translated by the work of Dave Nash.

December 29, 2006, at 02:51 AM by dumfrac -- Add second step (thanks to Dave Nash)
Added lines 127-261:

Step 2: Substitute the Debian second-stage loader with Apex with the appropriate command-line

From this point you can try things out safe in the knowledge that you can recover the Slug without JTAG

The first thing is to prepare the second Apex binary. This time it is more complicated but nothing unusual.

Copy the Apex configuration for NSLU2 arm and go to the configuration menu.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

cd /usr/src/apex
cp src/mach-ixp42x/debian-nslu2-arm_config .config
make menuconfig

(:tableend:)

Enter General Setup, go to the option Cross compiler prefix, and enter the prefix for the arm compiler, in my case /opt/arm-xscale-linux-gnu/gcc-4.0.3-glibc-2.3.6/bin/arm-xscale-linux-gnu- Return to configure the memory in Platform Setup (This should not be necessary but just in case!) Now go to Environment, select Default kernel command line and add to the end "mem=64M@0x0"

Exit the configuration program, save and compile:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

make

(:tableend:)

The binary you get from this is for little-endian architecture so now you have to do some "byteswapping" using the following script (courtesy of Peter Korsgaard):

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

#!/usr/bin/python
# swap every 32bit word in input and write it to output

import array, sys

if len(sys.argv) != 3:
sys.stderr.write('Invalid arguments.\n')
sys.stderr.write('Usage: %s \n' % sys.argv[0])
sys.exit(1)

if sys.argv[1] == '-':
file = sys.stdin
else:
file = open(sys.argv[1], 'rb')

input = file.read()
a = array.array('I')
# add padding if needed
a.fromstring(input + '\0' * (4-len(input)&3))
a.byteswap()

if sys.argv[2] == '-':
file = sys.stdout
else:
file = open(sys.argv[2], 'wb')

a.tofile(file)

(:tableend:)

Run it:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

./byteswap.py apex.bin apex-swap.bin

(:tableend:)

As before, it is convenient to test before saving to flash. Enable the serial port, open minicom, and boot the Slug. Press Ctrl-C to pause the boot. Now you can transfer the binary via xmodem.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

apex> xreceive 0x1000000

(:tableend:)

You will see a "C" appear, at that moment it transfers the binary "apex-swap.bin".

Execute the new loader:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

apex> go 0x1000000

(:tableend:)

At this point, just in case, you must test if you can boot Debian without interrupting the load with CTRL-C. If it boots properly you can save it to flash. It is very important to save from the first Bootloader, NEVER FROM THE SECOND.

Boot the Slug and press Ctrl-C to enter the Apex command line (I REPEAT: THE FIRST APEX). And now do the following:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

apex> xreceive 0x1000000

(:tableend:)

It transfers "apex-swap.bin" by xmodem but do not boot it. Note the size of the file in hexadecimal. Now save to flash:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

apex> erase nor:0x60000+0x20000
apex> copy mem:0x1000000+0xYYYY nor:0x60010 (where 0xYYYY is the size of the
file noted)

(:tableend:)

Now it's all done so restart and make sure it all works properly.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

p2p@pitufo:~$ free
total used free shared buffers cached
Mem: 62568 61160 1408 0 388 30212
-/+ buffers/cache: 30560 32008
Swap: 65528 24 65504

(:tableend:)

If it doesn't boot, remember that you can always restore the firware that you want using the first Apex without any need for JTAG.

NOTE: The process I have described above has worked perfectly for me and is safe provided you take the necessary precautions. Nevertheless I am not responsible for any damage caused as a consequence of following this guide.

IT IS BELIEVED THAT THIS IS AN ACCURATE TRANSLATION (EXCEPT WHERE NOTED) OF THE ORIGINAL GUIDE AT http://www.nslug.es/node/137 , HOWEVER THIS TRANSLATION IS PROVIDED AS A FAVOUR AND NO RESPONSIBILITY IS ACCEPTED FOR ANY INACCURACIES. PLEASE MAKE SURE YOU READ IT ALL AND UNDERSTAND IT BEFORE PERFORMING ANY OF THE STEPS DESCRIBED. YOU ARE RESPONSIBLE FOR YOUR OWN ACTIONS!

December 28, 2006, at 06:16 PM by dumfrac --
Changed lines 11-18 from:

- NSLU2 with increased memory - a board with MAX3232, ICL3232 or similar for the serial port - the Apex source code - a JTAG interface, you can make a Wiggler-type [casero] (optional

but recommended to help things go well) - toolchain for armv5b (arm big-endian) and for arm (arm little-endian). For arm BE you can use the toolchain that you generate with the OpenSlug Master Makefile, and for arm LE you can use that provided by emdebian.

to:
  • NSLU2 with increased memory
  • a board with MAX3232, ICL3232 or similar for the serial port
  • the Apex source code
  • a JTAG interface, you can make a Wiggler-type [casero] (optional but recommended to help things go well)
  • toolchain for armv5b (arm big-endian) and for arm (arm little-endian). For arm BE you can use the toolchain that you generate with the OpenSlug Master Makefile, and for arm LE you can use that provided by emdebian.
December 28, 2006, at 03:57 PM by dumfrac -- Fix formatting
Changed line 12 from:

- a board with MAX3232?, ICL3232? or similar for the serial port

to:

- a board with MAX3232, ICL3232 or similar for the serial port

December 28, 2006, at 03:56 PM by dunfrac --
Added lines 3-4:

This page is based on work by Gerardo Martínez Bernat (please update this credit).

December 28, 2006, at 03:51 PM by dunfrac -- New page on Debian and FatSLugs
Added lines 1-126:

Debian and FatSlugs

For some time I have wanted to increase the memory in my Slug. Now I have finally installed a pair of 16Mx16 chips (Micron branded, which are fairly easy to find). Once you have performed the upgrade you will realise that there is still work to do!

The intention of this document is to explain the steps that I have performed to upgrade the first level boot loader, and also the second level (introduced in the RC1 of Debian Etch)

You will need

- NSLU2 with increased memory - a board with MAX3232?, ICL3232? or similar for the serial port - the Apex source code - a JTAG interface, you can make a Wiggler-type [casero] (optional

but recommended to help things go well) - toolchain for armv5b (arm big-endian) and for arm (arm little-endian). For arm BE you can use the toolchain that you generate with the OpenSlug Master Makefile, and for arm LE you can use that provided by emdebian.

I will assume that you have all this, that the serial port is working, and that you have the source code of Apex ready. The first step is to substitute Redboot with Apex in order to use all the memory. Next, if you use Debian, it is necessary to substitute the second level loader with another that can pass a command-line to the kernel.

Step 1: Substitute Redboot with Apex

Copy the Apex configuration for Openslug and enter the configuration menu.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

cd /usr/src/apex
cp src/mach-ixp42x/openslug_config .config
make menuconfig

(:tableend:)

Go to General Setup, choose the option Cross Compiler prefix, and enter the prefix for the armv5b compiler. In my case

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

/opt/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/bin/armv5b-softfloat-linux-

(:tableend:)

Now go to Platform Setup to configure the loader for your upgraded memory. If you have 2 chips choose Enable SDRAM bank 0 and leave Enable SDRAM bank 1 unselected. If you have 4 chips then enable both. In Size, in bytes, of each SDRAM bank enter in hexadecimal, the number of bytes of each pair of chips. In my case I have 64Mb in a single bank (two chips) so I selected only bank 0 and entered 0x04000000 for the size.

[Not sure of this: Ya que estamos liados tambien conviene dejarlo todo para que si usamos openslug se pueda utilizar toda la memoria]

Now...???...if you use Openslug you can use all the memory.

Go to Environment, select Default kernel command line and add at the end "mem=64M@0x0"

Exit the configuration program, save and compile.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

make

(:tableend:)

This will make the binary file of the first bootloader ("apex.bin"), but before saving it, it is useful to test it to be sure that it works.

IF it doesn't work and you save it, you can only restore the Slug using JTAG. You have been warned!

Install the serial port circuit and start Minicom (or similar program, just be sure it supports xmodem). When the Slug starts a "+" will appear. Press Ctrl-C at this point and wait a few seconds for the Redboot command-line to appear. Now we will copy the bootloader to RAM:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

RedBoot> load -b 0x1000000 -r -m xmodem

(:tableend:)

Transfer the Apex image ("apex.bin") via xmodem. In Minicom press Ctrl-A to enter command mode and then S to send files. Once Apex is in RAM you only have to execute it:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

RedBoot> g 0x1000000

(:tableend:)

You will see something like this:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

APEX Boot Loader 1.4.7 -- Copyright (c) 2004,2005,2006 Marc Singer

APEX comes with ABSOLUTELY NO WARRANTY. It is free software and you
are welcome to redistribute it under certain circumstances.
For details, refer to the file COPYING in the program source.

apex => mem:0x00200000+0xdb20 (56096 bytes)
env => nor:120k+8k (no-write)

Use the command 'help help' to get started.

# copy nor:0x60010+0xffff0 0x00008000
1048560 bytes transferred

Press Ctrl-C to stop the boot process.

(:tableend:)

If all has gone well up to this point, you can overwrite RedBoot. To do so enter the following:

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

apex> erase nor:0
apex> copy $apex nor:0

(:tableend:)

[Not quite sure about the following line] Make sure you transfer by xmodem the image you previously saved in RAM. Now restart the Slug and see if Apex boots correctly.

(:table border=0 width=80% bgcolor=#eeffee:) (:cell:)

apex> reset

(:tableend:)

If it does, you have completed the most complicated step. If not, you will have to use JTAG to restore the firmware.

view · edit · print · history · Last edited by fcarolo.
Based on work by fcarolo, Rob Lockhart, dumfrac, and dunfrac.
Originally by dunfrac.
Page last modified on November 19, 2007, at 04:32 PM