diff options
author | Oleksij Rempel <o.rempel@pengutronix.de> | 2021-04-23 16:28:24 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-05-03 12:46:53 +0200 |
commit | 4fc0369b1a55cc5e3068a76e0917cb5d11e13d92 (patch) | |
tree | d024d9de1e4e8d1f602a58648327118299ddf673 /drivers/mci/atmel-mci-regs.h | |
parent | 7702961ce8dceed94f3efe401e39dc62ccac0e70 (diff) | |
download | barebox-4fc0369b1a55cc5e3068a76e0917cb5d11e13d92.tar.gz barebox-4fc0369b1a55cc5e3068a76e0917cb5d11e13d92.tar.xz |
mci: atmel_mci: add PBL support
Move most of the atmel_mci code to atmel_mci_common.c and introduce
atmel_mci_pbl.c for the PBL part.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.barebox.org/20210423142829.29468-2-o.rempel@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/atmel-mci-regs.h')
-rw-r--r-- | drivers/mci/atmel-mci-regs.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/mci/atmel-mci-regs.h b/drivers/mci/atmel-mci-regs.h index 676f419601..045c1a9f38 100644 --- a/drivers/mci/atmel-mci-regs.h +++ b/drivers/mci/atmel-mci-regs.h @@ -144,6 +144,37 @@ # define ATMCI_PDC_CONNECTED 1 #endif +struct atmel_mci_caps { + bool has_cfg_reg; + bool has_highspeed; + bool has_rwproof; + bool has_odd_clk_div; + bool need_reset_after_xfer; +}; + +struct atmel_mci { + struct mci_host mci; + void __iomem *regs; + struct device_d *hw_dev; + struct clk *clk; + + u32 datasize; + struct mci_cmd *cmd; + struct mci_data *data; + unsigned slot_b; + int version; + struct atmel_mci_caps caps; + + unsigned long bus_hz; + u32 mode_reg; + u32 cfg_reg; + u32 sdc_reg; + bool need_reset; + int detect_pin; +}; + +#define to_mci_host(mci) container_of(mci, struct atmel_mci, mci) + /* * Fix sconfig's burst size according to atmel MCI. We need to convert them as: * 1 -> 0, 4 -> 1, 8 -> 2, 16 -> 3. @@ -158,4 +189,10 @@ static inline unsigned int atmci_convert_chksize(unsigned int maxburst) return 0; } +void atmci_common_set_ios(struct atmel_mci *host, struct mci_ios *ios); +int atmci_reset(struct mci_host *mci, struct device_d *mci_dev); +int atmci_common_request(struct atmel_mci *host, struct mci_cmd *cmd, + struct mci_data *data); +void atmci_get_cap(struct atmel_mci *host); + #endif /* __DRIVERS_MMC_ATMEL_MCI_H__ */ |