#include #include struct uboot_cframe * uboot_map(uint32_t cframeaddr) { /* * Try to treat UBOOT_CFRAMESIZE bytes at cframeaddr as an u-boot * boot_params (configuration frame). U-Boot signs this region with crc32, * so we can determine if our probe is correct. * Return struct uboot_cframe * on success or NULL otherwise. */ struct uboot_cframe *ucfp; cframeaddr = BOOT_PARAMS; ucfp = cframeaddr; /* TODO: actually, check crc */ #if 0 if (crc32((uint8_t *)ucfp, UBOOT_CFRAMESIZE - 4) != ucfp->ucf_crc32) return (NULL); #endif printk("uboot_map: map @0x%x; memstart=%x; memsize=%x\n", cframeaddr, ucfp->ucf_memstart, ucfp->ucf_memsize); /* CRC ok, probe succeeded */ return (ucfp); }