diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 622: Added BeagleBone support.

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

Commit Message

Milo Casagrande May 23, 2013, 6:07 p.m. UTC
Merge authors:
  Fathi Boudra (fboudra)
Related merge proposals:
  https://code.launchpad.net/~fboudra/linaro-image-tools/beaglebone-support/+merge/165455
  proposed by: Fathi Boudra (fboudra)
  review: Approve - Milo Casagrande (milo)
------------------------------------------------------------
revno: 622 [merge]
author: Fathi Boudra <fathi.boudra@linaro.org>
committer: Milo Casagrande <milo@ubuntu.com>
branch nick: trunk
timestamp: Thu 2013-05-23 20:06:50 +0200
message:
  Added BeagleBone support.
modified:
  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/boards.py'
--- linaro_image_tools/media_create/boards.py	2013-04-04 08:12:38 +0000
+++ linaro_image_tools/media_create/boards.py	2013-05-23 17:29:29 +0000
@@ -896,7 +896,6 @@ 
 
 
 class OmapConfig(BoardConfig):
-
     def __init__(self):
         super(OmapConfig, self).__init__()
         self.kernel_flavors = ['linaro-omap4', 'linaro-lt-omap',
@@ -963,7 +962,6 @@ 
 
 
 class BeagleConfig(OmapConfig):
-
     def __init__(self):
         super(BeagleConfig, self).__init__()
         self.boot_script = 'boot.scr'
@@ -1016,6 +1014,21 @@ 
         self._live_serial_options = 'serialtty=%s'
 
 
+class BeagleBoneConfig(OmapConfig):
+    def __init__(self):
+        super(BeagleBoneConfig, self).__init__()
+        self.boot_script = 'boot.scr'
+        self.bootloader_flavor = 'am335x_evm'
+        self.kernel_flavors = ['am335x']
+        self._serial_tty = 'ttyO0'
+        self.dtb_addr = '0x815f0000'
+        self.initrd_addr = '0x81600000'
+        self.kernel_addr = '0x80200000'
+        self.load_addr = '0x80008000'
+        self.extra_boot_args_options = ('fixrtc')
+        self._extra_serial_options = 'console=ttyO0,115200n8'
+
+
 class IgepConfig(BeagleConfig):
     def __init__(self):
         super(IgepConfig, self).__init__()
@@ -1774,6 +1787,7 @@ 
 board_configs = {
     'arndale': ArndaleConfig,
     'beagle': BeagleConfig,
+    'beaglebone': BeagleBoneConfig,
     'efikamx': EfikamxConfig,
     'efikasb': EfikasbConfig,
     'fastmodel': FastModelConfig,

=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
--- linaro_image_tools/media_create/tests/test_media_create.py	2013-04-04 08:12:38 +0000
+++ linaro_image_tools/media_create/tests/test_media_create.py	2013-05-23 17:57:10 +0000
@@ -1429,6 +1429,16 @@ 
         expected = []
         self.assertEqual(expected, self.funcs_calls)
 
+    def test_beaglbone_steps(self):
+        board_conf = boards.BeagleBoneConfig()
+        board_conf.hwpack_format = HardwarepackHandler.FORMAT_1
+        self.mock_set_appropriate_serial_tty(board_conf)
+        self.make_boot_files(board_conf)
+        expected = [
+            'install_omap_boot_loader', 'make_uImage', 'make_uInitrd',
+            'make_dtb', 'make_boot_script', 'make_boot_ini']
+        self.assertEqual(expected, self.funcs_calls)
+
 
 class TestPopulateRawPartition(TestCaseWithFixtures):
 
@@ -1555,6 +1565,11 @@ 
         expected = []
         self.assertEqual(expected, self.funcs_calls)
 
+    def test_beaglebone_raw(self):
+        self.populate_raw_partition(boards.BeagleBoneConfig())
+        expected = []
+        self.assertEqual(expected, self.funcs_calls)
+
 
 class TestPopulateRawPartitionAndroid(TestCaseWithFixtures):
 
@@ -1861,6 +1876,13 @@ 
             '63,106432,0x83,*\n106496,,,-',
             board_conf.get_sfdisk_cmd())
 
+    def test_beaglebone(self):
+        board_conf = get_board_config('highbank')
+        self.set_up_config(board_conf)
+        self.assertEquals(
+            '63,106432,0x83,*\n106496,,,-',
+            board_conf.get_sfdisk_cmd())
+
     def test_panda_android(self):
         self.assertEqual(
             '63,270272,0x0C,*\n270336,1048576,L\n1318912,524288,L\n'
@@ -1983,6 +2005,13 @@ 
             '63,106432,0x83,*\n106496,,,-',
             board_conf.get_sfdisk_cmd())
 
+    def test_beaglebone(self):
+        board_conf = get_board_config('beaglebone')
+        board_conf.partition_layout = 'bootfs_rootfs'
+        self.assertEquals(
+            '63,106432,0x0C,*\n106496,,,-',
+            board_conf.get_sfdisk_cmd())
+
 
 class TestGetBootCmd(TestCase):
 
@@ -2241,6 +2270,24 @@ 
             'initrd_high': '0xffffffff'}
         self.assertEqual(expected, boot_commands)
 
+    def test_beaglebone(self):
+        config = get_board_config('beaglebone')
+        config.serial_tty = config._serial_tty
+        boot_commands = config._get_boot_env(
+            is_live=False, is_lowmem=False, consoles=[],
+            rootfs_id="UUID=deadbeef", i_img_data="initrd",
+            d_img_data="board.dtb")
+        expected = {
+            'bootargs': 'console=ttyO0,115200n8  '
+                        'root=UUID=deadbeef rootwait ro fixrtc',
+            'bootcmd': 'fatload mmc 0:1 0x80200000 uImage; '
+                       'fatload mmc 0:1 0x81600000 uInitrd; '
+                       'fatload mmc 0:1 0x815f0000 board.dtb; '
+                       'bootm 0x80200000 0x81600000 0x815f0000',
+            'fdt_high': '0xffffffff',
+            'initrd_high': '0xffffffff'}
+        self.assertEqual(expected, boot_commands)
+
 
 class TestExtraBootCmd(TestCaseWithFixtures):