- It provides a way to promise kernel dtb can be loaded successfully
even when the image is damaged.
- This makes developers easily to add what they what just like a "U-Boot" dtb.
- The kern.dtb file is pack into the end of u-boot.bin while ./dts/kern.dtb
is exist.
Change-Id: I93a36a9c65ea8719e5610cdcbcc7708e5337c53f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The 0x0 address is usually allocated by 32-bit uncompressed kernel
and this alloc action is just a peek. Due to LMB core doesn't support
alloc at 0x0 address, we have to alloc the memblk backword a few bytes.
This patch is mainly to avoid fail message from sysmem/LMB.
Change-Id: I894ae2252a30a7690d10899484266191dfb12d15
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The commit point is updated to google external/avb/
which commit point is 868db2a514bbb02e166fb55b1592b27de8c9680c.
Change-Id: I10f7c0ac356a7666b518b62e59ccb62277668578
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Porting from: https://tls.mbed.org/sha-512-source-code.
Update and follow sha1/256.c function name and coding style.
Change-Id: Idbe70b71e54e0e56a88aac5ec306c75fb2237f4f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
- Allow request region alloc within the first invisiable region reserved by
bidram when request region has flags M_ATTR_IGNORE_INVISIBLE. This is a
workaround for some firmware memory layout, eg: on RK3308-AArch32, the ATF
region is 0~1M(same as RK3308-AArch64), but the kernel would like to alloc
at 0x00058000.
- Always make kernel reserved-memory alloc successfully and check overlap
with invisible and sysmem allocated regions in sysmem_overflow_check()
before bootm. This makes alloc policy more easier.
Change-Id: I533c710a6e69bd930befda441b9ec64415e3f408
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Check if the region is overlap with reserved regions.
Change-Id: Ifd9b6a4438dcf954b7e48930e31d0c6cd5d1274c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
1.dev_desc->if_type == IF_TYPE_MMC for SD and eMMC device,
dev_desc->devnum == 1 is SD devices,
dev_desc->devnum == 0 is eMMC devices
2.SD devices do not have rpmb
3.we prefer to use rpmb for eMMC devices, use security
partition for nand or SD devices
Change-Id: Ifc21bd4da7c3ee91e2ecc845c343182c78d52dc1
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
The avb process have verify next level firmware to ensure its
availability. So there is no need to support lastboot in avb
process.
Change-Id: I1623a2bd93c54802ce0067cad7061ade6cc56313
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Since we need to realize standard library function other than use them
with gcc tool chain in U-Boot. So add standard library function here.
Change-Id: I10009c5bbe31fabacd929df3c44218ae9c6a885f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
If alloc buffer for storage read/write should be aligned to
cacheline size, please add the M_ATTR_CACHELINE_ALIGN flag
for this region.
Change-Id: I1e5d46405ddacfadd1cdb4670f943996d9b66426
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Modify the opensource nandc driver to compatible with
the NAND driver include FTL,which used udevice_id
"rockchip,rk-nandc".
Change-Id: I67b9beb43b9935f88c98802f6df3507248324a12
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
- handle the case: the input base is 0;
- ignore the head region which can't visible for M_ATTR_PEEK;
Change-Id: I2c3609b9457a5e2e429e849228301bfee0e4c9b0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Using malloc buffer to load image makes CONFIG_SYS_MALLOC_LEN must be
large enough, sysmem alloc is a better way.
Change-Id: I24e2b86c53b8d3307c0d155fc37cb499c321e1c6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Because avb android image usually needs a large memory buffer,
always alloc avb android memblk right after U-Boot stack is a
better choice to avoid memblk overlap with others.
Since we have overflow protect magic for U-Boot stack, so we add
a pad(4KB) between them.
Change-Id: I72655d022f7e82f1ed9fbb381424d04bc86ccf6a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
- If the region is out of avaiable dram bank, return success;
- region can override allocated memblk with attr M_ATTR_OVERLAP;
Change-Id: I02171cdb51462e9cec3dd955ae3e0aaaa0ee7afd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
file not exist if ret < 0, file exist if ret >=0
Change-Id: I1a70b0a41773f03d552c5f6cda82b745d6e81421
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
Some platform provides more than one dram banks and reserved firmware
regions (eg. ATF, OP-TEE, etc) by pre-loader dynamically. It means
there are memory holes in board dram layout. What's more, U-Boot will
reserved regions at the late bootflow(eg. firmware reserved for AMP).
So we introduce bidram mechanism to manage GD board bi_dram[], which
provides a way to easily manage memory holes and update bi_dram[]. It
dpends on LMB which provides a good algorithm to manage memory blocks.
What's different from sysmem?
- bidram manage and pass the avaliable memory blocks to kernel;
- sysmem is only for U-Boot memory management to avoid ram overlap,
it doesn't matter about kernel avaliable memory.
Change-Id: I697cbb80bdc961e4ad5ab94548e2dc93feefde6f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
- import memblk id to manage memory blocks;
- change "sysmem_property" to generic "memblock";
- use alloc instead of reserve for all memory blocks;
- clean up and fix some logic;
- add U-Boot cmd for sysmem;
Change-Id: I614223ce3bf97a7b3566412a9d1864fb30b68fd8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
With 8 bytes addressing even on 32 bit machines these checks
are no longer valid. Remove them.
Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit f51f6715a5013f37620c38f0430e21d4736e235a)
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I07d143dbd4dfeff1ce99d081d1279c4f70fa4e8f
Since we use the pre-loader public key to verify permanent attribute, then
we do not need to write permanent attribute hash to otp & efuse.
Change-Id: Ic5e19fed2fc9405ab5bc7504dd930fd5f02d847c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>