bd82x6x: Add beep commands
Move beep commands to board-specific area as they need to be different for different codecs. Change-Id: I2a1ac938c49827cc816a95df10793a7e234942bf Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: http://review.coreboot.org/1410 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
parent
c02cadaee1
commit
b98d07813d
|
@ -69,3 +69,13 @@ static const u32 mainboard_cim_verb_data[] = {
|
|||
0x00a71e45,
|
||||
0x00a71f43
|
||||
};
|
||||
|
||||
static const u32 mainboard_pc_beep_verbs[] = {
|
||||
0x00170500, /* power up codec */
|
||||
0x00270500, /* power up DAC */
|
||||
0x00670500, /* power up speaker */
|
||||
0x00670740, /* enable speaker output */
|
||||
0x0023B04B, /* set DAC gain */
|
||||
};
|
||||
static const u32 mainboard_pc_beep_verbs_size =
|
||||
sizeof(mainboard_pc_beep_verbs) / sizeof(mainboard_pc_beep_verbs[0]);
|
||||
|
|
|
@ -253,11 +253,15 @@ static void int15_install(void)
|
|||
|
||||
extern const u32 * cim_verb_data;
|
||||
extern u32 cim_verb_data_size;
|
||||
extern const u32 * pc_beep_verbs;
|
||||
extern u32 pc_beep_verbs_size;
|
||||
|
||||
static void verb_setup(void)
|
||||
{
|
||||
cim_verb_data = mainboard_cim_verb_data;
|
||||
cim_verb_data_size = sizeof(mainboard_cim_verb_data);
|
||||
pc_beep_verbs = mainboard_pc_beep_verbs;
|
||||
pc_beep_verbs_size = mainboard_pc_beep_verbs_size;
|
||||
}
|
||||
|
||||
static void mainboard_init(device_t dev)
|
||||
|
|
|
@ -97,3 +97,12 @@ static const u32 mainboard_cim_verb_data[] = {
|
|||
0x30771f18
|
||||
};
|
||||
|
||||
static const u32 mainboard_pc_beep_verbs[] = {
|
||||
0x00170500, /* power up codec */
|
||||
0x00270500, /* power up DAC */
|
||||
0x00670500, /* power up speaker */
|
||||
0x00670740, /* enable speaker output */
|
||||
0x0023B04B, /* set DAC gain */
|
||||
};
|
||||
static const u32 mainboard_pc_beep_verbs_size =
|
||||
sizeof(mainboard_pc_beep_verbs) / sizeof(mainboard_pc_beep_verbs[0]);
|
||||
|
|
|
@ -223,11 +223,15 @@ static void int15_install(void)
|
|||
|
||||
extern const u32 * cim_verb_data;
|
||||
extern u32 cim_verb_data_size;
|
||||
extern const u32 * pc_beep_verbs;
|
||||
extern u32 pc_beep_verbs_size;
|
||||
|
||||
static void verb_setup(void)
|
||||
{
|
||||
cim_verb_data = mainboard_cim_verb_data;
|
||||
cim_verb_data_size = sizeof(mainboard_cim_verb_data);
|
||||
pc_beep_verbs = mainboard_pc_beep_verbs;
|
||||
pc_beep_verbs_size = mainboard_pc_beep_verbs_size;
|
||||
}
|
||||
|
||||
// mainboard_enable is executed as first thing after
|
||||
|
|
|
@ -92,6 +92,8 @@ no_codec:
|
|||
|
||||
const u32 * cim_verb_data = NULL;
|
||||
u32 cim_verb_data_size = 0;
|
||||
const u32 * pc_beep_verbs = NULL;
|
||||
u32 pc_beep_verbs_size = 0;
|
||||
|
||||
static u32 find_verb(struct device *dev, u32 viddid, const u32 ** verb)
|
||||
{
|
||||
|
@ -218,6 +220,16 @@ static void codecs_init(struct device *dev, u32 base, u32 codec_mask)
|
|||
if (codec_mask & (1 << i))
|
||||
codec_init(dev, base, i);
|
||||
}
|
||||
|
||||
for (i = 0; i < pc_beep_verbs_size; i++) {
|
||||
if (wait_for_ready(base) == -1)
|
||||
return;
|
||||
|
||||
write32(base + 0x60, pc_beep_verbs[i]);
|
||||
|
||||
if (wait_for_valid(base) == -1)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void azalia_init(struct device *dev)
|
||||
|
|
Loading…
Reference in New Issue