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
1=== modified file 'linaro_image_tools/media_create/android_boards.py'
2--- linaro_image_tools/media_create/android_boards.py 2011-08-04 13:58:02 +0000
3+++ linaro_image_tools/media_create/android_boards.py 2011-08-22 17:31:41 +0000
4@@ -35,6 +35,7 @@
5 from linaro_image_tools.media_create.boards import SnowballSdConfig
6 from linaro_image_tools.media_create.boards import SnowballEmmcConfig
7 from linaro_image_tools.media_create.boards import SMDKV310Config
8+from linaro_image_tools.media_create.boards import OrigenConfig
9 from linaro_image_tools.media_create.boards import (
10 align_up,
11 align_partition,
12@@ -266,6 +267,27 @@
13 loader_start, loader_len, command)
14
15
16+class AndroidOrigenConfig(AndroidBoardConfig, OrigenConfig):
17+ _extra_serial_opts = 'console=tty0 console=ttySAC2,115200n8'
18+ android_specific_args = 'init=/init androidboot.console=ttySAC2'
19+
20+ @classmethod
21+ def get_sfdisk_cmd(cls, should_align_boot_part=False):
22+ loaders_min_len = (
23+ SAMSUNG_V310_BL2_START + SAMSUNG_V310_BL2_LEN -
24+ SAMSUNG_V310_BL1_START)
25+
26+ loader_start, loader_end, loader_len = align_partition(
27+ 1, loaders_min_len, 1, PART_ALIGN_S)
28+
29+ command = super(AndroidOrigenConfig, cls).get_sfdisk_cmd(
30+ should_align_boot_part=False, start_addr=loader_end,
31+ extra_part=True)
32+
33+ return '%s,%s,0xDA\n%s' % (
34+ loader_start, loader_len, command)
35+
36+
37 android_board_configs = {
38 'beagle': AndroidBeagleConfig,
39 'panda': AndroidPandaConfig,
40@@ -273,4 +295,5 @@
41 'snowball_emmc': AndroidSnowballEmmcConfig,
42 'smdkv310': AndroidSMDKV310Config,
43 'iMX53': AndroidMx53LoCoConfig,
44+ 'origen': AndroidOrigenConfig,
45 }
46
47=== modified file 'linaro_image_tools/media_create/boards.py'
48--- linaro_image_tools/media_create/boards.py 2011-08-19 13:59:34 +0000
49+++ linaro_image_tools/media_create/boards.py 2011-08-22 17:31:41 +0000
50@@ -1049,7 +1049,10 @@
51
52 @classmethod
53 def populate_raw_partition(cls, chroot_dir, boot_device_or_file):
54- # Populate created raw partition with BL1, env and u-boot
55+ # Zero the env so that the boot_script will get loaded
56+ _dd("/dev/zero", boot_device_or_file, count=SAMSUNG_V310_ENV_LEN,
57+ seek=SAMSUNG_V310_ENV_START)
58+ # Populate created raw partition with BL1 and u-boot
59 spl_file = os.path.join(chroot_dir, 'boot', 'u-boot-mmc-spl.bin')
60 assert os.path.getsize(spl_file) <= (SAMSUNG_V310_BL1_LEN * SECTOR_SIZE), (
61 "%s is larger than SAMSUNG_V310_BL1_LEN" % spl_file)

Subscribers

People subscribed via source and target branches