Compare commits

...

2 Commits

@ -4,10 +4,9 @@
uint32_t aml_calc_checksum_v1(aml_pt_partition_t *partitions, int count) {
uint32_t checksum = 0;
uint32_t *ptr;
for (int i = 0; i < count; i++) {
ptr = (uint32_t *)(partitions);
uint32_t *ptr = (uint32_t *)(partitions);
for (int j = sizeof(aml_pt_partition_t) / sizeof(uint32_t); j > 0; j--) {
//for (int j = 1; j < sizeof(aml_pt_partition_t) / sizeof(uint32_t); j++) {
checksum += *ptr;

@ -3,13 +3,15 @@
#include <stdint.h>
#define A_PACKED __attribute__((packed))
#define AML_MDT_MAGIC "AML_"
typedef struct {
char magic[4];
uint32_t version;
uint32_t count;
} aml_mdt_header_t;
} A_PACKED aml_mdt_header_t;
typedef struct {
char soc[16];
@ -17,7 +19,7 @@ typedef struct {
char variant[16];
uint32_t offset;
uint32_t unknown;
} aml_mdt_entry_t;
} A_PACKED aml_mdt_entry_t;
typedef struct {
@ -25,7 +27,7 @@ typedef struct {
char version[12];
uint32_t count;
uint32_t checksum;
} aml_pt_header_t;
} A_PACKED aml_pt_header_t;
typedef struct {
char name[16];
@ -33,6 +35,6 @@ typedef struct {
uint64_t start;
uint32_t flags;
uint8_t padding[4];
} aml_pt_partition_t;
} A_PACKED aml_pt_partition_t;
#endif /* end of include guard: AT_STRUCTURES_H */

@ -8,29 +8,29 @@
/* CONFIGURABLE SECTION */
/* aml_pt_partition_t partitions[] = {
{ .name = "bootloader", .size = 4 * SIZE_1M, .start = 0 * SIZE_1M, .flags = 0 },
{ .name = "reserved", .size = 64 * SIZE_1M, .start = 36 * SIZE_1M, .flags = 0 },
{ .name = "cache", .size = 512 * SIZE_1M, .start = 108 * SIZE_1M, .flags = 2 },
{ .name = "env", .size = 8 * SIZE_1M, .start = 628 * SIZE_1M, .flags = 0 },
{ .name = "logo", .size = 32 * SIZE_1M, .start = 644 * SIZE_1M, .flags = 1 },
{ .name = "recovery", .size = 32 * SIZE_1M, .start = 684 * SIZE_1M, .flags = 1 },
{ .name = "rsv", .size = 8 * SIZE_1M, .start = 724 * SIZE_1M, .flags = 1 },
{ .name = "tee", .size = 8 * SIZE_1M, .start = 740 * SIZE_1M, .flags = 1 },
{ .name = "crypt", .size = 32 * SIZE_1M, .start = 756 * SIZE_1M, .flags = 1 },
{ .name = "misc", .size = 32 * SIZE_1M, .start = 796 * SIZE_1M, .flags = 1 },
{ .name = "instaboot", .size = 512 * SIZE_1M, .start = 836 * SIZE_1M, .flags = 1 },
{ .name = "boot", .size = 32 * SIZE_1M, .start = 1356 * SIZE_1M, .flags = 1 },
{ .name = "system", .size = 1024 * SIZE_1M, .start = 1396 * SIZE_1M, .flags = 1 },
{ .name = "data", .size = 5028 * SIZE_1M, .start = 2428 * SIZE_1M, .flags = 4 },
{ .name = "bootloader", .start = 0 * SIZE_1M, .size = 4 * SIZE_1M, .flags = 0 },
{ .name = "reserved", .start = 36 * SIZE_1M, .size = 64 * SIZE_1M, .flags = 0 },
{ .name = "cache", .start = 108 * SIZE_1M, .size = 512 * SIZE_1M, .flags = 2 },
{ .name = "env", .start = 628 * SIZE_1M, .size = 8 * SIZE_1M, .flags = 0 },
{ .name = "logo", .start = 644 * SIZE_1M, .size = 32 * SIZE_1M, .flags = 1 },
{ .name = "recovery", .start = 684 * SIZE_1M, .size = 32 * SIZE_1M, .flags = 1 },
{ .name = "rsv", .start = 724 * SIZE_1M, .size = 8 * SIZE_1M, .flags = 1 },
{ .name = "tee", .start = 740 * SIZE_1M, .size = 8 * SIZE_1M, .flags = 1 },
{ .name = "crypt", .start = 756 * SIZE_1M, .size = 32 * SIZE_1M, .flags = 1 },
{ .name = "misc", .start = 796 * SIZE_1M, .size = 32 * SIZE_1M, .flags = 1 },
{ .name = "instaboot", .start = 836 * SIZE_1M, .size = 512 * SIZE_1M, .flags = 1 },
{ .name = "boot", .start = 1356 * SIZE_1M, .size = 32 * SIZE_1M, .flags = 1 },
{ .name = "system", .start = 1396 * SIZE_1M, .size = 1024 * SIZE_1M, .flags = 1 },
{ .name = "data", .start = 2428 * SIZE_1M, .size = 5028 * SIZE_1M, .flags = 4 },
}; */
aml_pt_partition_t partitions[] = {
{ .name = "bootloader", .size = 4 * SIZE_1M, .start = 0 * SIZE_1M, .flags = 0 },
{ .name = "reserved", .size = 64 * SIZE_1M, .start = 36 * SIZE_1M, .flags = 0 },
{ .name = "boot", .size = 512 * SIZE_1M, .start = 108 * SIZE_1M, .flags = 1 },
{ .name = "env", .size = 64 * SIZE_1K, .start = 628 * SIZE_1M, .flags = 0 },
{ .name = "logo", .size = 32 * SIZE_1M, .start = 644 * SIZE_1M, .flags = 1 },
{ .name = "system", .size = 6772 * SIZE_1M, .start = 684 * SIZE_1M, .flags = 1 },
{ .name = "bootloader", .start = 0 * SIZE_1M, .size = 4 * SIZE_1M, .flags = 0 },
{ .name = "reserved", .start = 36 * SIZE_1M, .size = 64 * SIZE_1M, .flags = 0 },
{ .name = "boot", .start = 108 * SIZE_1M, .size = 512 * SIZE_1M, .flags = 1 },
{ .name = "env", .start = 628 * SIZE_1M, .size = 64 * SIZE_1K, .flags = 0 },
{ .name = "logo", .start = 644 * SIZE_1M, .size = 32 * SIZE_1M, .flags = 1 },
{ .name = "system", .start = 684 * SIZE_1M, .size = 6772 * SIZE_1M, .flags = 1 },
};
/* END OF CONFIG */

Loading…
Cancel
Save