All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps
@ 2019-02-26  9:52 Bin Meng
  2019-02-26  9:52 ` [U-Boot] [PATCH 2/4] x86: Add a dtsi file for the pc speaker Bin Meng
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Bin Meng @ 2019-02-26  9:52 UTC (permalink / raw)
  To: u-boot

The i8254 timer control IO port (0x43) should be setup correctly
by using PIT counter 2 to generate beeps, however in U-Boot other
codes like TSC driver utilizes PIT for TSC frequency calibration
and configures the counter 2 to a different mode that does not
beep. Fix this by always ensuring the PIT counter 2 is correctly
initialized so that the i8254 beeper driver works as expected.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 arch/x86/lib/i8254.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/lib/i8254.c b/arch/x86/lib/i8254.c
index d022795..0f97538 100644
--- a/arch/x86/lib/i8254.c
+++ b/arch/x86/lib/i8254.c
@@ -51,6 +51,10 @@ int i8254_enable_beep(uint frequency_hz)
 	if (!frequency_hz)
 		return -EINVAL;
 
+	/* make sure i8254 is setup correctly before generating beeps */
+	outb(PIT_CMD_CTR2 | PIT_CMD_BOTH | PIT_CMD_MODE3,
+	     PIT_BASE + PIT_COMMAND);
+
 	i8254_set_beep_freq(frequency_hz);
 	setio_8(SYSCTL_PORTB, PORTB_BEEP_ENABLE);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/4] x86: Add a dtsi file for the pc speaker
  2019-02-26  9:52 [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps Bin Meng
@ 2019-02-26  9:52 ` Bin Meng
  2019-03-10 21:51   ` Simon Glass
  2019-02-26  9:52 ` [U-Boot] [PATCH 3/4] x86: coreboot: Add the missing pc speaker node in the device tree Bin Meng
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Bin Meng @ 2019-02-26  9:52 UTC (permalink / raw)
  To: u-boot

The pc speaker driven by the i8254 is generic enough to deserve
a single dtsi file to be included by boards that use it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 arch/x86/dts/pcspkr.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 arch/x86/dts/pcspkr.dtsi

diff --git a/arch/x86/dts/pcspkr.dtsi b/arch/x86/dts/pcspkr.dtsi
new file mode 100644
index 0000000..934ab10
--- /dev/null
+++ b/arch/x86/dts/pcspkr.dtsi
@@ -0,0 +1,5 @@
+/ {
+	pcspkr {
+		compatible = "i8254,beeper";
+	};
+};
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 3/4] x86: coreboot: Add the missing pc speaker node in the device tree
  2019-02-26  9:52 [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps Bin Meng
  2019-02-26  9:52 ` [U-Boot] [PATCH 2/4] x86: Add a dtsi file for the pc speaker Bin Meng
@ 2019-02-26  9:52 ` Bin Meng
  2019-03-10 21:51   ` Simon Glass
  2019-02-26  9:52 ` [U-Boot] [PATCH 4/4] x86: crownbay: Enable the beeper sound driver Bin Meng
  2019-03-10 21:51 ` [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps Simon Glass
  3 siblings, 1 reply; 12+ messages in thread
From: Bin Meng @ 2019-02-26  9:52 UTC (permalink / raw)
  To: u-boot

This is currently missing and without it the i8254 beeper driver
won't work.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 arch/x86/dts/coreboot.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/dts/coreboot.dts b/arch/x86/dts/coreboot.dts
index e212f3d..a88da6e 100644
--- a/arch/x86/dts/coreboot.dts
+++ b/arch/x86/dts/coreboot.dts
@@ -10,6 +10,7 @@
 /include/ "skeleton.dtsi"
 /include/ "serial.dtsi"
 /include/ "keyboard.dtsi"
+/include/ "pcspkr.dtsi"
 /include/ "reset.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 4/4] x86: crownbay: Enable the beeper sound driver
  2019-02-26  9:52 [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps Bin Meng
  2019-02-26  9:52 ` [U-Boot] [PATCH 2/4] x86: Add a dtsi file for the pc speaker Bin Meng
  2019-02-26  9:52 ` [U-Boot] [PATCH 3/4] x86: coreboot: Add the missing pc speaker node in the device tree Bin Meng
@ 2019-02-26  9:52 ` Bin Meng
  2019-03-10 21:51   ` Simon Glass
  2019-03-10 21:51 ` [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps Simon Glass
  3 siblings, 1 reply; 12+ messages in thread
From: Bin Meng @ 2019-02-26  9:52 UTC (permalink / raw)
  To: u-boot

Use the i8254 sound driver to support creating simple beeps.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 arch/x86/dts/crownbay.dts  | 1 +
 configs/crownbay_defconfig | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/arch/x86/dts/crownbay.dts b/arch/x86/dts/crownbay.dts
index 2ffcc5f..8938a94 100644
--- a/arch/x86/dts/crownbay.dts
+++ b/arch/x86/dts/crownbay.dts
@@ -10,6 +10,7 @@
 /include/ "skeleton.dtsi"
 /include/ "serial.dtsi"
 /include/ "keyboard.dtsi"
+/include/ "pcspkr.dtsi"
 /include/ "reset.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
diff --git a/configs/crownbay_defconfig b/configs/crownbay_defconfig
index 34c2eb3..e0c9824 100644
--- a/configs/crownbay_defconfig
+++ b/configs/crownbay_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_DHCP=y
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_PING=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_SOUND=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
@@ -41,6 +42,8 @@ CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 CONFIG_CPU=y
 CONFIG_E1000=y
+CONFIG_SOUND=y
+CONFIG_SOUND_I8254=y
 CONFIG_SPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps
  2019-02-26  9:52 [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps Bin Meng
                   ` (2 preceding siblings ...)
  2019-02-26  9:52 ` [U-Boot] [PATCH 4/4] x86: crownbay: Enable the beeper sound driver Bin Meng
@ 2019-03-10 21:51 ` Simon Glass
  2019-03-11 14:58   ` Bin Meng
  3 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2019-03-10 21:51 UTC (permalink / raw)
  To: u-boot

On Tue, 26 Feb 2019 at 02:47, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> The i8254 timer control IO port (0x43) should be setup correctly
> by using PIT counter 2 to generate beeps, however in U-Boot other
> codes like TSC driver utilizes PIT for TSC frequency calibration
> and configures the counter 2 to a different mode that does not
> beep. Fix this by always ensuring the PIT counter 2 is correctly
> initialized so that the i8254 beeper driver works as expected.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  arch/x86/lib/i8254.c | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/4] x86: Add a dtsi file for the pc speaker
  2019-02-26  9:52 ` [U-Boot] [PATCH 2/4] x86: Add a dtsi file for the pc speaker Bin Meng
@ 2019-03-10 21:51   ` Simon Glass
  2019-03-11 14:58     ` Bin Meng
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2019-03-10 21:51 UTC (permalink / raw)
  To: u-boot

On Tue, 26 Feb 2019 at 02:47, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> The pc speaker driven by the i8254 is generic enough to deserve
> a single dtsi file to be included by boards that use it.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  arch/x86/dts/pcspkr.dtsi | 5 +++++
>  1 file changed, 5 insertions(+)
>  create mode 100644 arch/x86/dts/pcspkr.dtsi

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 3/4] x86: coreboot: Add the missing pc speaker node in the device tree
  2019-02-26  9:52 ` [U-Boot] [PATCH 3/4] x86: coreboot: Add the missing pc speaker node in the device tree Bin Meng
@ 2019-03-10 21:51   ` Simon Glass
  2019-03-11 14:58     ` Bin Meng
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2019-03-10 21:51 UTC (permalink / raw)
  To: u-boot

On Tue, 26 Feb 2019 at 02:47, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> This is currently missing and without it the i8254 beeper driver
> won't work.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  arch/x86/dts/coreboot.dts | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 4/4] x86: crownbay: Enable the beeper sound driver
  2019-02-26  9:52 ` [U-Boot] [PATCH 4/4] x86: crownbay: Enable the beeper sound driver Bin Meng
@ 2019-03-10 21:51   ` Simon Glass
  2019-03-11 14:58     ` Bin Meng
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2019-03-10 21:51 UTC (permalink / raw)
  To: u-boot

On Tue, 26 Feb 2019 at 02:47, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Use the i8254 sound driver to support creating simple beeps.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  arch/x86/dts/crownbay.dts  | 1 +
>  configs/crownbay_defconfig | 3 +++
>  2 files changed, 4 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps
  2019-03-10 21:51 ` [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps Simon Glass
@ 2019-03-11 14:58   ` Bin Meng
  0 siblings, 0 replies; 12+ messages in thread
From: Bin Meng @ 2019-03-11 14:58 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 11, 2019 at 5:51 AM Simon Glass <sjg@chromium.org> wrote:
>
> On Tue, 26 Feb 2019 at 02:47, Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > The i8254 timer control IO port (0x43) should be setup correctly
> > by using PIT counter 2 to generate beeps, however in U-Boot other
> > codes like TSC driver utilizes PIT for TSC frequency calibration
> > and configures the counter 2 to a different mode that does not
> > beep. Fix this by always ensuring the PIT counter 2 is correctly
> > initialized so that the i8254 beeper driver works as expected.
> >
> > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> > ---
> >
> >  arch/x86/lib/i8254.c | 4 ++++
> >  1 file changed, 4 insertions(+)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86, thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 2/4] x86: Add a dtsi file for the pc speaker
  2019-03-10 21:51   ` Simon Glass
@ 2019-03-11 14:58     ` Bin Meng
  0 siblings, 0 replies; 12+ messages in thread
From: Bin Meng @ 2019-03-11 14:58 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 11, 2019 at 5:51 AM Simon Glass <sjg@chromium.org> wrote:
>
> On Tue, 26 Feb 2019 at 02:47, Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > The pc speaker driven by the i8254 is generic enough to deserve
> > a single dtsi file to be included by boards that use it.
> >
> > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> > ---
> >
> >  arch/x86/dts/pcspkr.dtsi | 5 +++++
> >  1 file changed, 5 insertions(+)
> >  create mode 100644 arch/x86/dts/pcspkr.dtsi
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86, thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 3/4] x86: coreboot: Add the missing pc speaker node in the device tree
  2019-03-10 21:51   ` Simon Glass
@ 2019-03-11 14:58     ` Bin Meng
  0 siblings, 0 replies; 12+ messages in thread
From: Bin Meng @ 2019-03-11 14:58 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 11, 2019 at 5:51 AM Simon Glass <sjg@chromium.org> wrote:
>
> On Tue, 26 Feb 2019 at 02:47, Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > This is currently missing and without it the i8254 beeper driver
> > won't work.
> >
> > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> > ---
> >
> >  arch/x86/dts/coreboot.dts | 1 +
> >  1 file changed, 1 insertion(+)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86, thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH 4/4] x86: crownbay: Enable the beeper sound driver
  2019-03-10 21:51   ` Simon Glass
@ 2019-03-11 14:58     ` Bin Meng
  0 siblings, 0 replies; 12+ messages in thread
From: Bin Meng @ 2019-03-11 14:58 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 11, 2019 at 5:51 AM Simon Glass <sjg@chromium.org> wrote:
>
> On Tue, 26 Feb 2019 at 02:47, Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > Use the i8254 sound driver to support creating simple beeps.
> >
> > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> > ---
> >
> >  arch/x86/dts/crownbay.dts  | 1 +
> >  configs/crownbay_defconfig | 3 +++
> >  2 files changed, 4 insertions(+)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86, thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-03-11 14:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26  9:52 [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps Bin Meng
2019-02-26  9:52 ` [U-Boot] [PATCH 2/4] x86: Add a dtsi file for the pc speaker Bin Meng
2019-03-10 21:51   ` Simon Glass
2019-03-11 14:58     ` Bin Meng
2019-02-26  9:52 ` [U-Boot] [PATCH 3/4] x86: coreboot: Add the missing pc speaker node in the device tree Bin Meng
2019-03-10 21:51   ` Simon Glass
2019-03-11 14:58     ` Bin Meng
2019-02-26  9:52 ` [U-Boot] [PATCH 4/4] x86: crownbay: Enable the beeper sound driver Bin Meng
2019-03-10 21:51   ` Simon Glass
2019-03-11 14:58     ` Bin Meng
2019-03-10 21:51 ` [U-Boot] [PATCH 1/4] x86: Make sure i8254 is setup correctly before generating beeps Simon Glass
2019-03-11 14:58   ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.