Merge lp://qastaging/~tusharbehera/linaro-image-tools/origen-generic into lp://qastaging/linaro-image-tools/11.11

Proposed by Tushar Behera
Status: Merged
Merged at revision: 590
Proposed branch: lp://qastaging/~tusharbehera/linaro-image-tools/origen-generic
Merge into: lp://qastaging/linaro-image-tools/11.11
Diff against target: 501 lines (+146/-85)
7 files modified
linaro_image_tools/hwpack/config.py (+40/-0)
linaro_image_tools/hwpack/hardwarepack.py (+16/-1)
linaro_image_tools/hwpack/hwpack_fields.py (+4/-0)
linaro_image_tools/hwpack/tests/test_config_v3.py (+12/-0)
linaro_image_tools/media_create/android_boards.py (+2/-2)
linaro_image_tools/media_create/boards.py (+60/-72)
linaro_image_tools/media_create/tests/test_media_create.py (+12/-10)
To merge this branch: bzr merge lp://qastaging/~tusharbehera/linaro-image-tools/origen-generic
Reviewer Review Type Date Requested Status
Milo Casagrande (community) Approve
Review via email: mp+138402@code.qastaging.launchpad.net

Description of the change

Make l-(a)-m-c generic for Samsung Boards. The length and offset for BL1, BL2 and ENV are made generic and they can be loaded through board config files. This way, adding support for new boards would be easier.

To post a comment you must log in.
590. By Tushar Behera

test: Fix testr errors

Revision history for this message
Milo Casagrande (milo) wrote :
Download full text (7.2 KiB)

Hello Tushar,

thanks for working on this!

The general refactoring looks good to me, I have some comments that
follows inline, but nothing earth-shaking.

On Thu, Dec 6, 2012 at 11:02 AM, Tushar Behera <email address hidden> wrote:
>
> === modified file 'linaro_image_tools/media_create/boards.py'
> --- linaro_image_tools/media_create/boards.py 2012-10-22 06:57:20 +0000
> +++ linaro_image_tools/media_create/boards.py 2012-12-06 10:01:23 +0000
> @@ -425,37 +425,26 @@
> # Support for dtb_files as per hwpack v3 format.
> dtb_files = None
>
> - # Samsung v310 implementation notes and terminology
> + # Samsung Boot-loader implementation notes and terminology
> #
> # * BL0, BL1 etc. are the various bootloaders in order of execution
> - # * BL0 is the first stage bootloader, located in ROM; it loads a 32s
> - # long BL1 from MMC offset +1s and runs it
> - # * BL1 is the secondary program loader (SPL), a small (< 14k) version
> + # * BL0 is the first stage bootloader, located in ROM; it loads BL1/SPL
> + # from MMC offset +1s and runs it.
> + # * BL1 is the secondary program loader (SPL), a small version
> # of U-Boot with a checksum; it inits DRAM and loads a 1024s long BL2
> - # to DRAM from MMC offset +65s
> - # * BL2 is U-Boot; it loads its 32s (16 KiB) long environment from MMC
> - # offset +33s which tells it to load a boot.scr from the first FAT
> - # partition of the MMC
> - #
> - # Layout:
> - # +0s: part table / MBR, 1s long
> - # +1s: BL1/SPL, 32s long
> - # +33s: U-Boot environment, 32s long
> - # +65s: U-Boot, 1024s long
> - # >= +1089s: FAT partition with boot script (boot.scr), kernel (uImage)
> - # and initrd (uInitrd)

Is the layout part not relevant anymore? Did it change or can it
change in the future?
It was handy to have around, at least for somebody looking at the code
and with not much knowledge of the Samsung layouts. If it is not
relevant anymore, fine by me to remove it.

> @@ -493,12 +482,12 @@
> cls.kernel_flavors = None
> cls.mmc_option = None
> cls.mmc_part_offset = None
> - cls.SAMSUNG_V310_BL1_START = None
> - cls.SAMSUNG_V310_BL1_LEN = None
> - cls.SAMSUNG_V310_ENV_START = None
> - cls.SAMSUNG_V310_ENV_LEN = None
> - cls.SAMSUNG_V310_BL2_START = None
> - cls.SAMSUNG_V310_BL2_LEN = None
> + cls.samsung_bl1_start = None
> + cls.samsung_bl1_len = None
> + cls.samsung_env_start = None
> + cls.samsung_env_len = None
> + cls.samsung_bl2_start = None
> + cls.samsung_bl2_len = None
>
> # Set new values from metadata.
> cls.kernel_addr = cls.get_metadata_field('kernel_addr')
> @@ -594,31 +583,30 @@
> loader_start = cls.get_metadata_field('loader_start')
> if loader_start is not None:
> cls.LOADER_START_S = int(loader_start)
> +
> samsung_bl1_start = cls.get_metadata_field('samsung_bl1_start')
> ...

Read more...

Revision history for this message
Milo Casagrande (milo) :
review: Needs Information
Revision history for this message
Данило Шеган (danilo) wrote :

Considering this changes boards.py as well, we need to ensure that l-m-c is not broken for existing builds, and that hardware packs (see https://wiki.linaro.org/HardwarePacksV3#Samsung_Parameters) still continue to work properly.

Revision history for this message
Tushar Behera (tusharbehera) wrote :
Download full text (8.5 KiB)

On 12/06/2012 06:37 PM, Milo Casagrande wrote:
> Hello Tushar,
>
> thanks for working on this!
>
> The general refactoring looks good to me, I have some comments that
> follows inline, but nothing earth-shaking.
>
> On Thu, Dec 6, 2012 at 11:02 AM, Tushar Behera <email address hidden> wrote:
>>
>> === modified file 'linaro_image_tools/media_create/boards.py'
>> --- linaro_image_tools/media_create/boards.py 2012-10-22 06:57:20 +0000
>> +++ linaro_image_tools/media_create/boards.py 2012-12-06 10:01:23 +0000
>> @@ -425,37 +425,26 @@
>> # Support for dtb_files as per hwpack v3 format.
>> dtb_files = None
>>
>> - # Samsung v310 implementation notes and terminology
>> + # Samsung Boot-loader implementation notes and terminology
>> #
>> # * BL0, BL1 etc. are the various bootloaders in order of execution
>> - # * BL0 is the first stage bootloader, located in ROM; it loads a 32s
>> - # long BL1 from MMC offset +1s and runs it
>> - # * BL1 is the secondary program loader (SPL), a small (< 14k) version
>> + # * BL0 is the first stage bootloader, located in ROM; it loads BL1/SPL
>> + # from MMC offset +1s and runs it.
>> + # * BL1 is the secondary program loader (SPL), a small version
>> # of U-Boot with a checksum; it inits DRAM and loads a 1024s long BL2
>> - # to DRAM from MMC offset +65s
>> - # * BL2 is U-Boot; it loads its 32s (16 KiB) long environment from MMC
>> - # offset +33s which tells it to load a boot.scr from the first FAT
>> - # partition of the MMC
>> - #
>> - # Layout:
>> - # +0s: part table / MBR, 1s long
>> - # +1s: BL1/SPL, 32s long
>> - # +33s: U-Boot environment, 32s long
>> - # +65s: U-Boot, 1024s long
>> - # >= +1089s: FAT partition with boot script (boot.scr), kernel (uImage)
>> - # and initrd (uInitrd)
>
> Is the layout part not relevant anymore? Did it change or can it
> change in the future?
> It was handy to have around, at least for somebody looking at the code
> and with not much knowledge of the Samsung layouts. If it is not
> relevant anymore, fine by me to remove it.
>

The layout part is not fixed anymore. In the earlier case (for SMDKV310
and Origen), the layout was like below.

--------------------------------------------
 | BL1 | ENV | BL2 |
--------------------------------------------
 1 +32s 33 +32s 65 +1024 1089
--------------------------------------------

The newer layout is a bit flexible wherein ENV may lie before or after
BL2, depending on the specific u-boot. That is why the offset of ENV and
BL2 is no more fixed, rather should be provided through board config.

>> @@ -493,12 +482,12 @@
>> cls.kernel_flavors = None
>> cls.mmc_option = None
>> cls.mmc_part_offset = None
>> - cls.SAMSUNG_V310_BL1_START = None
>> - cls.SAMSUNG_V310_BL1_LEN = None
>> - cls.SAMSUNG_V310_ENV_START = None
>> - cls.SAMSUNG_V310_ENV_LEN = None
>> - cls.SAMSUNG_V310_BL2_START = None
>> - cls.SAMSUNG_V310_BL2_LEN = None
>> + ...

Read more...

591. By Tushar Behera

Fix l-m-c issues after refactoring Samsung related code

Revision history for this message
Milo Casagrande (milo) wrote :

Hello Tushar,

overall it looks good to me. I tested creating a panda image and everything works as expected.
If somebody else can take a look and perform another image creation/installation, that would be better.

One thing that should also be done is documenting the two new fields (samsung_env_start, samsung_bl2_start) here:

https://wiki.linaro.org/HardwarePacksV3#Samsung_Parameters

In order to have all the fields listed and to keep track of them (also for people creating new hwpack configuration files).

review: Approve
Revision history for this message
Tushar Behera (tusharbehera) wrote :
Revision history for this message
Milo Casagrande (milo) wrote :

Thanks Tushar!
This has now been merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches