mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-17 05:43:59 +00:00
Don't clear the SYSCONFIG register on boot.
This follows section 18.4.2.2 SD Soft Reset Flow in the TI AM335x Technical Reference Manual and seems to fix the "ti_mmchs0: Error: current cmd NULL, already done?" messages.
This commit is contained in:
parent
94bc33c150
commit
522b93a92a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=252863
|
@ -1327,7 +1327,7 @@ ti_mmchs_hw_init(device_t dev)
|
|||
unsigned long timeout;
|
||||
uint32_t sysctl;
|
||||
uint32_t capa;
|
||||
uint32_t con;
|
||||
uint32_t con, sysconfig;
|
||||
|
||||
/* 1: Enable the controller and interface/functional clocks */
|
||||
clk = MMC0_CLK + sc->device_id;
|
||||
|
@ -1344,7 +1344,9 @@ ti_mmchs_hw_init(device_t dev)
|
|||
}
|
||||
|
||||
/* 2: Issue a softreset to the controller */
|
||||
ti_mmchs_write_4(sc, MMCHS_SYSCONFIG, 0x0002);
|
||||
sysconfig = ti_mmchs_read_4(sc, MMCHS_SYSCONFIG);
|
||||
sysconfig |= MMCHS_SYSCONFIG_SRST;
|
||||
ti_mmchs_write_4(sc, MMCHS_SYSCONFIG, sysconfig);
|
||||
timeout = 100;
|
||||
while ((ti_mmchs_read_4(sc, MMCHS_SYSSTATUS) & 0x01) == 0x0) {
|
||||
DELAY(1000);
|
||||
|
|
|
@ -67,6 +67,12 @@
|
|||
#define AM335X_MMCHS_REG_OFFSET 0x100
|
||||
|
||||
/* Register bit settings */
|
||||
#define MMCHS_SYSCONFIG_CLK_FUN (2 << 8)
|
||||
#define MMCHS_SYSCONFIG_CLK_IFC (1 << 8)
|
||||
#define MMCHS_SYSCONFIG_SIDL (2 << 3)
|
||||
#define MMCHS_SYSCONFIG_ENW (1 << 2)
|
||||
#define MMCHS_SYSCONFIG_SRST (1 << 1)
|
||||
#define MMCHS_SYSCONFIG_AIDL (1 << 0)
|
||||
#define MMCHS_STAT_BADA (1UL << 29)
|
||||
#define MMCHS_STAT_CERR (1UL << 28)
|
||||
#define MMCHS_STAT_ACE (1UL << 24)
|
||||
|
|
Loading…
Reference in a new issue