Merge lp:~milo/linaro-image-tools/bug1158772 into lp:linaro-image-tools/11.11

Proposed by Milo Casagrande
Status: Merged
Approved by: Fathi Boudra
Approved revision: 615
Merged at revision: 612
Proposed branch: lp:~milo/linaro-image-tools/bug1158772
Merge into: lp:linaro-image-tools/11.11
Diff against target: 160 lines (+63/-8)
4 files modified
linaro_image_tools/media_create/android_boards.py (+40/-0)
linaro_image_tools/media_create/boards.py (+3/-3)
linaro_image_tools/media_create/tests/test_android_boards.py (+15/-0)
linaro_image_tools/media_create/tests/test_media_create.py (+5/-5)
To merge this branch: bzr merge lp:~milo/linaro-image-tools/bug1158772
Reviewer Review Type Date Requested Status
Fathi Boudra Approve
James Tunnicliffe (community) Approve
Review via email: mp+155231@code.launchpad.net

Commit message

Added support for Arndale in l-a-m-c. fixed problem with _get_bootcmd.

Description of the change

Added support for Arndale in android boards with its own test.

Fixed also a bug with the _get_bootcmd method, where the dtb file name, if passed, was not used and it always defaulted to board.dtb. Fixed also the tests that made that assumption.

To post a comment you must log in.
Revision history for this message
vishal (vishalbhoj) wrote :

Looks good.

Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Good stuff.

review: Approve
Revision history for this message
Fathi Boudra (fboudra) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'linaro_image_tools/media_create/android_boards.py'
2--- linaro_image_tools/media_create/android_boards.py 2013-02-17 13:53:41 +0000
3+++ linaro_image_tools/media_create/android_boards.py 2013-03-25 13:55:25 +0000
4@@ -35,6 +35,7 @@
5 from linaro_image_tools.hwpack.hwpack_fields import FORMAT_FIELD
6 from linaro_image_tools.media_create.partitions import SECTOR_SIZE
7 from linaro_image_tools.media_create.boards import (
8+ ArndaleConfig,
9 BeagleConfig,
10 BoardConfig,
11 BoardConfigException,
12@@ -51,6 +52,8 @@
13 align_up,
14 install_mx5_boot_loader,
15 make_boot_script,
16+ _dd,
17+ BoardException,
18 )
19 from linaro_image_tools.utils import DEFAULT_LOGGER_NAME
20
21@@ -496,6 +499,42 @@
22 self._android_specific_args = 'init=/init androidboot.console=ttyAMA0'
23
24
25+class AndroidArndaleConfig(AndroidSamsungConfig, ArndaleConfig):
26+ """Placeholder class for Arndale configuration inheritance."""
27+ def __init__(self):
28+ super(AndroidArndaleConfig, self).__init__()
29+ self.mmc_option = '0:1'
30+ self.kernel_addr = '0x40007000'
31+ self.initrd_addr = '0x41000000'
32+ self.dtb_addr = '0x41f00000'
33+ self.dtb_name = 'exynos5250-arndale.dtb'
34+ self._android_specific_args = ('init=/init '
35+ 'androidboot.console=ttySAC2 console=ttySAC2 '
36+ 'initrd=%s' % self.initrd_addr)
37+ self._extra_serial_options = 'ttySAC2,115200n8'
38+ self._extra_boot_args_options = 'rootdelay=3'
39+
40+ def populate_raw_partition(self, boot_device_or_file, chroot_dir):
41+ boot_bin_0 = {'name': 'arndale-bl1.bin', 'seek': 1}
42+ boot_bin_1 = {'name': 'u-boot-mmc-spl.bin', 'seek': 17}
43+ boot_bin_2 = {'name': 'u-boot.bin', 'seek': 49}
44+ boot_bins = [boot_bin_0, boot_bin_1, boot_bin_2]
45+
46+ boot_partition = 'boot'
47+
48+ # Zero the env so that the boot_script will get loaded
49+ _dd("/dev/zero", boot_device_or_file, count=self.samsung_env_len,
50+ seek=self.samsung_env_start)
51+
52+ for boot_bin in boot_bins:
53+ name = boot_bin['name']
54+ file_path = os.path.join(chroot_dir, boot_partition, name)
55+ if not os.path.exists(file_path):
56+ raise BoardException("File '%s' does not exists. Cannot "
57+ "proceed." % name)
58+ _dd(file_path, boot_device_or_file, seek=boot_bin['seek'])
59+
60+
61 # This dictionary is composed as follows:
62 # <device_name>: <class>
63 # The <device_name> is the command line argument passed to l-a-m-c, the
64@@ -503,6 +542,7 @@
65 # If a new device does not have special needs, it is possible to use the
66 # general AndroidBoardConfig class.
67 android_board_configs = {
68+ 'arndale': AndroidArndaleConfig,
69 'beagle': AndroidBeagleConfig,
70 'iMX53': AndroidMx53LoCoConfig,
71 'mx53loco': AndroidMx53LoCoConfig,
72
73=== modified file 'linaro_image_tools/media_create/boards.py'
74--- linaro_image_tools/media_create/boards.py 2013-03-21 10:50:08 +0000
75+++ linaro_image_tools/media_create/boards.py 2013-03-25 13:55:25 +0000
76@@ -533,9 +533,9 @@
77 if d_img_data is not None:
78 assert self.dtb_addr is not None, (
79 "Need a dtb_addr when passing d_img_data")
80- boot_script += (
81- ("%(fatload_command)s mmc %(mmc_option)s %(dtb_addr)s " +
82- "board.dtb; ")) % replacements
83+ boot_script += (("%(fatload_command)s mmc %(mmc_option)s "
84+ "%(dtb_addr)s ")) % replacements
85+ boot_script += "%s; " % d_img_data
86 boot_script += (("bootm %(kernel_addr)s")) % replacements
87 if i_img_data is not None:
88 boot_script += ((" %(initrd_addr)s")) % replacements
89
90=== modified file 'linaro_image_tools/media_create/tests/test_android_boards.py'
91--- linaro_image_tools/media_create/tests/test_android_boards.py 2013-02-18 13:05:58 +0000
92+++ linaro_image_tools/media_create/tests/test_android_boards.py 2013-03-25 13:55:25 +0000
93@@ -481,3 +481,18 @@
94 'fdt_high': '0xffffffff',
95 'initrd_high': '0xffffffff'}
96 self.assertBootEnv(expected, board='mx53loco')
97+
98+ def test_android_arndale_old(self):
99+ """Test that uses values taken directly from the class. """
100+ expected = {
101+ 'bootargs': 'ttySAC2,115200n8 rootwait ro rootdelay=3 '
102+ 'init=/init androidboot.console=ttySAC2 '
103+ 'console=ttySAC2 initrd=0x41000000',
104+ 'bootcmd': 'fatload mmc 0:1 0x40007000 uImage; fatload mmc 0:1 '
105+ '0x41000000 uInitrd; fatload mmc 0:1 0x41f00000 '
106+ 'exynos5250-arndale.dtb; bootm 0x40007000 0x41000000 '
107+ '0x41f00000',
108+ 'fdt_high': '0xffffffff',
109+ 'initrd_high': '0xffffffff',
110+ }
111+ self.assertBootEnv(expected, board='arndale')
112
113=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
114--- linaro_image_tools/media_create/tests/test_media_create.py 2013-03-21 10:50:08 +0000
115+++ linaro_image_tools/media_create/tests/test_media_create.py 2013-03-25 13:55:25 +0000
116@@ -2002,7 +2002,7 @@
117 'root=UUID=deadbeef rootwait ro',
118 'bootcmd': 'fatload mmc 0:2 0x90000000 uImage; '
119 'fatload mmc 0:2 0x92000000 uInitrd; '
120- 'fatload mmc 0:2 0x91ff0000 board.dtb; '
121+ 'fatload mmc 0:2 0x91ff0000 mx51.dtb; '
122 'bootm 0x90000000 0x92000000 0x91ff0000',
123 'fdt_high': '0xffffffff',
124 'initrd_high': '0xffffffff'}
125@@ -2126,7 +2126,7 @@
126 'mem=456M@0x80000000 mem=512M@0xA0000000',
127 'bootcmd': 'fatload mmc 0:1 0x80200000 uImage; '
128 'fatload mmc 0:1 0x81600000 uInitrd; '
129- 'fatload mmc 0:1 0x815f0000 board.dtb; '
130+ 'fatload mmc 0:1 0x815f0000 panda.dtb; '
131 'bootm 0x80200000 0x81600000 0x815f0000',
132 'fdt_high': '0xffffffff',
133 'initrd_high': '0xffffffff'}
134@@ -2149,7 +2149,7 @@
135 'omapfb.mode=dvi:1280x720MR-16@60 mpurate=${mpurate}',
136 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '
137 'fatload mmc 0:1 0x81600000 uInitrd; '
138- 'fatload mmc 0:1 0x815f0000 board.dtb; '
139+ 'fatload mmc 0:1 0x815f0000 beagle.dtb; '
140 'bootm 0x80000000 0x81600000 0x815f0000',
141 'fdt_high': '0xffffffff',
142 'initrd_high': '0xffffffff'}
143@@ -2172,7 +2172,7 @@
144 'omapfb.mode=dvi:1280x720MR-16@60 mpurate=${mpurate}',
145 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '
146 'fatload mmc 0:1 0x81600000 uInitrd; '
147- 'fatload mmc 0:1 0x815f0000 board.dtb; '
148+ 'fatload mmc 0:1 0x815f0000 igep.dtb; '
149 'bootm 0x80000000 0x81600000 0x815f0000',
150 'fdt_high': '0xffffffff',
151 'initrd_high': '0xffffffff'}
152@@ -2196,7 +2196,7 @@
153 'omapfb.mode=dvi:${dvimode}',
154 'bootcmd': 'fatload mmc 0:1 0x80000000 uImage; '
155 'fatload mmc 0:1 0x81600000 uInitrd; '
156- 'fatload mmc 0:1 0x815f0000 board.dtb; '
157+ 'fatload mmc 0:1 0x815f0000 overo.dtb; '
158 'bootm 0x80000000 0x81600000 0x815f0000',
159 'fdt_high': '0xffffffff',
160 'initrd_high': '0xffffffff'}

Subscribers

People subscribed via source and target branches