RTEMS 7.0-rc1
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
smc.c File Reference

s3c2400 smc disk block device implementation More...

#include <rtems.h>
#include <rtems/libio.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <rtems/blkdev.h>
#include "smc.h"
#include <rtems/bspIo.h>
#include <s3c24xx.h>

Data Structures

struct  SMC_INFO
 

Macros

#define SMC_DEVICE_NAME   "/dev/smc"
 
#define SMC_SAMSUNG_ID   0xEC
 
#define SMC_TOSHIBA_ID   0x98
 
#define SMC_16MB   0x73
 
#define SMC_32MB   0x75
 
#define SMC_64MB   0x76
 
#define SMC_128MB   0x79
 
#define LBA_UNUSED   0x80000000
 
#define LBA_RESERVED   0x80000001
 
#define BLOCK_UNUSED   0x80000000
 
#define BLOCK_RESERVED   0x80000001
 
#define SEQ_DATA_INPUT_CMD   0x80
 
#define READ1_CMD   0x00
 
#define READ1_1_CMD   0x01
 
#define READ2_CMD   0x50
 
#define READ_ID_CMD   0x90
 
#define RESET_CMD   0xFF
 
#define PAGE_PROGRAM_CMD   0x10
 
#define BLOCK_ERASE_CMD   0x60
 
#define BLOCK_ERASE_CFM_CMD   0xD0
 
#define READ_STATUS_CMD   0x70
 
#define RESET_PTR_CMD   0x00
 
#define sm_busy()   while (!(rPDDAT & 0x200))
 
#define sm_chip_en()   rPDDAT &= (~0x80)
 
#define sm_chip_dis()   rPDDAT |= 0x80
 
#define sm_cle_en()   rPEDAT |= 0x20
 
#define sm_cle_dis()   rPEDAT &= (~0x20)
 
#define sm_ale_en()   rPEDAT |= 0x10
 
#define sm_ale_dis()   rPEDAT &= (~0x10)
 
#define sm_wp_en()   rPDDAT &= (~0x40)
 
#define sm_wp_dis()   rPDDAT |= 0x40
 
#define sm_read_en()   rPBCON &= 0xFFFF0000
 
#define sm_read_dis()   rPBCON = (rPBCON & 0xFFFF0000) | 0x5555
 
#define sm_write_en()   sm_read_dis()
 
#define sm_write_dis()   sm_read_en()
 

Functions

rtems_device_driver smc_initialize (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 smc_initialize SMC disk driver initialization entry point.
 

Variables

uint32_t smc_l2p [0x2000]
 
uint32_t smc_p2l [0x2000]
 

Detailed Description

s3c2400 smc disk block device implementation

Squidge's SMC Low-level access routines. Inspired and derived from routines provided by Samsung Electronics M/M R&D Center & FireFly.