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
nexedi
linux
Commits
9c37f332
Commit
9c37f332
authored
Oct 28, 2007
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MTD] [NAND] Check for RedBoot partitions on CAFÉ NAND
Signed-off-by:
David Woodhouse
<
dwmw2@infradead.org
>
parent
2a397e82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
drivers/mtd/nand/cafe_nand.c
drivers/mtd/nand/cafe_nand.c
+19
-0
No files found.
drivers/mtd/nand/cafe_nand.c
View file @
9c37f332
...
...
@@ -11,6 +11,7 @@
#undef DEBUG
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/rslib.h>
#include <linux/pci.h>
#include <linux/delay.h>
...
...
@@ -52,6 +53,7 @@
struct
cafe_priv
{
struct
nand_chip
nand
;
struct
mtd_partition
*
parts
;
struct
pci_dev
*
pdev
;
void
__iomem
*
mmio
;
struct
rs_control
*
rs
;
...
...
@@ -84,6 +86,10 @@ static unsigned int numtimings;
static
int
timing
[
3
];
module_param_array
(
timing
,
int
,
&
numtimings
,
0644
);
#ifdef CONFIG_MTD_PARTITIONS
static
const
char
*
part_probes
[]
=
{
"RedBoot"
,
NULL
};
#endif
/* Hrm. Why isn't this already conditional on something in the struct device? */
#define cafe_dev_dbg(dev, args...) do { if (debug) dev_dbg(dev, ##args); } while(0)
...
...
@@ -620,7 +626,9 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev,
{
struct
mtd_info
*
mtd
;
struct
cafe_priv
*
cafe
;
struct
mtd_partition
*
parts
;
uint32_t
ctrl
;
int
nr_parts
;
int
err
=
0
;
/* Very old versions shared the same PCI ident for all three
...
...
@@ -787,7 +795,18 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev,
goto
out_irq
;
pci_set_drvdata
(
pdev
,
mtd
);
/* We register the whole device first, separate from the partitions */
add_mtd_device
(
mtd
);
#ifdef CONFIG_MTD_PARTITIONS
nr_parts
=
parse_mtd_partitions
(
mtd
,
part_probes
,
&
parts
,
0
);
if
(
nr_parts
>
0
)
{
cafe
->
parts
=
parts
;
dev_info
(
&
cafe
->
pdev
->
dev
,
"%d RedBoot partitions found
\n
"
,
nr_parts
);
add_mtd_partitions
(
mtd
,
parts
,
nr_parts
);
}
#endif
goto
out
;
out_irq:
...
...
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