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
73e4dbe4
Commit
73e4dbe4
authored
Jan 25, 2013
by
Rafał Miłecki
Committed by
John W. Linville
Jan 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcma: register platform device for parallel flash
Signed-off-by:
John W. Linville
<
linville@tuxdriver.com
>
parent
c7a4a9e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
5 deletions
+42
-5
drivers/bcma/bcma_private.h
drivers/bcma/bcma_private.h
+1
-0
drivers/bcma/driver_mips.c
drivers/bcma/driver_mips.c
+33
-5
drivers/bcma/main.c
drivers/bcma/main.c
+8
-0
No files found.
drivers/bcma/bcma_private.h
View file @
73e4dbe4
...
@@ -47,6 +47,7 @@ int bcma_sprom_get(struct bcma_bus *bus);
...
@@ -47,6 +47,7 @@ int bcma_sprom_get(struct bcma_bus *bus);
/* driver_chipcommon.c */
/* driver_chipcommon.c */
#ifdef CONFIG_BCMA_DRIVER_MIPS
#ifdef CONFIG_BCMA_DRIVER_MIPS
void
bcma_chipco_serial_init
(
struct
bcma_drv_cc
*
cc
);
void
bcma_chipco_serial_init
(
struct
bcma_drv_cc
*
cc
);
extern
struct
platform_device
bcma_pflash_dev
;
#endif
/* CONFIG_BCMA_DRIVER_MIPS */
#endif
/* CONFIG_BCMA_DRIVER_MIPS */
/* driver_chipcommon_pmu.c */
/* driver_chipcommon_pmu.c */
...
...
drivers/bcma/driver_mips.c
View file @
73e4dbe4
...
@@ -14,11 +14,33 @@
...
@@ -14,11 +14,33 @@
#include <linux/bcma/bcma.h>
#include <linux/bcma/bcma.h>
#include <linux/mtd/physmap.h>
#include <linux/platform_device.h>
#include <linux/serial.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/serial_core.h>
#include <linux/serial_reg.h>
#include <linux/serial_reg.h>
#include <linux/time.h>
#include <linux/time.h>
static
const
char
*
part_probes
[]
=
{
"bcm47xxpart"
,
NULL
};
static
struct
physmap_flash_data
bcma_pflash_data
=
{
.
part_probe_types
=
part_probes
,
};
static
struct
resource
bcma_pflash_resource
=
{
.
name
=
"bcma_pflash"
,
.
flags
=
IORESOURCE_MEM
,
};
struct
platform_device
bcma_pflash_dev
=
{
.
name
=
"physmap-flash"
,
.
dev
=
{
.
platform_data
=
&
bcma_pflash_data
,
},
.
resource
=
&
bcma_pflash_resource
,
.
num_resources
=
1
,
};
/* The 47162a0 hangs when reading MIPS DMP registers registers */
/* The 47162a0 hangs when reading MIPS DMP registers registers */
static
inline
bool
bcma_core_mips_bcm47162a0_quirk
(
struct
bcma_device
*
dev
)
static
inline
bool
bcma_core_mips_bcm47162a0_quirk
(
struct
bcma_device
*
dev
)
{
{
...
@@ -211,6 +233,7 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
...
@@ -211,6 +233,7 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
{
{
struct
bcma_bus
*
bus
=
mcore
->
core
->
bus
;
struct
bcma_bus
*
bus
=
mcore
->
core
->
bus
;
struct
bcma_drv_cc
*
cc
=
&
bus
->
drv_cc
;
struct
bcma_drv_cc
*
cc
=
&
bus
->
drv_cc
;
struct
bcma_pflash
*
pflash
=
&
cc
->
pflash
;
switch
(
cc
->
capabilities
&
BCMA_CC_CAP_FLASHT
)
{
switch
(
cc
->
capabilities
&
BCMA_CC_CAP_FLASHT
)
{
case
BCMA_CC_FLASHT_STSER
:
case
BCMA_CC_FLASHT_STSER
:
...
@@ -220,15 +243,20 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
...
@@ -220,15 +243,20 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
break
;
break
;
case
BCMA_CC_FLASHT_PARA
:
case
BCMA_CC_FLASHT_PARA
:
bcma_debug
(
bus
,
"Found parallel flash
\n
"
);
bcma_debug
(
bus
,
"Found parallel flash
\n
"
);
cc
->
pflash
.
present
=
true
;
pflash
->
present
=
true
;
cc
->
pflash
.
window
=
BCMA_SOC_FLASH2
;
pflash
->
window
=
BCMA_SOC_FLASH2
;
cc
->
pflash
.
window_size
=
BCMA_SOC_FLASH2_SZ
;
pflash
->
window_size
=
BCMA_SOC_FLASH2_SZ
;
if
((
bcma_read32
(
cc
->
core
,
BCMA_CC_FLASH_CFG
)
&
if
((
bcma_read32
(
cc
->
core
,
BCMA_CC_FLASH_CFG
)
&
BCMA_CC_FLASH_CFG_DS
)
==
0
)
BCMA_CC_FLASH_CFG_DS
)
==
0
)
cc
->
pflash
.
buswidth
=
1
;
pflash
->
buswidth
=
1
;
else
else
cc
->
pflash
.
buswidth
=
2
;
pflash
->
buswidth
=
2
;
bcma_pflash_data
.
width
=
pflash
->
buswidth
;
bcma_pflash_resource
.
start
=
pflash
->
window
;
bcma_pflash_resource
.
end
=
pflash
->
window
+
pflash
->
window_size
;
break
;
break
;
default:
default:
bcma_err
(
bus
,
"Flash type not supported
\n
"
);
bcma_err
(
bus
,
"Flash type not supported
\n
"
);
...
...
drivers/bcma/main.c
View file @
73e4dbe4
...
@@ -149,6 +149,14 @@ static int bcma_register_cores(struct bcma_bus *bus)
...
@@ -149,6 +149,14 @@ static int bcma_register_cores(struct bcma_bus *bus)
dev_id
++
;
dev_id
++
;
}
}
#ifdef CONFIG_BCMA_DRIVER_MIPS
if
(
bus
->
drv_cc
.
pflash
.
present
)
{
err
=
platform_device_register
(
&
bcma_pflash_dev
);
if
(
err
)
bcma_err
(
bus
,
"Error registering parallel flash
\n
"
);
}
#endif
#ifdef CONFIG_BCMA_SFLASH
#ifdef CONFIG_BCMA_SFLASH
if
(
bus
->
drv_cc
.
sflash
.
present
)
{
if
(
bus
->
drv_cc
.
sflash
.
present
)
{
err
=
platform_device_register
(
&
bcma_sflash_dev
);
err
=
platform_device_register
(
&
bcma_sflash_dev
);
...
...
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