-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rockchip: Drop first 32kb of zeros from the rkSD image type
Instead of creating a rockchip SPL SD card image with 32KB of zeros which can be written to the start of an SD card, create the images with only the useful data that should be written to an offset of 32KB on the SD card. The first 32 kilobytes aren't needed for bootup and only serve as convenient way of accidentally obliterating your partition table. Signed-off-by: Sjoerd Simons <[email protected]> Acked-by: Simon Glass <[email protected]> Signed-off-by: Simon Glass <[email protected]>
- Loading branch information
1 parent
81b0618
commit dd39bca
Showing
2 changed files
with
3 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,7 @@ | |
#include "rkcommon.h" | ||
|
||
enum { | ||
RKSD_HEADER0_START = 64 * RK_BLK_SIZE, | ||
RKSD_SPL_HDR_START = RKSD_HEADER0_START + | ||
RK_CODE1_OFFSET * RK_BLK_SIZE, | ||
RKSD_SPL_HDR_START = RK_CODE1_OFFSET * RK_BLK_SIZE, | ||
RKSD_SPL_START = RKSD_SPL_HDR_START + 4, | ||
RKSD_HEADER_LEN = RKSD_SPL_START, | ||
}; | ||
|
@@ -44,11 +42,8 @@ static void rksd_set_header(void *buf, struct stat *sbuf, int ifd, | |
unsigned int size; | ||
int ret; | ||
|
||
/* Zero the whole header. The first 32KB is empty */ | ||
memset(buf, '\0', RKSD_HEADER0_START); | ||
|
||
size = params->file_size - RKSD_SPL_HDR_START; | ||
ret = rkcommon_set_header(buf + RKSD_HEADER0_START, size); | ||
ret = rkcommon_set_header(buf, size); | ||
if (ret) { | ||
/* TODO([email protected]): This method should return an error */ | ||
printf("Warning: SPL image is too large (size %#x) and will not boot\n", | ||
|