Skip to content

Commit

Permalink
mmc: add TS7800 FPGA based MMC controller driver
Browse files Browse the repository at this point in the history
add standard mmc/host controller driver for TS-7800v1, instead of the original
block based 'tssdcore' driver provided by EmbeddedTS linux-2.6.x code base.

$ cat /proc/cpuinfo
processor	: 0
model name	: Feroceon rev 0 (v5l)
BogoMIPS	: 333.33
Features	: swp half thumb fastmult edsp
CPU implementer	: 0x41
CPU architecture: 5TEJ
CPU variant	: 0x0
CPU part	: 0x926
CPU revision	: 0

Hardware	: Technologic Systems TS-78xx SBC
Revision	: 0000
Serial		: 0000000000000000
$

$ uname -a
Linux ts-7800 5.10.107 torvalds#186 PREEMPT Fri Oct 7 13:02:05 EDT 2022 armv5tel GNU/Linux
$

$ insmod /tmp/ts7800v1_sdmmc.ko
ts7800v1_sdmmc ts7800v1_sdmmc: Detected SDCoreV2
ts7800v1_sdmmc ts7800v1_sdmmc: TS-7800v1 FPGA based SD/MMC Controller initialized
 mmc0: new high speed SDHC card at address aaaa
mmcblk0: mmc0:aaaa SS32G 29.7 GiB
 mmcblk0: p1 p2 p3

$

$ fdisk -lu
Disk /dev/mmcblk0: 30 GB, 31914983424 bytes, 62333952 sectors
973968 cylinders, 4 heads, 16 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device       Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/mmcblk0p1    0,0,2       8,40,33              1     131072     131072 64.0M da Unknown
/dev/mmcblk0p2    8,40,34     8,137,33        131073     137183       6111 3055K da Unknown
/dev/mmcblk0p3    8,137,34    73,206,37       137184    1185759    1048576  512M 83 Linux
$

$ mount -o sync /dev/mmcblk0p3 /mnt/
EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
$

$ mount
rootfs on / type rootfs (rw,size=56156k,nr_inodes=14039)
proc on /proc type proc (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=666)
tmpfs on /dev/shm type tmpfs (rw,relatime,size=13312k,mode=777)
tmpfs on /tmp type tmpfs (rw,relatime,size=102400k)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,size=13312k,mode=755)
sysfs on /sys type sysfs (rw,relatime)
nodev on /sys/kernel/debug type debugfs (rw,relatime)
/dev/mmcblk0p3 on /mnt type ext4 (rw,sync,relatime)
$

$ ls -lsrt /mnt/
total 28
    16 drwx------    2 root     root         16384 Oct  7 15:50 lost+found
    12 -rw-r--r--    1 root     root         10873 Oct  7 15:54 services
$

$ time cp /lib/libc.so.6 /mnt/
real	0m 0.75s
user	0m 0.00s
sys	0m 0.08s
$

$ ls -lsrt /mnt/
total 1448
    16 drwx------    2 root     root         16384 Oct  7 15:50 lost+found
    12 -rw-r--r--    1 root     root         10873 Oct  7 15:54 services
  1420 -rwxr-xr-x    1 root     root       1450164 Oct 12 15:18 libc.so.6
$

$ sha512sum /lib/libc.so.6 /mnt/libc.so.6
6d51a81eb1a7f898d6099efe0ccd547e18ba29732bc38324148f79261d9c30c78e96ea1de5f421c5b9a2655dd1c4b25ad8775c2c942823dd2adff624d8016566  /lib/libc.so.6
6d51a81eb1a7f898d6099efe0ccd547e18ba29732bc38324148f79261d9c30c78e96ea1de5f421c5b9a2655dd1c4b25ad8775c2c942823dd2adff624d8016566  /mnt/libc.so.6
$

$ sync
$ umount /mnt/

Signed-off-by: Firas Ashkar <[email protected]>
  • Loading branch information
Firas Ashkar authored and intel-lab-lkp committed Oct 13, 2022
1 parent a185a09 commit 8235990
Show file tree
Hide file tree
Showing 3 changed files with 2,350 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/mmc/host/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,16 @@ config MMC_TMIO
This provides support for the SD/MMC cell found in TC6393XB,
T7L66XB and also HTC ASIC3

config MMC_TS7800
tristate "EmbeddedTS 7800v1 FPGA based MMC Controller"
depends on MACH_TS78XX
help
This provides support for EmbeddedTS MMC core on TS-7800-V1 platform,
only standard MMC SLOT1 is supported.

To compile this driver as a module, choose M here: the
module will be called ts7800v1_sdmmc.

config MMC_SDHI
tristate "Renesas SDHI SD/SDIO controller support"
depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
Expand Down
1 change: 1 addition & 0 deletions drivers/mmc/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ obj-$(CONFIG_MMC_S3C) += s3cmci.o
obj-$(CONFIG_MMC_SDRICOH_CS) += sdricoh_cs.o
obj-$(CONFIG_MMC_TMIO) += tmio_mmc.o
obj-$(CONFIG_MMC_TMIO_CORE) += tmio_mmc_core.o
obj-$(CONFIG_MMC_TS7800) += ts7800v1_sdmmc.o
obj-$(CONFIG_MMC_SDHI) += renesas_sdhi_core.o
obj-$(CONFIG_MMC_SDHI_SYS_DMAC) += renesas_sdhi_sys_dmac.o
obj-$(CONFIG_MMC_SDHI_INTERNAL_DMAC) += renesas_sdhi_internal_dmac.o
Expand Down
Loading

0 comments on commit 8235990

Please sign in to comment.