Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/hw/sdcard.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/hw/sdcard.c b/src/hw/sdcard.c index 336314e..d5ea40c 100644 --- a/src/hw/sdcard.c +++ b/src/hw/sdcard.c @@ -408,6 +408,8 @@ sdcard_card_setup(struct sddrive_s *drive, int volt, int prio) ret = sdcard_pio(regs, SC_ALL_SEND_CID, param); if (ret) return ret; + u8 cid[16]; + memcpy(cid, param, sizeof(cid)); param[0] = drive->card_type & SF_MMC ? 0x0001 << 16 : 0x00; ret = sdcard_pio(regs, SC_SEND_RELATIVE_ADDR, param); if (ret) @@ -424,8 +426,14 @@ sdcard_card_setup(struct sddrive_s *drive, int volt, int prio) // Register drive drive->drive.blksize = DISK_SECTOR_SIZE; drive->drive.sectors = (u64)-1; // XXX - dprintf(1, "Found SD Card at %p\n", regs); - char *desc = znprintf(MAXDESCSIZE, "SD Card"); // XXX + char pnm[7] = {}; + int i; + for (i=0; i < (drive->card_type & SF_MMC ? 6 : 5); i++) + pnm[i] = cid[11-i]; + char *desc = znprintf(MAXDESCSIZE, "%s %s" + , drive->card_type & SF_MMC ? "MMC drive" : "SD card" + , pnm); + dprintf(1, "Found sdcard at %p: %s\n", regs, desc); boot_add_hd(&drive->drive, desc, prio); return 0; }