Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
8b449d1f
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
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看板
提交
8b449d1f
编写于
8月 09, 2010
作者:
B
Benjamin Herrenschmidt
浏览文件
操作
浏览文件
下载
差异文件
Merge remote branch 'gcl/next' into next
上级
2ed9aae0
ee110066
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
128 addition
and
4 deletion
+128
-4
arch/powerpc/include/asm/mpc52xx.h
arch/powerpc/include/asm/mpc52xx.h
+1
-0
arch/powerpc/include/asm/mpc52xx_psc.h
arch/powerpc/include/asm/mpc52xx_psc.h
+1
-0
arch/powerpc/kernel/setup-common.c
arch/powerpc/kernel/setup-common.c
+2
-0
arch/powerpc/platforms/52xx/mpc52xx_common.c
arch/powerpc/platforms/52xx/mpc52xx_common.c
+106
-0
sound/soc/fsl/mpc5200_psc_ac97.c
sound/soc/fsl/mpc5200_psc_ac97.c
+18
-4
未找到文件。
arch/powerpc/include/asm/mpc52xx.h
浏览文件 @
8b449d1f
...
@@ -271,6 +271,7 @@ struct mpc52xx_intr {
...
@@ -271,6 +271,7 @@ struct mpc52xx_intr {
/* mpc52xx_common.c */
/* mpc52xx_common.c */
extern
void
mpc5200_setup_xlb_arbiter
(
void
);
extern
void
mpc5200_setup_xlb_arbiter
(
void
);
extern
void
mpc52xx_declare_of_platform_devices
(
void
);
extern
void
mpc52xx_declare_of_platform_devices
(
void
);
extern
int
mpc5200_psc_ac97_gpio_reset
(
int
psc_number
);
extern
void
mpc52xx_map_common_devices
(
void
);
extern
void
mpc52xx_map_common_devices
(
void
);
extern
int
mpc52xx_set_psc_clkdiv
(
int
psc_id
,
int
clkdiv
);
extern
int
mpc52xx_set_psc_clkdiv
(
int
psc_id
,
int
clkdiv
);
extern
unsigned
int
mpc52xx_get_xtal_freq
(
struct
device_node
*
node
);
extern
unsigned
int
mpc52xx_get_xtal_freq
(
struct
device_node
*
node
);
...
...
arch/powerpc/include/asm/mpc52xx_psc.h
浏览文件 @
8b449d1f
...
@@ -131,6 +131,7 @@
...
@@ -131,6 +131,7 @@
#define MPC52xx_PSC_SICR_SIM_FIR (0x6 << 24)
#define MPC52xx_PSC_SICR_SIM_FIR (0x6 << 24)
#define MPC52xx_PSC_SICR_SIM_CODEC_24 (0x7 << 24)
#define MPC52xx_PSC_SICR_SIM_CODEC_24 (0x7 << 24)
#define MPC52xx_PSC_SICR_SIM_CODEC_32 (0xf << 24)
#define MPC52xx_PSC_SICR_SIM_CODEC_32 (0xf << 24)
#define MPC52xx_PSC_SICR_ACRB (0x8 << 24)
#define MPC52xx_PSC_SICR_AWR (1 << 30)
#define MPC52xx_PSC_SICR_AWR (1 << 30)
#define MPC52xx_PSC_SICR_GENCLK (1 << 23)
#define MPC52xx_PSC_SICR_GENCLK (1 << 23)
#define MPC52xx_PSC_SICR_I2S (1 << 22)
#define MPC52xx_PSC_SICR_I2S (1 << 22)
...
...
arch/powerpc/kernel/setup-common.c
浏览文件 @
8b449d1f
...
@@ -96,7 +96,9 @@ struct screen_info screen_info = {
...
@@ -96,7 +96,9 @@ struct screen_info screen_info = {
/* Variables required to store legacy IO irq routing */
/* Variables required to store legacy IO irq routing */
int
of_i8042_kbd_irq
;
int
of_i8042_kbd_irq
;
EXPORT_SYMBOL_GPL
(
of_i8042_kbd_irq
);
int
of_i8042_aux_irq
;
int
of_i8042_aux_irq
;
EXPORT_SYMBOL_GPL
(
of_i8042_aux_irq
);
#ifdef __DO_IRQ_CANON
#ifdef __DO_IRQ_CANON
/* XXX should go elsewhere eventually */
/* XXX should go elsewhere eventually */
...
...
arch/powerpc/platforms/52xx/mpc52xx_common.c
浏览文件 @
8b449d1f
...
@@ -12,9 +12,11 @@
...
@@ -12,9 +12,11 @@
#undef DEBUG
#undef DEBUG
#include <linux/gpio.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/spinlock.h>
#include <linux/of_platform.h>
#include <linux/of_platform.h>
#include <linux/of_gpio.h>
#include <asm/io.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/prom.h>
#include <asm/mpc52xx.h>
#include <asm/mpc52xx.h>
...
@@ -82,6 +84,14 @@ mpc5200_setup_xlb_arbiter(void)
...
@@ -82,6 +84,14 @@ mpc5200_setup_xlb_arbiter(void)
iounmap
(
xlb
);
iounmap
(
xlb
);
}
}
/*
* This variable is mapped in mpc52xx_map_common_devices and
* used in mpc5200_psc_ac97_gpio_reset().
*/
static
DEFINE_SPINLOCK
(
gpio_lock
);
struct
mpc52xx_gpio
__iomem
*
simple_gpio
;
struct
mpc52xx_gpio_wkup
__iomem
*
wkup_gpio
;
/**
/**
* mpc52xx_declare_of_platform_devices: register internal devices and children
* mpc52xx_declare_of_platform_devices: register internal devices and children
* of the localplus bus to the of_platform
* of the localplus bus to the of_platform
...
@@ -109,6 +119,15 @@ static struct of_device_id mpc52xx_cdm_ids[] __initdata = {
...
@@ -109,6 +119,15 @@ static struct of_device_id mpc52xx_cdm_ids[] __initdata = {
{
.
compatible
=
"mpc5200-cdm"
,
},
/* old */
{
.
compatible
=
"mpc5200-cdm"
,
},
/* old */
{}
{}
};
};
static
const
struct
of_device_id
mpc52xx_gpio_simple
[]
=
{
{
.
compatible
=
"fsl,mpc5200-gpio"
,
},
{}
};
static
const
struct
of_device_id
mpc52xx_gpio_wkup
[]
=
{
{
.
compatible
=
"fsl,mpc5200-gpio-wkup"
,
},
{}
};
/**
/**
* mpc52xx_map_common_devices: iomap devices required by common code
* mpc52xx_map_common_devices: iomap devices required by common code
...
@@ -135,6 +154,16 @@ mpc52xx_map_common_devices(void)
...
@@ -135,6 +154,16 @@ mpc52xx_map_common_devices(void)
np
=
of_find_matching_node
(
NULL
,
mpc52xx_cdm_ids
);
np
=
of_find_matching_node
(
NULL
,
mpc52xx_cdm_ids
);
mpc52xx_cdm
=
of_iomap
(
np
,
0
);
mpc52xx_cdm
=
of_iomap
(
np
,
0
);
of_node_put
(
np
);
of_node_put
(
np
);
/* simple_gpio registers */
np
=
of_find_matching_node
(
NULL
,
mpc52xx_gpio_simple
);
simple_gpio
=
of_iomap
(
np
,
0
);
of_node_put
(
np
);
/* wkup_gpio registers */
np
=
of_find_matching_node
(
NULL
,
mpc52xx_gpio_wkup
);
wkup_gpio
=
of_iomap
(
np
,
0
);
of_node_put
(
np
);
}
}
/**
/**
...
@@ -233,3 +262,80 @@ mpc52xx_restart(char *cmd)
...
@@ -233,3 +262,80 @@ mpc52xx_restart(char *cmd)
while
(
1
);
while
(
1
);
}
}
#define PSC1_RESET 0x1
#define PSC1_SYNC 0x4
#define PSC1_SDATA_OUT 0x1
#define PSC2_RESET 0x2
#define PSC2_SYNC (0x4<<4)
#define PSC2_SDATA_OUT (0x1<<4)
#define MPC52xx_GPIO_PSC1_MASK 0x7
#define MPC52xx_GPIO_PSC2_MASK (0x7<<4)
/**
* mpc5200_psc_ac97_gpio_reset: Use gpio pins to reset the ac97 bus
*
* @psc: psc number to reset (only psc 1 and 2 support ac97)
*/
int
mpc5200_psc_ac97_gpio_reset
(
int
psc_number
)
{
unsigned
long
flags
;
u32
gpio
;
u32
mux
;
int
out
;
int
reset
;
int
sync
;
if
((
!
simple_gpio
)
||
(
!
wkup_gpio
))
return
-
ENODEV
;
switch
(
psc_number
)
{
case
0
:
reset
=
PSC1_RESET
;
/* AC97_1_RES */
sync
=
PSC1_SYNC
;
/* AC97_1_SYNC */
out
=
PSC1_SDATA_OUT
;
/* AC97_1_SDATA_OUT */
gpio
=
MPC52xx_GPIO_PSC1_MASK
;
break
;
case
1
:
reset
=
PSC2_RESET
;
/* AC97_2_RES */
sync
=
PSC2_SYNC
;
/* AC97_2_SYNC */
out
=
PSC2_SDATA_OUT
;
/* AC97_2_SDATA_OUT */
gpio
=
MPC52xx_GPIO_PSC2_MASK
;
break
;
default:
pr_err
(
__FILE__
": Unable to determine PSC, no ac97 "
"cold-reset will be performed
\n
"
);
return
-
ENODEV
;
}
spin_lock_irqsave
(
&
gpio_lock
,
flags
);
/* Reconfiure pin-muxing to gpio */
mux
=
in_be32
(
&
simple_gpio
->
port_config
);
out_be32
(
&
simple_gpio
->
port_config
,
mux
&
(
~
gpio
));
/* enable gpio pins for output */
setbits8
(
&
wkup_gpio
->
wkup_gpioe
,
reset
);
setbits32
(
&
simple_gpio
->
simple_gpioe
,
sync
|
out
);
setbits8
(
&
wkup_gpio
->
wkup_ddr
,
reset
);
setbits32
(
&
simple_gpio
->
simple_ddr
,
sync
|
out
);
/* Assert cold reset */
clrbits32
(
&
simple_gpio
->
simple_dvo
,
sync
|
out
);
clrbits8
(
&
wkup_gpio
->
wkup_dvo
,
reset
);
/* wait at lease 1 us */
udelay
(
2
);
/* Deassert reset */
setbits8
(
&
wkup_gpio
->
wkup_dvo
,
reset
);
/* Restore pin-muxing */
out_be32
(
&
simple_gpio
->
port_config
,
mux
);
spin_unlock_irqrestore
(
&
gpio_lock
,
flags
);
return
0
;
}
EXPORT_SYMBOL
(
mpc5200_psc_ac97_gpio_reset
);
sound/soc/fsl/mpc5200_psc_ac97.c
浏览文件 @
8b449d1f
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <asm/time.h>
#include <asm/time.h>
#include <asm/delay.h>
#include <asm/delay.h>
#include <asm/mpc52xx.h>
#include <asm/mpc52xx_psc.h>
#include <asm/mpc52xx_psc.h>
#include "mpc5200_dma.h"
#include "mpc5200_dma.h"
...
@@ -100,19 +101,32 @@ static void psc_ac97_warm_reset(struct snd_ac97 *ac97)
...
@@ -100,19 +101,32 @@ static void psc_ac97_warm_reset(struct snd_ac97 *ac97)
{
{
struct
mpc52xx_psc
__iomem
*
regs
=
psc_dma
->
psc_regs
;
struct
mpc52xx_psc
__iomem
*
regs
=
psc_dma
->
psc_regs
;
mutex_lock
(
&
psc_dma
->
mutex
);
out_be32
(
&
regs
->
sicr
,
psc_dma
->
sicr
|
MPC52xx_PSC_SICR_AWR
);
out_be32
(
&
regs
->
sicr
,
psc_dma
->
sicr
|
MPC52xx_PSC_SICR_AWR
);
udelay
(
3
);
udelay
(
3
);
out_be32
(
&
regs
->
sicr
,
psc_dma
->
sicr
);
out_be32
(
&
regs
->
sicr
,
psc_dma
->
sicr
);
mutex_unlock
(
&
psc_dma
->
mutex
);
}
}
static
void
psc_ac97_cold_reset
(
struct
snd_ac97
*
ac97
)
static
void
psc_ac97_cold_reset
(
struct
snd_ac97
*
ac97
)
{
{
struct
mpc52xx_psc
__iomem
*
regs
=
psc_dma
->
psc_regs
;
struct
mpc52xx_psc
__iomem
*
regs
=
psc_dma
->
psc_regs
;
/* Do a cold reset */
mutex_lock
(
&
psc_dma
->
mutex
);
out_8
(
&
regs
->
op1
,
MPC52xx_PSC_OP_RES
);
dev_dbg
(
psc_dma
->
dev
,
"cold reset
\n
"
);
udelay
(
10
);
out_8
(
&
regs
->
op0
,
MPC52xx_PSC_OP_RES
);
mpc5200_psc_ac97_gpio_reset
(
psc_dma
->
id
);
/* Notify the PSC that a reset has occurred */
out_be32
(
&
regs
->
sicr
,
psc_dma
->
sicr
|
MPC52xx_PSC_SICR_ACRB
);
/* Re-enable RX and TX */
out_8
(
&
regs
->
command
,
MPC52xx_PSC_TX_ENABLE
|
MPC52xx_PSC_RX_ENABLE
);
mutex_unlock
(
&
psc_dma
->
mutex
);
msleep
(
1
);
msleep
(
1
);
psc_ac97_warm_reset
(
ac97
);
psc_ac97_warm_reset
(
ac97
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录