Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
612544fb
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
612544fb
编写于
4月 02, 2015
作者:
R
Ralf Baechle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MIPS: SEAD3: Combine all platform device registrations in one file.
Signed-off-by:
N
Ralf Baechle
<
ralf@linux-mips.org
>
上级
21c784b9
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
179 addition
and
251 deletion
+179
-251
arch/mips/mti-sead3/Makefile
arch/mips/mti-sead3/Makefile
+3
-4
arch/mips/mti-sead3/sead3-ehci.c
arch/mips/mti-sead3/sead3-ehci.c
+0
-49
arch/mips/mti-sead3/sead3-leds.c
arch/mips/mti-sead3/sead3-leds.c
+0
-89
arch/mips/mti-sead3/sead3-mtd.c
arch/mips/mti-sead3/sead3-mtd.c
+0
-53
arch/mips/mti-sead3/sead3-net.c
arch/mips/mti-sead3/sead3-net.c
+0
-53
arch/mips/mti-sead3/sead3-platform.c
arch/mips/mti-sead3/sead3-platform.c
+176
-3
未找到文件。
arch/mips/mti-sead3/Makefile
浏览文件 @
612544fb
...
@@ -8,12 +8,11 @@
...
@@ -8,12 +8,11 @@
# Copyright (C) 2012 MIPS Technoligies, Inc. All rights reserved.
# Copyright (C) 2012 MIPS Technoligies, Inc. All rights reserved.
# Steven J. Hill <sjhill@mips.com>
# Steven J. Hill <sjhill@mips.com>
#
#
obj-y
:=
sead3-lcd.o sead3-display.o sead3-ehci.o
\
obj-y
:=
sead3-lcd.o sead3-display.o sead3-init.o
\
sead3-init.o sead3-int.o sead3-mtd.o
\
sead3-int.o sead3-platform.o sead3-reset.o
\
sead3-net.o sead3-platform.o sead3-reset.o
\
sead3-setup.o sead3-time.o
sead3-setup.o sead3-time.o
obj-y
+=
leds-sead3.o
sead3-leds.o
obj-y
+=
leds-sead3.o
obj-$(CONFIG_EARLY_PRINTK)
+=
sead3-console.o
obj-$(CONFIG_EARLY_PRINTK)
+=
sead3-console.o
...
...
arch/mips/mti-sead3/sead3-ehci.c
已删除
100644 → 0
浏览文件 @
21c784b9
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
*/
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/irqchip/mips-gic.h>
#include <asm/mips-boards/sead3int.h>
static
struct
resource
ehci_resources
[]
=
{
{
.
start
=
0x1b200000
,
.
end
=
0x1b200fff
,
.
flags
=
IORESOURCE_MEM
},
{
.
flags
=
IORESOURCE_IRQ
}
};
static
u64
sead3_usbdev_dma_mask
=
DMA_BIT_MASK
(
32
);
static
struct
platform_device
ehci_device
=
{
.
name
=
"sead3-ehci"
,
.
id
=
0
,
.
dev
=
{
.
dma_mask
=
&
sead3_usbdev_dma_mask
,
.
coherent_dma_mask
=
DMA_BIT_MASK
(
32
)
},
.
num_resources
=
ARRAY_SIZE
(
ehci_resources
),
.
resource
=
ehci_resources
};
static
int
__init
ehci_init
(
void
)
{
if
(
gic_present
)
ehci_resources
[
1
].
start
=
MIPS_GIC_IRQ_BASE
+
GIC_INT_EHCI
;
else
ehci_resources
[
1
].
start
=
MIPS_CPU_IRQ_BASE
+
CPU_INT_EHCI
;
return
platform_device_register
(
&
ehci_device
);
}
device_initcall
(
ehci_init
);
arch/mips/mti-sead3/sead3-leds.c
已删除
100644 → 0
浏览文件 @
21c784b9
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
*/
#include <linux/init.h>
#include <linux/leds.h>
#include <linux/platform_device.h>
#define LEDFLAGS(bits, shift) \
((bits << 8) | (shift << 8))
#define LEDBITS(id, shift, bits) \
.name = id #shift, \
.flags = LEDFLAGS(bits, shift)
struct
led_info
led_data_info
[]
=
{
{
LEDBITS
(
"bit"
,
0
,
1
)
},
{
LEDBITS
(
"bit"
,
1
,
1
)
},
{
LEDBITS
(
"bit"
,
2
,
1
)
},
{
LEDBITS
(
"bit"
,
3
,
1
)
},
{
LEDBITS
(
"bit"
,
4
,
1
)
},
{
LEDBITS
(
"bit"
,
5
,
1
)
},
{
LEDBITS
(
"bit"
,
6
,
1
)
},
{
LEDBITS
(
"bit"
,
7
,
1
)
},
{
LEDBITS
(
"all"
,
0
,
8
)
},
};
static
struct
led_platform_data
led_data
=
{
.
num_leds
=
ARRAY_SIZE
(
led_data_info
),
.
leds
=
led_data_info
};
static
struct
resource
pled_resources
[]
=
{
{
.
start
=
0x1f000210
,
.
end
=
0x1f000217
,
.
flags
=
IORESOURCE_MEM
}
};
static
struct
platform_device
pled_device
=
{
.
name
=
"sead3::pled"
,
.
id
=
0
,
.
dev
=
{
.
platform_data
=
&
led_data
,
},
.
num_resources
=
ARRAY_SIZE
(
pled_resources
),
.
resource
=
pled_resources
};
static
struct
resource
fled_resources
[]
=
{
{
.
start
=
0x1f000218
,
.
end
=
0x1f00021f
,
.
flags
=
IORESOURCE_MEM
}
};
static
struct
platform_device
fled_device
=
{
.
name
=
"sead3::fled"
,
.
id
=
0
,
.
dev
=
{
.
platform_data
=
&
led_data
,
},
.
num_resources
=
ARRAY_SIZE
(
fled_resources
),
.
resource
=
fled_resources
};
static
struct
platform_device
sead3_led_device
=
{
.
name
=
"sead3-led"
,
.
id
=
-
1
,
};
struct
platform_device
*
sead3_led_devices
[]
=
{
&
pled_device
,
&
fled_device
,
&
sead3_led_device
,
};
static
int
__init
sead3_led_init
(
void
)
{
return
platform_add_devices
(
sead3_led_devices
,
ARRAY_SIZE
(
sead3_led_devices
));
}
device_initcall
(
sead3_led_init
);
arch/mips/mti-sead3/sead3-mtd.c
已删除
100644 → 0
浏览文件 @
21c784b9
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
*/
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/mtd/physmap.h>
static
struct
mtd_partition
sead3_mtd_partitions
[]
=
{
{
.
name
=
"User FS"
,
.
offset
=
0x00000000
,
.
size
=
0x01fc0000
,
},
{
.
name
=
"Board Config"
,
.
offset
=
0x01fc0000
,
.
size
=
0x00040000
,
.
mask_flags
=
MTD_WRITEABLE
},
};
static
struct
physmap_flash_data
sead3_flash_data
=
{
.
width
=
4
,
.
nr_parts
=
ARRAY_SIZE
(
sead3_mtd_partitions
),
.
parts
=
sead3_mtd_partitions
};
static
struct
resource
sead3_flash_resource
=
{
.
start
=
0x1c000000
,
.
end
=
0x1dffffff
,
.
flags
=
IORESOURCE_MEM
};
static
struct
platform_device
sead3_flash
=
{
.
name
=
"physmap-flash"
,
.
id
=
0
,
.
dev
=
{
.
platform_data
=
&
sead3_flash_data
,
},
.
num_resources
=
1
,
.
resource
=
&
sead3_flash_resource
,
};
static
int
__init
sead3_mtd_init
(
void
)
{
platform_device_register
(
&
sead3_flash
);
return
0
;
}
device_initcall
(
sead3_mtd_init
);
arch/mips/mti-sead3/sead3-net.c
已删除
100644 → 0
浏览文件 @
21c784b9
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
*/
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/irqchip/mips-gic.h>
#include <linux/platform_device.h>
#include <linux/smsc911x.h>
#include <asm/mips-boards/sead3int.h>
static
struct
smsc911x_platform_config
sead3_smsc911x_data
=
{
.
irq_polarity
=
SMSC911X_IRQ_POLARITY_ACTIVE_LOW
,
.
irq_type
=
SMSC911X_IRQ_TYPE_PUSH_PULL
,
.
flags
=
SMSC911X_USE_32BIT
|
SMSC911X_SAVE_MAC_ADDRESS
,
.
phy_interface
=
PHY_INTERFACE_MODE_MII
,
};
struct
resource
sead3_net_resources
[]
=
{
{
.
start
=
0x1f010000
,
.
end
=
0x1f01ffff
,
.
flags
=
IORESOURCE_MEM
},
{
.
flags
=
IORESOURCE_IRQ
}
};
static
struct
platform_device
sead3_net_device
=
{
.
name
=
"smsc911x"
,
.
id
=
0
,
.
dev
=
{
.
platform_data
=
&
sead3_smsc911x_data
,
},
.
num_resources
=
ARRAY_SIZE
(
sead3_net_resources
),
.
resource
=
sead3_net_resources
};
static
int
__init
sead3_net_init
(
void
)
{
if
(
gic_present
)
sead3_net_resources
[
1
].
start
=
MIPS_GIC_IRQ_BASE
+
GIC_INT_NET
;
else
sead3_net_resources
[
1
].
start
=
MIPS_CPU_IRQ_BASE
+
CPU_INT_NET
;
return
platform_device_register
(
&
sead3_net_device
);
}
device_initcall
(
sead3_net_init
);
arch/mips/mti-sead3/sead3-platform.c
浏览文件 @
612544fb
...
@@ -5,9 +5,15 @@
...
@@ -5,9 +5,15 @@
*
*
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
*/
*/
#include <linux/dma-mapping.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/irqchip/mips-gic.h>
#include <linux/irqchip/mips-gic.h>
#include <linux/leds.h>
#include <linux/mtd/physmap.h>
#include <linux/platform_device.h>
#include <linux/serial_8250.h>
#include <linux/serial_8250.h>
#include <linux/smsc911x.h>
#include <asm/mips-boards/sead3int.h>
#include <asm/mips-boards/sead3int.h>
...
@@ -35,16 +41,183 @@ static struct platform_device uart8250_device = {
...
@@ -35,16 +41,183 @@ static struct platform_device uart8250_device = {
},
},
};
};
static
int
__init
uart8250_init
(
void
)
static
struct
smsc911x_platform_config
sead3_smsc911x_data
=
{
.
irq_polarity
=
SMSC911X_IRQ_POLARITY_ACTIVE_LOW
,
.
irq_type
=
SMSC911X_IRQ_TYPE_PUSH_PULL
,
.
flags
=
SMSC911X_USE_32BIT
|
SMSC911X_SAVE_MAC_ADDRESS
,
.
phy_interface
=
PHY_INTERFACE_MODE_MII
,
};
static
struct
resource
sead3_net_resources
[]
=
{
{
.
start
=
0x1f010000
,
.
end
=
0x1f01ffff
,
.
flags
=
IORESOURCE_MEM
},
{
.
flags
=
IORESOURCE_IRQ
}
};
static
struct
platform_device
sead3_net_device
=
{
.
name
=
"smsc911x"
,
.
id
=
0
,
.
dev
=
{
.
platform_data
=
&
sead3_smsc911x_data
,
},
.
num_resources
=
ARRAY_SIZE
(
sead3_net_resources
),
.
resource
=
sead3_net_resources
};
static
struct
mtd_partition
sead3_mtd_partitions
[]
=
{
{
.
name
=
"User FS"
,
.
offset
=
0x00000000
,
.
size
=
0x01fc0000
,
},
{
.
name
=
"Board Config"
,
.
offset
=
0x01fc0000
,
.
size
=
0x00040000
,
.
mask_flags
=
MTD_WRITEABLE
},
};
static
struct
physmap_flash_data
sead3_flash_data
=
{
.
width
=
4
,
.
nr_parts
=
ARRAY_SIZE
(
sead3_mtd_partitions
),
.
parts
=
sead3_mtd_partitions
};
static
struct
resource
sead3_flash_resource
=
{
.
start
=
0x1c000000
,
.
end
=
0x1dffffff
,
.
flags
=
IORESOURCE_MEM
};
static
struct
platform_device
sead3_flash
=
{
.
name
=
"physmap-flash"
,
.
id
=
0
,
.
dev
=
{
.
platform_data
=
&
sead3_flash_data
,
},
.
num_resources
=
1
,
.
resource
=
&
sead3_flash_resource
,
};
#define LEDFLAGS(bits, shift) \
((bits << 8) | (shift << 8))
#define LEDBITS(id, shift, bits) \
.name = id #shift, \
.flags = LEDFLAGS(bits, shift)
static
struct
led_info
led_data_info
[]
=
{
{
LEDBITS
(
"bit"
,
0
,
1
)
},
{
LEDBITS
(
"bit"
,
1
,
1
)
},
{
LEDBITS
(
"bit"
,
2
,
1
)
},
{
LEDBITS
(
"bit"
,
3
,
1
)
},
{
LEDBITS
(
"bit"
,
4
,
1
)
},
{
LEDBITS
(
"bit"
,
5
,
1
)
},
{
LEDBITS
(
"bit"
,
6
,
1
)
},
{
LEDBITS
(
"bit"
,
7
,
1
)
},
{
LEDBITS
(
"all"
,
0
,
8
)
},
};
static
struct
led_platform_data
led_data
=
{
.
num_leds
=
ARRAY_SIZE
(
led_data_info
),
.
leds
=
led_data_info
};
static
struct
resource
pled_resources
[]
=
{
{
.
start
=
0x1f000210
,
.
end
=
0x1f000217
,
.
flags
=
IORESOURCE_MEM
}
};
static
struct
platform_device
pled_device
=
{
.
name
=
"sead3::pled"
,
.
id
=
0
,
.
dev
=
{
.
platform_data
=
&
led_data
,
},
.
num_resources
=
ARRAY_SIZE
(
pled_resources
),
.
resource
=
pled_resources
};
static
struct
resource
fled_resources
[]
=
{
{
.
start
=
0x1f000218
,
.
end
=
0x1f00021f
,
.
flags
=
IORESOURCE_MEM
}
};
static
struct
platform_device
fled_device
=
{
.
name
=
"sead3::fled"
,
.
id
=
0
,
.
dev
=
{
.
platform_data
=
&
led_data
,
},
.
num_resources
=
ARRAY_SIZE
(
fled_resources
),
.
resource
=
fled_resources
};
static
struct
platform_device
sead3_led_device
=
{
.
name
=
"sead3-led"
,
.
id
=
-
1
,
};
static
struct
resource
ehci_resources
[]
=
{
{
.
start
=
0x1b200000
,
.
end
=
0x1b200fff
,
.
flags
=
IORESOURCE_MEM
},
{
.
flags
=
IORESOURCE_IRQ
}
};
static
u64
sead3_usbdev_dma_mask
=
DMA_BIT_MASK
(
32
);
static
struct
platform_device
ehci_device
=
{
.
name
=
"sead3-ehci"
,
.
id
=
0
,
.
dev
=
{
.
dma_mask
=
&
sead3_usbdev_dma_mask
,
.
coherent_dma_mask
=
DMA_BIT_MASK
(
32
)
},
.
num_resources
=
ARRAY_SIZE
(
ehci_resources
),
.
resource
=
ehci_resources
};
static
struct
platform_device
*
sead3_platform_devices
[]
__initdata
=
{
&
uart8250_device
,
&
sead3_flash
,
&
pled_device
,
&
fled_device
,
&
sead3_led_device
,
&
ehci_device
,
&
sead3_net_device
,
};
static
int
__init
sead3_platforms_device_init
(
void
)
{
{
if
(
gic_present
)
{
if
(
gic_present
)
{
uart8250_data
[
0
].
irq
=
MIPS_GIC_IRQ_BASE
+
GIC_INT_UART0
;
uart8250_data
[
0
].
irq
=
MIPS_GIC_IRQ_BASE
+
GIC_INT_UART0
;
uart8250_data
[
1
].
irq
=
MIPS_GIC_IRQ_BASE
+
GIC_INT_UART1
;
uart8250_data
[
1
].
irq
=
MIPS_GIC_IRQ_BASE
+
GIC_INT_UART1
;
ehci_resources
[
1
].
start
=
MIPS_GIC_IRQ_BASE
+
GIC_INT_EHCI
;
sead3_net_resources
[
1
].
start
=
MIPS_GIC_IRQ_BASE
+
GIC_INT_NET
;
}
else
{
}
else
{
uart8250_data
[
0
].
irq
=
MIPS_CPU_IRQ_BASE
+
CPU_INT_UART0
;
uart8250_data
[
0
].
irq
=
MIPS_CPU_IRQ_BASE
+
CPU_INT_UART0
;
uart8250_data
[
1
].
irq
=
MIPS_CPU_IRQ_BASE
+
CPU_INT_UART1
;
uart8250_data
[
1
].
irq
=
MIPS_CPU_IRQ_BASE
+
CPU_INT_UART1
;
ehci_resources
[
1
].
start
=
MIPS_CPU_IRQ_BASE
+
CPU_INT_EHCI
;
sead3_net_resources
[
1
].
start
=
MIPS_CPU_IRQ_BASE
+
CPU_INT_NET
;
}
}
return
platform_device_register
(
&
uart8250_device
);
return
platform_add_devices
(
sead3_platform_devices
,
ARRAY_SIZE
(
sead3_platform_devices
));
}
}
device_initcall
(
uart8250
_init
);
device_initcall
(
sead3_platforms_device
_init
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录