diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 458: Fix Snowball Android boot parameters and support the Snowball's special uboot.

Message ID 20111115080813.14341.26338.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Mattias Backman Nov. 15, 2011, 8:08 a.m. UTC
Merge authors:
  Bernhard Rosenkraenzer (berolinux)
  Mattias Backman (mabac)
Related merge proposals:
  https://code.launchpad.net/~berolinux/linaro-image-tools/fix-snowball-boot/+merge/81762
  proposed by: Bernhard Rosenkraenzer (berolinux)
  review: Needs Fixing - Mattias Backman (mabac)
  review: Approve - Bernhard Rosenkraenzer (berolinux)
  review: Approve - Mathieu Poirier (mathieu.poirier)
------------------------------------------------------------
revno: 458 [merge]
committer: Mattias Backman <mattias.backman@linaro.org>
branch nick: linaro-image-tools
timestamp: Tue 2011-11-15 09:05:24 +0100
message:
  Fix Snowball Android boot parameters and support the Snowball's special uboot.
modified:
  linaro_image_tools/media_create/android_boards.py
  linaro_image_tools/media_create/boards.py
  linaro_image_tools/media_create/tests/test_media_create.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro_image_tools/media_create/android_boards.py'
--- linaro_image_tools/media_create/android_boards.py	2011-09-30 13:22:50 +0000
+++ linaro_image_tools/media_create/android_boards.py	2011-11-14 15:14:29 +0000
@@ -185,21 +185,31 @@ 
 
 
 class AndroidSnowballSdConfig(AndroidBoardConfig, SnowballSdConfig):
+    boot_script = 'boot.scr'
+    initrd_addr = '0x05000000'
     extra_boot_args_options = (
-        'earlyprintk rootdelay=1 fixrtc nocompcache '
-        'mem=128M@0 mali.mali_mem=64M@128M mem=24M@192M hwmem=167M@216M '
-        'mem_issw=1M@383M mem=640M@384M vmalloc=256M')
-    _extra_serial_opts = 'console=tty0 console=ttyO2,115200n8'
+        'earlyprintk mem=128M@0 mali.mali_mem=32M@128M hwmem=168M@160M mem=48M@328M mem_issw=1M@383M mem=640M@384M vmalloc=256M')
+    _extra_serial_opts = 'console=ttyAMA2,115200n8'
     android_specific_args = 'init=/init androidboot.console=ttyAMA2'
+    # Snowball uses a custom uboot:
+    # it uses "fat load" instead of fatload and
+    # needs uImage/uInitrd prefixed with /
+    fatload_command = 'fat load'
+    uimage_path = '/'
 
 
 class AndroidSnowballEmmcConfig(AndroidBoardConfig, SnowballEmmcConfig):
+    boot_script = 'boot.scr'
+    initrd_addr = '0x05000000'
     extra_boot_args_options = (
-        'earlyprintk rootdelay=1 fixrtc nocompcache '
-        'mem=128M@0 mali.mali_mem=64M@128M mem=24M@192M hwmem=167M@216M '
-        'mem_issw=1M@383M mem=640M@384M vmalloc=256M')
-    _extra_serial_opts = 'console=tty0 console=ttyAMA2,115200n8'
+        'earlyprintk mem=128M@0 mali.mali_mem=32M@128M hwmem=168M@160M mem=48M@328M mem_issw=1M@383M mem=640M@384M vmalloc=256M')
+    _extra_serial_opts = 'console=ttyAMA2,115200n8'
     android_specific_args = 'init=/init androidboot.console=ttyAMA2'
+    # Snowball uses a custom uboot:
+    # it uses "fat load" instead of fatload and
+    # needs uImage/uInitrd prefixed with /
+    fatload_command = 'fat load'
+    uimage_path = '/'
 
     @classmethod
     def get_sfdisk_cmd(cls, should_align_boot_part=False):

=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py	2011-10-19 12:19:33 +0000
+++ linaro_image_tools/media_create/boards.py	2011-11-09 17:39:45 +0000
@@ -202,8 +202,10 @@ 
     spl_in_boot_part = False
     spl_dd = False
     env_dd = False
+    fatload_command = 'fatload'
     mmc_option = '0:1'
     mmc_part_offset = 0
+    uimage_path = ''
     fat_size = 32
     _extra_serial_opts = ''
     _live_serial_opts = ''
@@ -552,17 +554,18 @@ 
         In general subclasses should not have to override this.
         """
         replacements = dict(
+            fatload_command=cls.fatload_command, uimage_path=cls.uimage_path,
             mmc_option=cls.mmc_option, kernel_addr=cls.kernel_addr,
             initrd_addr=cls.initrd_addr, dtb_addr=cls.dtb_addr)
         boot_script = (
-            "fatload mmc %(mmc_option)s %(kernel_addr)s uImage; "
-            "fatload mmc %(mmc_option)s %(initrd_addr)s uInitrd; "
+            "%(fatload_command)s mmc %(mmc_option)s %(kernel_addr)s %(uimage_path)suImage; "
+            "%(fatload_command)s mmc %(mmc_option)s %(initrd_addr)s %(uimage_path)suInitrd; "
             % replacements)
         if d_img_data is not None:
             assert cls.dtb_addr is not None, (
                 "Need a dtb_addr when passing d_img_data")
             boot_script += (
-                "fatload mmc %(mmc_option)s %(dtb_addr)s board.dtb; "
+                "%(fatload_command)s mmc %(mmc_option)s %(dtb_addr)s board.dtb; "
                 "bootm %(kernel_addr)s %(initrd_addr)s %(dtb_addr)s"
                 % replacements)
         else:

=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
--- linaro_image_tools/media_create/tests/test_media_create.py	2011-10-19 13:59:30 +0000
+++ linaro_image_tools/media_create/tests/test_media_create.py	2011-11-14 15:14:29 +0000
@@ -1396,23 +1396,35 @@ 
                        'fatload mmc 0:1 0x81600000 uInitrd; '
                        'bootm 0x80200000 0x81600000'}
         self.assertEqual(expected, boot_commands)
-	
+
+    def test_android_snowball_sd(self):
+        boot_commands = (android_boards.AndroidSnowballSdConfig.
+                         _get_boot_env(consoles=[]))
+        expected = {
+            'bootargs': 'console=ttyAMA2,115200n8 '
+                        'rootwait ro earlyprintk '
+                        'mem=128M@0 mali.mali_mem=32M@128M hwmem=168M@160M '
+                        'mem=48M@328M mem_issw=1M@383M mem=640M@384M '
+                        'vmalloc=256M init=/init androidboot.console=ttyAMA2',
+            'bootcmd': 'fat load mmc 1:1 0x00100000 /uImage; '
+                       'fat load mmc 1:1 0x05000000 /uInitrd; '
+                       'bootm 0x00100000 0x05000000'}
+        self.assertEqual(expected, boot_commands)
+
     def test_android_snowball_emmc(self):
         boot_commands = (android_boards.AndroidSnowballEmmcConfig.
                          _get_boot_env(consoles=[]))
         expected = {
-            'bootargs': 'console=tty0 console=ttyAMA2,115200n8 '
+            'bootargs': 'console=ttyAMA2,115200n8 '
                         'rootwait ro earlyprintk '
-                        'rootdelay=1 fixrtc nocompcache '
-                        'mem=128M@0 mali.mali_mem=64M@128M mem=24M@192M '
-                        'hwmem=167M@216M mem_issw=1M@383M mem=640M@384M '
+                        'mem=128M@0 mali.mali_mem=32M@128M hwmem=168M@160M '
+                        'mem=48M@328M mem_issw=1M@383M mem=640M@384M '
                         'vmalloc=256M init=/init androidboot.console=ttyAMA2',
-            'bootcmd': 'fatload mmc 1:1 0x00100000 uImage; '
-                       'fatload mmc 1:1 0x08000000 uInitrd; '
-                       'bootm 0x00100000 0x08000000'}
+            'bootcmd': 'fat load mmc 1:1 0x00100000 /uImage; '
+                       'fat load mmc 1:1 0x05000000 /uInitrd; '
+                       'bootm 0x00100000 0x05000000'}
         self.assertEqual(expected, boot_commands)
 
-
     def test_android_origen(self):
         boot_commands = (android_boards.AndroidOrigenConfig.
                          _get_boot_env(consoles=[]))