summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/sandisk/ata-c200_e200.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/firmware/target/arm/sandisk/ata-c200_e200.c b/firmware/target/arm/sandisk/ata-c200_e200.c
index 5a7577f08d..ef2bad387b 100644
--- a/firmware/target/arm/sandisk/ata-c200_e200.c
+++ b/firmware/target/arm/sandisk/ata-c200_e200.c
@@ -1149,17 +1149,17 @@ int ata_init(void)
1149{ 1149{
1150 int ret = 0; 1150 int ret = 0;
1151 1151
1152 if (!initialized)
1153 spinlock_init(&sd_spin IF_COP(, SPINLOCK_TASK_SWITCH));
1154
1155 spinlock_lock(&sd_spin);
1156
1152 ata_led(false); 1157 ata_led(false);
1153 1158
1154 /* NOTE: This init isn't dual core safe */
1155 if (!initialized) 1159 if (!initialized)
1156 { 1160 {
1157 initialized = true; 1161 initialized = true;
1158 1162
1159 spinlock_init(&sd_spin IF_COP(, SPINLOCK_TASK_SWITCH));
1160
1161 spinlock_lock(&sd_spin);
1162
1163 /* init controller */ 1163 /* init controller */
1164 outl(inl(0x70000088) & ~(0x4), 0x70000088); 1164 outl(inl(0x70000088) & ~(0x4), 0x70000088);
1165 outl(inl(0x7000008c) & ~(0x4), 0x7000008c); 1165 outl(inl(0x7000008c) & ~(0x4), 0x7000008c);
@@ -1213,9 +1213,10 @@ int ata_init(void)
1213 GPIOL_INT_EN |= 0x08; 1213 GPIOL_INT_EN |= 0x08;
1214#endif 1214#endif
1215#endif 1215#endif
1216 spinlock_unlock(&sd_spin);
1217 } 1216 }
1218 1217
1218 spinlock_unlock(&sd_spin);
1219
1219 return ret; 1220 return ret;
1220} 1221}
1221 1222