1.1 --- a/pkg/devices/lib/msc/include/msc-common.h Thu Feb 15 23:18:09 2024 +0100
1.2 +++ b/pkg/devices/lib/msc/include/msc-common.h Fri Feb 16 00:55:51 2024 +0100
1.3 @@ -27,13 +27,7 @@
1.4
1.5
1.6
1.7 -#ifdef __cplusplus
1.8 -
1.9 -#include <l4/devices/hw_mmio_register_block.h>
1.10 -
1.11 -
1.12 -
1.13 -// MMC/SD structures.
1.14 +/* MMC/SD structures. */
1.15
1.16 struct CID
1.17 {
1.18 @@ -61,6 +55,25 @@
1.19
1.20
1.21
1.22 +/* Generic card structure. */
1.23 +
1.24 +struct msc_card
1.25 +{
1.26 + uint16_t rca;
1.27 + uint32_t ocr;
1.28 + uint8_t bus_width;
1.29 + struct CID cid;
1.30 + struct CSD csd;
1.31 +};
1.32 +
1.33 +
1.34 +
1.35 +#ifdef __cplusplus
1.36 +
1.37 +#include <l4/devices/hw_mmio_register_block.h>
1.38 +
1.39 +
1.40 +
1.41 // MMC/SD controller channel.
1.42
1.43 class Msc_channel
1.44 @@ -70,13 +83,11 @@
1.45 Hw::Register_block<32> _regs;
1.46 l4_cap_idx_t _irq;
1.47
1.48 - // Support eight CID/CSD entries of 120 bits and RCA entries of 16 bits.
1.49 + // Support eight cards.
1.50
1.51 - struct CID _cid[8];
1.52 - struct CSD _csd[8];
1.53 - uint16_t _rca[8], _current_rca;
1.54 - uint8_t _bus_width[8], _current_bus_width;
1.55 - uint8_t _cards;
1.56 + struct msc_card _cards[8];
1.57 + uint8_t _num_cards;
1.58 + int _card;
1.59
1.60 // Utility methods.
1.61