Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
b589aece
Commit
b589aece
authored
Oct 14, 2009
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spectra: Add basic mtd support
Signed-off-by:
David Woodhouse
<
David.Woodhouse@intel.com
>
parent
44fa63fc
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
823 additions
and
0 deletions
+823
-0
drivers/block/spectra/Kconfig
drivers/block/spectra/Kconfig
+7
-0
drivers/block/spectra/Makefile
drivers/block/spectra/Makefile
+1
-0
drivers/block/spectra/lld.c
drivers/block/spectra/lld.c
+79
-0
drivers/block/spectra/lld_mtd.c
drivers/block/spectra/lld_mtd.c
+684
-0
drivers/block/spectra/lld_mtd.h
drivers/block/spectra/lld_mtd.h
+51
-0
drivers/block/spectra/spectraswconfig.h
drivers/block/spectra/spectraswconfig.h
+1
-0
No files found.
drivers/block/spectra/Kconfig
View file @
b589aece
...
...
@@ -18,6 +18,13 @@ config MRST_NAND_HW
Driver communicates with the actual hardware's register interface.
in DMA mode.
config MRST_NAND_MTD
bool "Linux MTD mode"
depends on MTD
help
Driver communicates with the kernel MTD subsystem instead of its own
built-in hardware driver.
config MRST_NAND_EMU
bool "RAM emulator testing"
help
...
...
drivers/block/spectra/Makefile
View file @
b589aece
...
...
@@ -7,4 +7,5 @@ spectra-y := ffsport.o flash.o lld.o
spectra-$(CONFIG_MRST_NAND_HW)
+=
lld_nand.o
spectra-$(CONFIG_MRST_NAND_HW_DMA)
+=
lld_cdma.o
spectra-$(CONFIG_MRST_NAND_EMU)
+=
lld_emu.o
spectra-$(CONFIG_MRST_NAND_MTD)
+=
lld_mtd.o
drivers/block/spectra/lld.c
View file @
b589aece
...
...
@@ -103,6 +103,85 @@ u16 GLOB_LLD_Get_Bad_Block(u32 block)
#endif
/* FLASH_EMU */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
#if FLASH_MTD
/* vector all the LLD calls to the LLD_MTD code */
#include "lld_mtd.h"
#include "lld_cdma.h"
/* common functions: */
u16
GLOB_LLD_Flash_Reset
(
void
)
{
return
mtd_Flash_Reset
();
}
u16
GLOB_LLD_Read_Device_ID
(
void
)
{
return
mtd_Read_Device_ID
();
}
int
GLOB_LLD_Flash_Release
(
void
)
{
return
mtd_Flash_Release
();
}
u16
GLOB_LLD_Flash_Init
(
void
)
{
return
mtd_Flash_Init
();
}
u16
GLOB_LLD_Erase_Block
(
u32
block_add
)
{
return
mtd_Erase_Block
(
block_add
);
}
u16
GLOB_LLD_Write_Page_Main
(
u8
*
write_data
,
u32
block
,
u16
Page
,
u16
PageCount
)
{
return
mtd_Write_Page_Main
(
write_data
,
block
,
Page
,
PageCount
);
}
u16
GLOB_LLD_Read_Page_Main
(
u8
*
read_data
,
u32
block
,
u16
Page
,
u16
PageCount
)
{
return
mtd_Read_Page_Main
(
read_data
,
block
,
Page
,
PageCount
);
}
u16
GLOB_LLD_Read_Page_Main_Polling
(
u8
*
read_data
,
u32
block
,
u16
page
,
u16
page_count
)
{
return
mtd_Read_Page_Main
(
read_data
,
block
,
page
,
page_count
);
}
u16
GLOB_LLD_Write_Page_Main_Spare
(
u8
*
write_data
,
u32
block
,
u16
Page
,
u16
PageCount
)
{
return
mtd_Write_Page_Main_Spare
(
write_data
,
block
,
Page
,
PageCount
);
}
u16
GLOB_LLD_Read_Page_Main_Spare
(
u8
*
read_data
,
u32
block
,
u16
Page
,
u16
PageCount
)
{
return
mtd_Read_Page_Main_Spare
(
read_data
,
block
,
Page
,
PageCount
);
}
u16
GLOB_LLD_Write_Page_Spare
(
u8
*
write_data
,
u32
block
,
u16
Page
,
u16
PageCount
)
{
return
mtd_Write_Page_Spare
(
write_data
,
block
,
Page
,
PageCount
);
}
u16
GLOB_LLD_Read_Page_Spare
(
u8
*
read_data
,
u32
block
,
u16
Page
,
u16
PageCount
)
{
return
mtd_Read_Page_Spare
(
read_data
,
block
,
Page
,
PageCount
);
}
u16
GLOB_LLD_Get_Bad_Block
(
u32
block
)
{
return
mtd_Get_Bad_Block
(
block
);
}
#endif
/* FLASH_MTD */
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
#if FLASH_NAND
/* vector all the LLD calls to the NAND controller code */
...
...
drivers/block/spectra/lld_mtd.c
0 → 100644
View file @
b589aece
This diff is collapsed.
Click to expand it.
drivers/block/spectra/lld_mtd.h
0 → 100644
View file @
b589aece
/*
* NAND Flash Controller Device Driver
* Copyright (c) 2009, Intel Corporation and its suppliers.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef _LLD_MTD_
#define _LLD_MTD_
#include "ffsport.h"
#include "ffsdefs.h"
/* prototypes: MTD API functions */
extern
u16
mtd_Flash_Reset
(
void
);
extern
u16
mtd_Flash_Init
(
void
);
extern
int
mtd_Flash_Release
(
void
);
extern
u16
mtd_Read_Device_ID
(
void
);
extern
u16
mtd_Erase_Block
(
u32
block_addr
);
extern
u16
mtd_Write_Page_Main
(
u8
*
write_data
,
u32
Block
,
u16
Page
,
u16
PageCount
);
extern
u16
mtd_Read_Page_Main
(
u8
*
read_data
,
u32
Block
,
u16
Page
,
u16
PageCount
);
extern
u16
mtd_Event_Status
(
void
);
extern
void
mtd_Enable_Disable_Interrupts
(
u16
INT_ENABLE
);
extern
u16
mtd_Write_Page_Main_Spare
(
u8
*
write_data
,
u32
Block
,
u16
Page
,
u16
PageCount
);
extern
u16
mtd_Write_Page_Spare
(
u8
*
write_data
,
u32
Block
,
u16
Page
,
u16
PageCount
);
extern
u16
mtd_Read_Page_Main_Spare
(
u8
*
read_data
,
u32
Block
,
u16
Page
,
u16
PageCount
);
extern
u16
mtd_Read_Page_Spare
(
u8
*
read_data
,
u32
Block
,
u16
Page
,
u16
PageCount
);
extern
u16
mtd_Get_Bad_Block
(
u32
block
);
u16
mtd_CDMA_Flash_Init
(
void
);
u16
mtd_CDMA_Execute_CMDs
(
u16
tag_count
);
u16
mtd_CDMA_Event_Status
(
void
);
#endif
/*_LLD_MTD_*/
drivers/block/spectra/spectraswconfig.h
View file @
b589aece
...
...
@@ -47,6 +47,7 @@
/***** Product Feature Support *****/
#define FLASH_EMU defined(CONFIG_MRST_NAND_EMU)
#define FLASH_NAND defined(CONFIG_MRST_NAND_HW)
#define FLASH_MTD defined(CONFIG_MRST_NAND_MTD)
#define CMD_DMA defined(CONFIG_MRST_NAND_HW_DMA)
#define SPECTRA_PARTITION_ID 0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment