Merge lp:~linaro-landing-team-samsung/linaro-image-tools/add-origen-android-support into lp:linaro-image-tools/11.11

Proposed by Angus Ainslie
Status: Merged
Merged at revision: 427
Proposed branch: lp:~linaro-landing-team-samsung/linaro-image-tools/add-origen-android-support
Merge into: lp:linaro-image-tools/11.11
Diff against target: 61 lines (+27/-1)
2 files modified
linaro_image_tools/media_create/android_boards.py (+23/-0)
linaro_image_tools/media_create/boards.py (+4/-1)
To merge this branch: bzr merge lp:~linaro-landing-team-samsung/linaro-image-tools/add-origen-android-support
Reviewer Review Type Date Requested Status
Mattias Backman (community) Needs Fixing
Linaro Maintainers Pending
Review via email: mp+72465@code.launchpad.net

Description of the change

This branch adds Origen support to lianro-android-media-create

It also zero's the u-boot env area on the SD card so that an old env doesn't get used.

To post a comment you must log in.
Revision history for this message
Mattias Backman (mabac) wrote :

The get_sfdisk functions in AndroidSMDKV310Config and AndroidOrigenConfig look identical to me, so I would like to see a AndroidSamsungConfig which both BoardConfigs inherit from to reduce duplication similar to what's been done in boards.py.

A few tests would also be nice, similar to those for the Panda and Snowball_emmc Android board configs.

review: Needs Fixing
Revision history for this message
Mattias Backman (mabac) wrote :

> === modified file 'linaro_image_tools/media_create/boards.py'
> --- linaro_image_tools/media_create/boards.py   2011-08-19 13:59:34 +0000
> +++ linaro_image_tools/media_create/boards.py   2011-08-22 17:31:41 +0000
> @@ -1049,7 +1049,10 @@
>
>     @classmethod
>     def populate_raw_partition(cls, chroot_dir, boot_device_or_file):
> -        # Populate created raw partition with BL1, env and u-boot
> +        # Zero the env so that the boot_script will get loaded
> +        _dd("/dev/zero", boot_device_or_file, count=SAMSUNG_V310_ENV_LEN,
> +            seek=SAMSUNG_V310_ENV_START)

If you're sure that this is ok for both Origen and SMDKV310, it's fine
by me. It will affect both boards, for Android and non-Android, but
all the other boards will be unaffected.

> +        # Populate created raw partition with BL1 and u-boot
>         spl_file = os.path.join(chroot_dir, 'boot', 'u-boot-mmc-spl.bin')
>         assert os.path.getsize(spl_file) <= (SAMSUNG_V310_BL1_LEN * SECTOR_SIZE), (
>             "%s is larger than SAMSUNG_V310_BL1_LEN" % spl_file)
>
>
>

Revision history for this message
Angus Ainslie (angus-akkea) wrote :

Hi Mathias

On Wed, Aug 24, 2011 at 2:40 AM, Mattias Backman
<email address hidden> wrote:
>> === modified file 'linaro_image_tools/media_create/boards.py'
>> --- linaro_image_tools/media_create/boards.py   2011-08-19 13:59:34 +0000
>> +++ linaro_image_tools/media_create/boards.py   2011-08-22 17:31:41 +0000
>> @@ -1049,7 +1049,10 @@
>>
>>     @classmethod
>>     def populate_raw_partition(cls, chroot_dir, boot_device_or_file):
>> -        # Populate created raw partition with BL1, env and u-boot
>> +        # Zero the env so that the boot_script will get loaded
>> +        _dd("/dev/zero", boot_device_or_file, count=SAMSUNG_V310_ENV_LEN,
>> +            seek=SAMSUNG_V310_ENV_START)
>
> If you're sure that this is ok for both Origen and SMDKV310, it's fine
> by me. It will affect both boards, for Android and non-Android, but
> all the other boards will be unaffected.
>

In the Android case the boot.scr should take over an in the Ubuntu
case the flashable_env will get written after this.

>> +        # Populate created raw partition with BL1 and u-boot
>>         spl_file = os.path.join(chroot_dir, 'boot', 'u-boot-mmc-spl.bin')
>>         assert os.path.getsize(spl_file) <= (SAMSUNG_V310_BL1_LEN * SECTOR_SIZE), (
>>             "%s is larger than SAMSUNG_V310_BL1_LEN" % spl_file)
>>
>>
>>
>
> --
> https://code.launchpad.net/~linaro-landing-team-samsung/linaro-image-tools/add-origen-android-support/+merge/72465
> Your team Linaro Landing Team: Samsung is subscribed to branch lp:~linaro-landing-team-samsung/linaro-image-tools/add-origen-android-support.
>

--
Angus Ainslie <email address hidden>
Team Lead, Samsung Landing Team

Revision history for this message
Mattias Backman (mabac) wrote :

Refactoring and tests added in lp:~mabac/linaro-image-tools/add-origen-android-support which has been tested by rsalveti and botao.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'linaro_image_tools/media_create/android_boards.py'
--- linaro_image_tools/media_create/android_boards.py 2011-08-04 13:58:02 +0000
+++ linaro_image_tools/media_create/android_boards.py 2011-08-22 17:31:41 +0000
@@ -35,6 +35,7 @@
35from linaro_image_tools.media_create.boards import SnowballSdConfig35from linaro_image_tools.media_create.boards import SnowballSdConfig
36from linaro_image_tools.media_create.boards import SnowballEmmcConfig36from linaro_image_tools.media_create.boards import SnowballEmmcConfig
37from linaro_image_tools.media_create.boards import SMDKV310Config37from linaro_image_tools.media_create.boards import SMDKV310Config
38from linaro_image_tools.media_create.boards import OrigenConfig
38from linaro_image_tools.media_create.boards import (39from linaro_image_tools.media_create.boards import (
39 align_up,40 align_up,
40 align_partition,41 align_partition,
@@ -266,6 +267,27 @@
266 loader_start, loader_len, command)267 loader_start, loader_len, command)
267268
268269
270class AndroidOrigenConfig(AndroidBoardConfig, OrigenConfig):
271 _extra_serial_opts = 'console=tty0 console=ttySAC2,115200n8'
272 android_specific_args = 'init=/init androidboot.console=ttySAC2'
273
274 @classmethod
275 def get_sfdisk_cmd(cls, should_align_boot_part=False):
276 loaders_min_len = (
277 SAMSUNG_V310_BL2_START + SAMSUNG_V310_BL2_LEN -
278 SAMSUNG_V310_BL1_START)
279
280 loader_start, loader_end, loader_len = align_partition(
281 1, loaders_min_len, 1, PART_ALIGN_S)
282
283 command = super(AndroidOrigenConfig, cls).get_sfdisk_cmd(
284 should_align_boot_part=False, start_addr=loader_end,
285 extra_part=True)
286
287 return '%s,%s,0xDA\n%s' % (
288 loader_start, loader_len, command)
289
290
269android_board_configs = {291android_board_configs = {
270 'beagle': AndroidBeagleConfig,292 'beagle': AndroidBeagleConfig,
271 'panda': AndroidPandaConfig,293 'panda': AndroidPandaConfig,
@@ -273,4 +295,5 @@
273 'snowball_emmc': AndroidSnowballEmmcConfig,295 'snowball_emmc': AndroidSnowballEmmcConfig,
274 'smdkv310': AndroidSMDKV310Config,296 'smdkv310': AndroidSMDKV310Config,
275 'iMX53': AndroidMx53LoCoConfig,297 'iMX53': AndroidMx53LoCoConfig,
298 'origen': AndroidOrigenConfig,
276 }299 }
277300
=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py 2011-08-19 13:59:34 +0000
+++ linaro_image_tools/media_create/boards.py 2011-08-22 17:31:41 +0000
@@ -1049,7 +1049,10 @@
10491049
1050 @classmethod1050 @classmethod
1051 def populate_raw_partition(cls, chroot_dir, boot_device_or_file):1051 def populate_raw_partition(cls, chroot_dir, boot_device_or_file):
1052 # Populate created raw partition with BL1, env and u-boot1052 # Zero the env so that the boot_script will get loaded
1053 _dd("/dev/zero", boot_device_or_file, count=SAMSUNG_V310_ENV_LEN,
1054 seek=SAMSUNG_V310_ENV_START)
1055 # Populate created raw partition with BL1 and u-boot
1053 spl_file = os.path.join(chroot_dir, 'boot', 'u-boot-mmc-spl.bin')1056 spl_file = os.path.join(chroot_dir, 'boot', 'u-boot-mmc-spl.bin')
1054 assert os.path.getsize(spl_file) <= (SAMSUNG_V310_BL1_LEN * SECTOR_SIZE), (1057 assert os.path.getsize(spl_file) <= (SAMSUNG_V310_BL1_LEN * SECTOR_SIZE), (
1055 "%s is larger than SAMSUNG_V310_BL1_LEN" % spl_file)1058 "%s is larger than SAMSUNG_V310_BL1_LEN" % spl_file)

Subscribers

People subscribed via source and target branches