diff mbox

[U-Boot,24/28] x86: Add an i8042 device for boards that have it

Message ID 1441773171-4575-25-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Sept. 9, 2015, 4:32 a.m. UTC
Some boards have an i8042 device. Enable the driver for all x86 boards, and
add a device tree node for those which may have this keyboard.

Also adjust the configuration so that i8042 is always separate from the VGA,
and rename the stdin driver accordingly. With this commit the keyboard will
not work, but it is fixed in the next commit.

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

 arch/x86/Kconfig                 | 6 ++++++
 arch/x86/dts/bayleybay.dts       | 1 +
 arch/x86/dts/chromebook_link.dts | 1 +
 arch/x86/dts/keyboard.dtsi       | 5 +++++
 include/configs/x86-chromebook.h | 2 +-
 include/configs/x86-common.h     | 2 +-
 6 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/dts/keyboard.dtsi

Comments

Bin Meng Sept. 15, 2015, 6:12 a.m. UTC | #1
Hi Simon,

On Wed, Sep 9, 2015 at 12:32 PM, Simon Glass <sjg@chromium.org> wrote:
> Some boards have an i8042 device. Enable the driver for all x86 boards, and
> add a device tree node for those which may have this keyboard.
>
> Also adjust the configuration so that i8042 is always separate from the VGA,
> and rename the stdin driver accordingly. With this commit the keyboard will
> not work, but it is fixed in the next commit.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  arch/x86/Kconfig                 | 6 ++++++
>  arch/x86/dts/bayleybay.dts       | 1 +
>  arch/x86/dts/chromebook_link.dts | 1 +
>  arch/x86/dts/keyboard.dtsi       | 5 +++++
>  include/configs/x86-chromebook.h | 2 +-
>  include/configs/x86-common.h     | 2 +-
>  6 files changed, 15 insertions(+), 2 deletions(-)
>  create mode 100644 arch/x86/dts/keyboard.dtsi
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 5e42d7d..72a66ea 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -401,6 +401,12 @@ config PCIE_ECAM_SIZE
>           so a default 0x10000000 size covers all of the 256 buses which is the
>           maximum number of PCI buses as defined by the PCI specification.
>
> +config I8042_KEYB
> +       default y
> +
> +config DM_KEYBOARD
> +       default y
> +

I am not in favor of adding driver options in the arch Kconfig. We
specify other drivers in the boards' defconfig files. Can we move
these two to defconfig too?

>  source "arch/x86/lib/efi/Kconfig"
>
>  endmenu
> diff --git a/arch/x86/dts/bayleybay.dts b/arch/x86/dts/bayleybay.dts
> index d646987..58d97c8 100644
> --- a/arch/x86/dts/bayleybay.dts
> +++ b/arch/x86/dts/bayleybay.dts
> @@ -10,6 +10,7 @@
>  #include <dt-bindings/interrupt-router/intel-irq.h>
>
>  /include/ "skeleton.dtsi"
> +/include/ "keyboard.dtsi"
>  /include/ "serial.dtsi"
>  /include/ "rtc.dtsi"
>
> diff --git a/arch/x86/dts/chromebook_link.dts b/arch/x86/dts/chromebook_link.dts
> index 4291141..a52c84f 100644
> --- a/arch/x86/dts/chromebook_link.dts
> +++ b/arch/x86/dts/chromebook_link.dts
> @@ -1,6 +1,7 @@
>  /dts-v1/;
>
>  /include/ "skeleton.dtsi"
> +/include/ "keyboard.dtsi"
>  /include/ "serial.dtsi"
>  /include/ "rtc.dtsi"
>
> diff --git a/arch/x86/dts/keyboard.dtsi b/arch/x86/dts/keyboard.dtsi
> new file mode 100644
> index 0000000..000751b
> --- /dev/null
> +++ b/arch/x86/dts/keyboard.dtsi
> @@ -0,0 +1,5 @@
> +/ {
> +       keyboard {
> +               compatible = "intel,i8042-keyboard";
> +       };
> +};
> diff --git a/include/configs/x86-chromebook.h b/include/configs/x86-chromebook.h
> index 2be8850..4ff8b94 100644
> --- a/include/configs/x86-chromebook.h
> +++ b/include/configs/x86-chromebook.h
> @@ -51,7 +51,7 @@
>  #define CONFIG_ENV_IS_IN_SPI_FLASH
>  #define CONFIG_ENV_OFFSET              0x003f8000
>
> -#define CONFIG_STD_DEVICES_SETTINGS     "stdin=usbkbd,vga,serial\0" \
> +#define CONFIG_STD_DEVICES_SETTINGS     "stdin=usbkbd,i8042-kbd,serial\0" \
>                                         "stdout=vga,serial\0" \
>                                         "stderr=vga,serial\0"
>
> diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
> index 3f153f2..ff8fe0f 100644
> --- a/include/configs/x86-common.h
> +++ b/include/configs/x86-common.h
> @@ -147,7 +147,7 @@
>  #define CONFIG_VIDEO
>  #define CONFIG_VIDEO_SW_CURSOR
>  #define VIDEO_FB_16BPP_WORD_SWAP
> -#define CONFIG_I8042_KBD
> +#define CONFIG_VGA_AS_SINGLE_DEVICE

Can we remove CONFIG_VGA_AS_SINGLE_DEVICE from all x86 board config.h
files to avoid duplication?

>  #define CONFIG_CFB_CONSOLE
>  #define CONFIG_CONSOLE_SCROLL_LINES 5
>
> --

Regards,
Bin
Simon Glass Oct. 18, 2015, 11:17 p.m. UTC | #2
Hi Bin,

On 15 September 2015 at 00:12, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Simon,
>
> On Wed, Sep 9, 2015 at 12:32 PM, Simon Glass <sjg@chromium.org> wrote:
>> Some boards have an i8042 device. Enable the driver for all x86 boards, and
>> add a device tree node for those which may have this keyboard.
>>
>> Also adjust the configuration so that i8042 is always separate from the VGA,
>> and rename the stdin driver accordingly. With this commit the keyboard will
>> not work, but it is fixed in the next commit.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>>  arch/x86/Kconfig                 | 6 ++++++
>>  arch/x86/dts/bayleybay.dts       | 1 +
>>  arch/x86/dts/chromebook_link.dts | 1 +
>>  arch/x86/dts/keyboard.dtsi       | 5 +++++
>>  include/configs/x86-chromebook.h | 2 +-
>>  include/configs/x86-common.h     | 2 +-
>>  6 files changed, 15 insertions(+), 2 deletions(-)
>>  create mode 100644 arch/x86/dts/keyboard.dtsi
>>
>> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
>> index 5e42d7d..72a66ea 100644
>> --- a/arch/x86/Kconfig
>> +++ b/arch/x86/Kconfig
>> @@ -401,6 +401,12 @@ config PCIE_ECAM_SIZE
>>           so a default 0x10000000 size covers all of the 256 buses which is the
>>           maximum number of PCI buses as defined by the PCI specification.
>>
>> +config I8042_KEYB
>> +       default y
>> +
>> +config DM_KEYBOARD
>> +       default y
>> +
>
> I am not in favor of adding driver options in the arch Kconfig. We
> specify other drivers in the boards' defconfig files. Can we move
> these two to defconfig too?

The idea is that x86 has moved to use driver model for keyboard. Any
new boards should also. This option will be removed when everything is
converted so I don't think it should be exposed too widely.

>
>>  source "arch/x86/lib/efi/Kconfig"
>>
>>  endmenu
>> diff --git a/arch/x86/dts/bayleybay.dts b/arch/x86/dts/bayleybay.dts
>> index d646987..58d97c8 100644
>> --- a/arch/x86/dts/bayleybay.dts
>> +++ b/arch/x86/dts/bayleybay.dts
>> @@ -10,6 +10,7 @@
>>  #include <dt-bindings/interrupt-router/intel-irq.h>
>>
>>  /include/ "skeleton.dtsi"
>> +/include/ "keyboard.dtsi"
>>  /include/ "serial.dtsi"
>>  /include/ "rtc.dtsi"
>>
>> diff --git a/arch/x86/dts/chromebook_link.dts b/arch/x86/dts/chromebook_link.dts
>> index 4291141..a52c84f 100644
>> --- a/arch/x86/dts/chromebook_link.dts
>> +++ b/arch/x86/dts/chromebook_link.dts
>> @@ -1,6 +1,7 @@
>>  /dts-v1/;
>>
>>  /include/ "skeleton.dtsi"
>> +/include/ "keyboard.dtsi"
>>  /include/ "serial.dtsi"
>>  /include/ "rtc.dtsi"
>>
>> diff --git a/arch/x86/dts/keyboard.dtsi b/arch/x86/dts/keyboard.dtsi
>> new file mode 100644
>> index 0000000..000751b
>> --- /dev/null
>> +++ b/arch/x86/dts/keyboard.dtsi
>> @@ -0,0 +1,5 @@
>> +/ {
>> +       keyboard {
>> +               compatible = "intel,i8042-keyboard";
>> +       };
>> +};
>> diff --git a/include/configs/x86-chromebook.h b/include/configs/x86-chromebook.h
>> index 2be8850..4ff8b94 100644
>> --- a/include/configs/x86-chromebook.h
>> +++ b/include/configs/x86-chromebook.h
>> @@ -51,7 +51,7 @@
>>  #define CONFIG_ENV_IS_IN_SPI_FLASH
>>  #define CONFIG_ENV_OFFSET              0x003f8000
>>
>> -#define CONFIG_STD_DEVICES_SETTINGS     "stdin=usbkbd,vga,serial\0" \
>> +#define CONFIG_STD_DEVICES_SETTINGS     "stdin=usbkbd,i8042-kbd,serial\0" \
>>                                         "stdout=vga,serial\0" \
>>                                         "stderr=vga,serial\0"
>>
>> diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
>> index 3f153f2..ff8fe0f 100644
>> --- a/include/configs/x86-common.h
>> +++ b/include/configs/x86-common.h
>> @@ -147,7 +147,7 @@
>>  #define CONFIG_VIDEO
>>  #define CONFIG_VIDEO_SW_CURSOR
>>  #define VIDEO_FB_16BPP_WORD_SWAP
>> -#define CONFIG_I8042_KBD
>> +#define CONFIG_VGA_AS_SINGLE_DEVICE
>
> Can we remove CONFIG_VGA_AS_SINGLE_DEVICE from all x86 board config.h
> files to avoid duplication?

Will do.

>
>>  #define CONFIG_CFB_CONSOLE
>>  #define CONFIG_CONSOLE_SCROLL_LINES 5

Regards,
Simon
diff mbox

Patch

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5e42d7d..72a66ea 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -401,6 +401,12 @@  config PCIE_ECAM_SIZE
 	  so a default 0x10000000 size covers all of the 256 buses which is the
 	  maximum number of PCI buses as defined by the PCI specification.
 
+config I8042_KEYB
+	default y
+
+config DM_KEYBOARD
+	default y
+
 source "arch/x86/lib/efi/Kconfig"
 
 endmenu
diff --git a/arch/x86/dts/bayleybay.dts b/arch/x86/dts/bayleybay.dts
index d646987..58d97c8 100644
--- a/arch/x86/dts/bayleybay.dts
+++ b/arch/x86/dts/bayleybay.dts
@@ -10,6 +10,7 @@ 
 #include <dt-bindings/interrupt-router/intel-irq.h>
 
 /include/ "skeleton.dtsi"
+/include/ "keyboard.dtsi"
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 
diff --git a/arch/x86/dts/chromebook_link.dts b/arch/x86/dts/chromebook_link.dts
index 4291141..a52c84f 100644
--- a/arch/x86/dts/chromebook_link.dts
+++ b/arch/x86/dts/chromebook_link.dts
@@ -1,6 +1,7 @@ 
 /dts-v1/;
 
 /include/ "skeleton.dtsi"
+/include/ "keyboard.dtsi"
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 
diff --git a/arch/x86/dts/keyboard.dtsi b/arch/x86/dts/keyboard.dtsi
new file mode 100644
index 0000000..000751b
--- /dev/null
+++ b/arch/x86/dts/keyboard.dtsi
@@ -0,0 +1,5 @@ 
+/ {
+	keyboard {
+		compatible = "intel,i8042-keyboard";
+	};
+};
diff --git a/include/configs/x86-chromebook.h b/include/configs/x86-chromebook.h
index 2be8850..4ff8b94 100644
--- a/include/configs/x86-chromebook.h
+++ b/include/configs/x86-chromebook.h
@@ -51,7 +51,7 @@ 
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_OFFSET		0x003f8000
 
-#define CONFIG_STD_DEVICES_SETTINGS     "stdin=usbkbd,vga,serial\0" \
+#define CONFIG_STD_DEVICES_SETTINGS     "stdin=usbkbd,i8042-kbd,serial\0" \
 					"stdout=vga,serial\0" \
 					"stderr=vga,serial\0"
 
diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
index 3f153f2..ff8fe0f 100644
--- a/include/configs/x86-common.h
+++ b/include/configs/x86-common.h
@@ -147,7 +147,7 @@ 
 #define CONFIG_VIDEO
 #define CONFIG_VIDEO_SW_CURSOR
 #define VIDEO_FB_16BPP_WORD_SWAP
-#define CONFIG_I8042_KBD
+#define CONFIG_VGA_AS_SINGLE_DEVICE
 #define CONFIG_CFB_CONSOLE
 #define CONFIG_CONSOLE_SCROLL_LINES 5