ti_mmchs.c (252863) | ti_mmchs.c (253023) |
---|---|
1/*- 2 * Copyright (c) 2011 3 * Ben Gray <ben.r.gray@gmail.com>. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 26 unchanged lines hidden (view full) --- 35 * 36 * This driver is still very much a work in progress, I've verified that basic 37 * sector reading can be performed. But I've yet to test it with a file system 38 * or even writing. In addition I've only tested the driver with an SD card, 39 * I've no idea if MMC cards work. 40 * 41 */ 42#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2011 3 * Ben Gray <ben.r.gray@gmail.com>. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 26 unchanged lines hidden (view full) --- 35 * 36 * This driver is still very much a work in progress, I've verified that basic 37 * sector reading can be performed. But I've yet to test it with a file system 38 * or even writing. In addition I've only tested the driver with an SD card, 39 * I've no idea if MMC cards work. 40 * 41 */ 42#include <sys/cdefs.h> |
43__FBSDID("$FreeBSD: head/sys/arm/ti/ti_mmchs.c 252863 2013-07-06 04:18:34Z rpaulo $"); | 43__FBSDID("$FreeBSD: head/sys/arm/ti/ti_mmchs.c 253023 2013-07-08 04:27:03Z gonzo $"); |
44 45#include <sys/param.h> 46#include <sys/systm.h> 47#include <sys/bio.h> 48#include <sys/bus.h> 49#include <sys/conf.h> 50#include <sys/endian.h> 51#include <sys/kernel.h> --- 156 unchanged lines hidden (view full) --- 208 unsigned long attempts; 209 uint32_t sysctl; 210 211 ti_mmchs_dbg(sc, "reseting controller - bit 0x%08x\n", bit); 212 213 sysctl = ti_mmchs_read_4(sc, MMCHS_SYSCTL); 214 ti_mmchs_write_4(sc, MMCHS_SYSCTL, sysctl | bit); 215 | 44 45#include <sys/param.h> 46#include <sys/systm.h> 47#include <sys/bio.h> 48#include <sys/bus.h> 49#include <sys/conf.h> 50#include <sys/endian.h> 51#include <sys/kernel.h> --- 156 unchanged lines hidden (view full) --- 208 unsigned long attempts; 209 uint32_t sysctl; 210 211 ti_mmchs_dbg(sc, "reseting controller - bit 0x%08x\n", bit); 212 213 sysctl = ti_mmchs_read_4(sc, MMCHS_SYSCTL); 214 ti_mmchs_write_4(sc, MMCHS_SYSCTL, sysctl | bit); 215 |
216 if ((ti_chip() == CHIP_OMAP_4) && (ti_revision() > OMAP4430_REV_ES1_0)) { 217 /* OMAP4 ES2 and greater has an updated reset logic. 218 * Monitor a 0->1 transition first 219 */ | 216 217 /* 218 * AM335x and OMAP4 ES2 and greater has an updated reset logic. 219 * Monitor a 0->1 transition first 220 */ 221 if ((ti_chip() == CHIP_AM335X) || 222 ((ti_chip() == CHIP_OMAP_4) && (ti_revision() > OMAP4430_REV_ES1_0))) { |
220 attempts = 10000; 221 while (!(ti_mmchs_read_4(sc, MMCHS_SYSCTL) & bit) && (attempts-- > 0)) 222 continue; 223 } 224 225 attempts = 10000; 226 while ((ti_mmchs_read_4(sc, MMCHS_SYSCTL) & bit) && (attempts-- > 0)) 227 continue; --- 1613 unchanged lines hidden --- | 223 attempts = 10000; 224 while (!(ti_mmchs_read_4(sc, MMCHS_SYSCTL) & bit) && (attempts-- > 0)) 225 continue; 226 } 227 228 attempts = 10000; 229 while ((ti_mmchs_read_4(sc, MMCHS_SYSCTL) & bit) && (attempts-- > 0)) 230 continue; --- 1613 unchanged lines hidden --- |