aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2013-08-16 11:13:40 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2013-08-16 11:13:40 +0300
commit40c865ee2a67071ad7dbb48799a682631b965152 (patch)
treed5dc1acbc73a5dd1e6e516904a3d30d650eee637
parenta854bc17e2fff247974cb999a66b9edb0b6dd6c2 (diff)
parent7781b2d2a34750b2a676d19335ddcff0a5cf71ba (diff)
downloadlinaro-image-tools-40c865ee2a67071ad7dbb48799a682631b965152.tar.gz
Rebase
-rw-r--r--linaro_image_tools/media_create/boards.py45
-rw-r--r--linaro_image_tools/media_create/tests/test_media_create.py51
2 files changed, 81 insertions, 15 deletions
diff --git a/linaro_image_tools/media_create/boards.py b/linaro_image_tools/media_create/boards.py
index dfc57cd..02b291d 100644
--- a/linaro_image_tools/media_create/boards.py
+++ b/linaro_image_tools/media_create/boards.py
@@ -534,21 +534,27 @@ class BoardConfig(object):
boot_script = (
("%(fatload_command)s %(load_interface)s %(mmc_option)s "
"%(kernel_addr)s %(uimage_path)suImage; ")) % replacements
- if i_img_data is not None:
+ boot_script_bootm = (("bootm %(kernel_addr)s")) % replacements
+ if i_img_data is not None and d_img_data is not None:
+ boot_script += (
+ ("%(fatload_command)s %(load_interface)s %(mmc_option)s "
+ "%(initrd_addr)s %(uimage_path)suInitrd; "
+ "%(fatload_command)s %(load_interface)s %(mmc_option)s "
+ "%(dtb_addr)s board.dtb; ")) % replacements
+ boot_script_bootm += (
+ (" %(initrd_addr)s %(dtb_addr)s")) % replacements
+ elif i_img_data is None and d_img_data is not None:
+ boot_script += (
+ ("%(fatload_command)s %(load_interface)s %(mmc_option)s "
+ "%(dtb_addr)s board.dtb; ")) % replacements
+ boot_script_bootm += ((" - %(dtb_addr)s")) % replacements
+ elif i_img_data is not None and d_img_data is None:
boot_script += (
("%(fatload_command)s %(load_interface)s %(mmc_option)s "
"%(initrd_addr)s %(uimage_path)suInitrd; ")) % replacements
- if d_img_data is not None:
- assert self.dtb_addr is not None, (
- "Need a dtb_addr when passing d_img_data")
- boot_script += (
- ("%(fatload_command)s %(load_interface)s %(mmc_option)s "
- "%(dtb_addr)s board.dtb; ")) % replacements
- boot_script += (("bootm %(kernel_addr)s")) % replacements
- if i_img_data is not None:
- boot_script += ((" %(initrd_addr)s")) % replacements
- if self.dtb_addr is not None:
- boot_script += ((" %(dtb_addr)s")) % replacements
+ boot_script_bootm += ((" %(initrd_addr)s")) % replacements
+
+ boot_script += boot_script_bootm
return boot_script
def add_boot_args(self, extra_args):
@@ -1721,6 +1727,20 @@ class HighBankConfig(BoardConfig):
self.load_addr = '0x00000000'
+class Aa9Config(BoardConfig):
+ def __init__(self):
+ super(Aa9Config, self).__init__()
+ self.boot_script = 'boot.scr'
+ self.bootloader_flavor = 'mb8ac0300eb'
+ self.kernel_flavors = None
+ self._serial_tty = 'ttyS0'
+ self.dtb_addr = '0x41000000'
+ self.initrd_addr = '0x41100000'
+ self.kernel_addr = '0x40000000'
+ self.load_addr = '0x40008000'
+ self._extra_serial_options = 'console=ttyS0,115200n8'
+
+
class I386Config(BoardConfig):
# define bootloader
BOOTLOADER_CMD = 'grub-install'
@@ -1787,6 +1807,7 @@ class BoardConfigException(Exception):
board_configs = {
+ 'aa9': Aa9Config,
'arndale': ArndaleConfig,
'beagle': BeagleConfig,
'beaglebone': BeagleBoneConfig,
diff --git a/linaro_image_tools/media_create/tests/test_media_create.py b/linaro_image_tools/media_create/tests/test_media_create.py
index 71beb56..269f986 100644
--- a/linaro_image_tools/media_create/tests/test_media_create.py
+++ b/linaro_image_tools/media_create/tests/test_media_create.py
@@ -1440,6 +1440,12 @@ class TestBootSteps(TestCaseWithFixtures):
'make_dtb', 'make_boot_script', 'make_boot_ini']
self.assertEqual(expected, self.funcs_calls)
+ def test_aa9_steps(self):
+ board_conf = boards.Aa9Config()
+ board_conf.hwpack_format = HardwarepackHandler.FORMAT_1
+ expected = []
+ self.assertEqual(expected, self.funcs_calls)
+
class TestPopulateRawPartition(TestCaseWithFixtures):
@@ -1571,6 +1577,11 @@ class TestPopulateRawPartition(TestCaseWithFixtures):
expected = []
self.assertEqual(expected, self.funcs_calls)
+ def test_aa9_raw(self):
+ self.populate_raw_partition(boards.Aa9Config())
+ expected = []
+ self.assertEqual(expected, self.funcs_calls)
+
class TestPopulateRawPartitionAndroid(TestCaseWithFixtures):
@@ -1878,10 +1889,17 @@ class TestGetSfdiskCmd(TestCase):
board_conf.get_sfdisk_cmd())
def test_beaglebone(self):
- board_conf = get_board_config('highbank')
+ board_conf = get_board_config('beaglebone')
self.set_up_config(board_conf)
self.assertEquals(
- '63,106432,0x83,*\n106496,,,-',
+ '63,106432,0x0C,*\n106496,,,-',
+ board_conf.get_sfdisk_cmd())
+
+ def test_aa9(self):
+ board_conf = get_board_config('aa9')
+ self.set_up_config(board_conf)
+ self.assertEquals(
+ '63,106432,0x0C,*\n106496,,,-',
board_conf.get_sfdisk_cmd())
def test_panda_android(self):
@@ -2013,6 +2031,13 @@ class TestGetSfdiskCmdV2(TestCase):
'63,106432,0x0C,*\n106496,,,-',
board_conf.get_sfdisk_cmd())
+ def test_aa9(self):
+ board_conf = get_board_config('aa9')
+ board_conf.partition_layout = 'bootfs_rootfs'
+ self.assertEquals(
+ '63,106432,0x0C,*\n106496,,,-',
+ board_conf.get_sfdisk_cmd())
+
class TestGetBootCmd(TestCase):
@@ -2261,11 +2286,13 @@ class TestGetBootCmd(TestCase):
board_conf = get_board_config('highbank')
boot_commands = board_conf._get_boot_env(
is_live=False, is_lowmem=False, consoles=[],
- rootfs_id="UUID=deadbeef", i_img_data="initrd", d_img_data=None)
+ rootfs_id="UUID=deadbeef", i_img_data="initrd",
+ d_img_data="board.dtb")
expected = {
'bootargs': 'root=UUID=deadbeef rootwait ro',
'bootcmd': 'ext2load scsi 0:1 0x00800000 uImage; '
'ext2load scsi 0:1 0x01000000 uInitrd; '
+ 'ext2load scsi 0:1 0x00001000 board.dtb; '
'bootm 0x00800000 0x01000000 0x00001000',
'fdt_high': '0xffffffff',
'initrd_high': '0xffffffff'}
@@ -2289,6 +2316,24 @@ class TestGetBootCmd(TestCase):
'initrd_high': '0xffffffff'}
self.assertEqual(expected, boot_commands)
+ def test_aa9(self):
+ config = get_board_config('aa9')
+ 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=ttyS0,115200n8 '
+ 'root=UUID=deadbeef rootwait ro',
+ 'bootcmd': 'fatload mmc 0:1 0x40000000 uImage; '
+ 'fatload mmc 0:1 0x41100000 uInitrd; '
+ 'fatload mmc 0:1 0x41000000 board.dtb; '
+ 'bootm 0x40000000 0x41100000 0x41000000',
+ 'fdt_high': '0xffffffff',
+ 'initrd_high': '0xffffffff'}
+ self.assertEqual(expected, boot_commands)
+
class TestExtraBootCmd(TestCaseWithFixtures):