diff mbox series

[U-Boot,5/5] sunxi: add support for Pinebook

Message ID 20180929234553.31019-6-vagrant@debian.org
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series [U-Boot,1/5] mmc: sunxi: add support for automatic delay calibration | expand

Commit Message

Vagrant Cascadian Sept. 29, 2018, 11:45 p.m. UTC
From: Vasily Khoruzhick <anarsoul@gmail.com>

Pinebook is a laptop produced by Pine64, with USB-connected keyboard,
USB-connected touchpad and an eDP LCD panel connected via a RGB-eDP
bridge from Analogix.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
---

 arch/arm/dts/Makefile                |  3 +-
 arch/arm/dts/sun50i-a64-pinebook.dts | 99 ++++++++++++++++++++++++++++++++++++
 configs/pinebook_defconfig           | 32 ++++++++++++
 3 files changed, 133 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/sun50i-a64-pinebook.dts
 create mode 100644 configs/pinebook_defconfig

Comments

Maxime Ripard Oct. 1, 2018, 8:17 a.m. UTC | #1
On Sat, Sep 29, 2018 at 04:45:53PM -0700, Vagrant Cascadian wrote:
> From: Vasily Khoruzhick <anarsoul@gmail.com>
> 
> Pinebook is a laptop produced by Pine64, with USB-connected keyboard,
> USB-connected touchpad and an eDP LCD panel connected via a RGB-eDP
> bridge from Analogix.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> 
> Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
> ---
> 
>  arch/arm/dts/Makefile                |  3 +-
>  arch/arm/dts/sun50i-a64-pinebook.dts | 99 ++++++++++++++++++++++++++++++++++++
>  configs/pinebook_defconfig           | 32 ++++++++++++
>  3 files changed, 133 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/sun50i-a64-pinebook.dts
>  create mode 100644 configs/pinebook_defconfig
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 44ebc50bfa..1bb5d0d47e 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -403,7 +403,8 @@ dtb-$(CONFIG_MACH_SUN50I) += \
>  	sun50i-a64-orangepi-win.dtb \
>  	sun50i-a64-pine64-plus.dtb \
>  	sun50i-a64-pine64.dtb \
> -	sun50i-a64-sopine-baseboard.dtb
> +	sun50i-a64-sopine-baseboard.dtb \
> +	sun50i-a64-pinebook.dtb

You should keep them sorted alphabetically.

>  dtb-$(CONFIG_MACH_SUN9I) += \
>  	sun9i-a80-optimus.dtb \
>  	sun9i-a80-cubieboard4.dtb \
> diff --git a/arch/arm/dts/sun50i-a64-pinebook.dts b/arch/arm/dts/sun50i-a64-pinebook.dts
> new file mode 100644
> index 0000000000..48bee4cc7f
> --- /dev/null
> +++ b/arch/arm/dts/sun50i-a64-pinebook.dts
> @@ -0,0 +1,99 @@
> +/*
> + * Copyright (c) 2016 ARM Ltd.
> + *
> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *
> + *  a) This library is free software; you can redistribute it and/or
> + *     modify it under the terms of the GNU General Public License as
> + *     published by the Free Software Foundation; either version 2 of the
> + *     License, or (at your option) any later version.
> + *
> + *     This library is distributed in the hope that it will be useful,
> + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *     GNU General Public License for more details.
> + *
> + * Or, alternatively,
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + *     obtaining a copy of this software and associated documentation
> + *     files (the "Software"), to deal in the Software without
> + *     restriction, including without limitation the rights to use,
> + *     copy, modify, merge, publish, distribute, sublicense, and/or
> + *     sell copies of the Software, and to permit persons to whom the
> + *     Software is furnished to do so, subject to the following
> + *     conditions:
> + *
> + *     The above copyright notice and this permission notice shall be
> + *     included in all copies or substantial portions of the Software.
> + *
> + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + *     OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +/dts-v1/;
> +
> +#include <dt-bindings/pwm/pwm.h>
> +#include "sun50i-a64-pine64.dts"
> +
> +/ {
> +	model = "Pinebook";
> +	compatible = "pine64,pinebook", "allwinner,sun50i-a64";
> +
> +	aliases {
> +		serial0 = &uart0;
> +		i2c0 = "/i2c@1f02400";
> +	};
> +
> +	vdd_bl: regulator@0 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "bl-3v3";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +		gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
> +		enable-active-high;
> +	};
> +
> +
> +	backlight: backlight {
> +		compatible = "pwm-backlight";
> +		pwms = <&pwm 0 50000 0>;
> +		brightness-levels = <0 10 20 30 40 50 60 70 100>;
> +		default-brightness-level = <3>;
> +		enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
> +		power-supply = <&vdd_bl>;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +
> +	memory {
> +		reg = <0x40000000 0x40000000>;
> +	};
> +};
> +
> +&pwm {
> +	status = "okay";
> +};
> +
> +&r_i2c {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&r_i2c_pins_a>;
> +	status = "okay";
> +	anx6345: edp-bridge@38 {
> +		compatible = "analogix,anx6345";
> +		reg = <0x38>;
> +		reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
> +		status = "okay";
> +	};
> +};

I'm not sure why that DT is that different from the one we have in
Linux. Ideally, they should be identical.

> diff --git a/configs/pinebook_defconfig b/configs/pinebook_defconfig
> new file mode 100644
> index 0000000000..15d0f50c41
> --- /dev/null
> +++ b/configs/pinebook_defconfig
> @@ -0,0 +1,32 @@
> +CONFIG_ARM=y
> +CONFIG_ARCH_SUNXI=y
> +CONFIG_SPL=y
> +CONFIG_MACH_SUN50I=y
> +CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
> +CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
> +CONFIG_DRAM_CLK=552
> +CONFIG_DRAM_ZQ=3881949
> +CONFIG_MMC_SUNXI_SLOT_EXTRA=2
> +CONFIG_R_I2C_ENABLE=y
> +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
> +# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
> +CONFIG_CMD_POWEROFF=y

So the way we deal with defconfigs usually is that we don't really
enable a command solely for one defconfig. Either we enable it for all
the boards, or none.

> +# CONFIG_CMD_FLASH is not set
> +# CONFIG_SPL_DOS_PARTITION is not set
> +# CONFIG_SPL_EFI_PARTITION is not set
> +CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinebook"
> +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
> +CONFIG_DM_I2C_GPIO=y

Why are you using a bitbanged i2c bus? As far as I know, this is not
enabled anywhere.

> +# CONFIG_MMC_VERBOSE is not set

This should go away

> +CONFIG_DM_REGULATOR=y
> +CONFIG_DM_REGULATOR_FIXED=y
> +CONFIG_DM_PWM=y
> +CONFIG_PWM_SUNXI=y
> +CONFIG_USB_EHCI_HCD=y
> +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
> +# CONFIG_USB_GADGET is not set
> +CONFIG_USB_HOST_ETHER=y
> +CONFIG_USB_ETHER_ASIX=y

Those last three too.

Thanks!
Maxime
Icenowy Zheng Oct. 1, 2018, 9:37 a.m. UTC | #2
于 2018年10月1日 GMT+08:00 下午4:17:24, Maxime Ripard <maxime.ripard@bootlin.com> 写到:
>On Sat, Sep 29, 2018 at 04:45:53PM -0700, Vagrant Cascadian wrote:
>> From: Vasily Khoruzhick <anarsoul@gmail.com>
>> 
>> Pinebook is a laptop produced by Pine64, with USB-connected keyboard,
>> USB-connected touchpad and an eDP LCD panel connected via a RGB-eDP
>> bridge from Analogix.
>> 
>> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
>> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
>> 
>> Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
>> ---
>> 
>>  arch/arm/dts/Makefile                |  3 +-
>>  arch/arm/dts/sun50i-a64-pinebook.dts | 99
>++++++++++++++++++++++++++++++++++++
>>  configs/pinebook_defconfig           | 32 ++++++++++++
>>  3 files changed, 133 insertions(+), 1 deletion(-)
>>  create mode 100644 arch/arm/dts/sun50i-a64-pinebook.dts
>>  create mode 100644 configs/pinebook_defconfig
>> 
>> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
>> index 44ebc50bfa..1bb5d0d47e 100644
>> --- a/arch/arm/dts/Makefile
>> +++ b/arch/arm/dts/Makefile
>> @@ -403,7 +403,8 @@ dtb-$(CONFIG_MACH_SUN50I) += \
>>  	sun50i-a64-orangepi-win.dtb \
>>  	sun50i-a64-pine64-plus.dtb \
>>  	sun50i-a64-pine64.dtb \
>> -	sun50i-a64-sopine-baseboard.dtb
>> +	sun50i-a64-sopine-baseboard.dtb \
>> +	sun50i-a64-pinebook.dtb
>
>You should keep them sorted alphabetically.
>
>>  dtb-$(CONFIG_MACH_SUN9I) += \
>>  	sun9i-a80-optimus.dtb \
>>  	sun9i-a80-cubieboard4.dtb \
>> diff --git a/arch/arm/dts/sun50i-a64-pinebook.dts
>b/arch/arm/dts/sun50i-a64-pinebook.dts
>> new file mode 100644
>> index 0000000000..48bee4cc7f
>> --- /dev/null
>> +++ b/arch/arm/dts/sun50i-a64-pinebook.dts
>> @@ -0,0 +1,99 @@
>> +/*
>> + * Copyright (c) 2016 ARM Ltd.
>> + *
>> + * This file is dual-licensed: you can use it either under the terms
>> + * of the GPL or the X11 license, at your option. Note that this
>dual
>> + * licensing only applies to this file, and not this project as a
>> + * whole.
>> + *
>> + *  a) This library is free software; you can redistribute it and/or
>> + *     modify it under the terms of the GNU General Public License
>as
>> + *     published by the Free Software Foundation; either version 2
>of the
>> + *     License, or (at your option) any later version.
>> + *
>> + *     This library is distributed in the hope that it will be
>useful,
>> + *     but WITHOUT ANY WARRANTY; without even the implied warranty
>of
>> + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + *     GNU General Public License for more details.
>> + *
>> + * Or, alternatively,
>> + *
>> + *  b) Permission is hereby granted, free of charge, to any person
>> + *     obtaining a copy of this software and associated
>documentation
>> + *     files (the "Software"), to deal in the Software without
>> + *     restriction, including without limitation the rights to use,
>> + *     copy, modify, merge, publish, distribute, sublicense, and/or
>> + *     sell copies of the Software, and to permit persons to whom
>the
>> + *     Software is furnished to do so, subject to the following
>> + *     conditions:
>> + *
>> + *     The above copyright notice and this permission notice shall
>be
>> + *     included in all copies or substantial portions of the
>Software.
>> + *
>> + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
>KIND,
>> + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
>WARRANTIES
>> + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>> + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
>> + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
>> + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>> + *     OTHER DEALINGS IN THE SOFTWARE.
>> + */
>> +
>> +/dts-v1/;
>> +
>> +#include <dt-bindings/pwm/pwm.h>
>> +#include "sun50i-a64-pine64.dts"
>> +
>> +/ {
>> +	model = "Pinebook";
>> +	compatible = "pine64,pinebook", "allwinner,sun50i-a64";
>> +
>> +	aliases {
>> +		serial0 = &uart0;
>> +		i2c0 = "/i2c@1f02400";
>> +	};
>> +
>> +	vdd_bl: regulator@0 {
>> +		compatible = "regulator-fixed";
>> +		regulator-name = "bl-3v3";
>> +		regulator-min-microvolt = <3300000>;
>> +		regulator-max-microvolt = <3300000>;
>> +		gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
>> +		enable-active-high;
>> +	};
>> +
>> +
>> +	backlight: backlight {
>> +		compatible = "pwm-backlight";
>> +		pwms = <&pwm 0 50000 0>;
>> +		brightness-levels = <0 10 20 30 40 50 60 70 100>;
>> +		default-brightness-level = <3>;
>> +		enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
>> +		power-supply = <&vdd_bl>;
>> +	};
>> +
>> +	chosen {
>> +		stdout-path = "serial0:115200n8";
>> +	};
>> +
>> +	memory {
>> +		reg = <0x40000000 0x40000000>;
>> +	};
>> +};
>> +
>> +&pwm {
>> +	status = "okay";
>> +};
>> +
>> +&r_i2c {
>> +	pinctrl-names = "default";
>> +	pinctrl-0 = <&r_i2c_pins_a>;
>> +	status = "okay";
>> +	anx6345: edp-bridge@38 {
>> +		compatible = "analogix,anx6345";
>> +		reg = <0x38>;
>> +		reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
>> +		status = "okay";
>> +	};
>> +};
>
>I'm not sure why that DT is that different from the one we have in
>Linux. Ideally, they should be identical.

Linux one has no ANX6345 yet, so they're not identical.

>
>> diff --git a/configs/pinebook_defconfig b/configs/pinebook_defconfig
>> new file mode 100644
>> index 0000000000..15d0f50c41
>> --- /dev/null
>> +++ b/configs/pinebook_defconfig
>> @@ -0,0 +1,32 @@
>> +CONFIG_ARM=y
>> +CONFIG_ARCH_SUNXI=y
>> +CONFIG_SPL=y
>> +CONFIG_MACH_SUN50I=y
>> +CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
>> +CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
>> +CONFIG_DRAM_CLK=552
>> +CONFIG_DRAM_ZQ=3881949
>> +CONFIG_MMC_SUNXI_SLOT_EXTRA=2
>> +CONFIG_R_I2C_ENABLE=y
>> +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
>> +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
>> +# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
>> +CONFIG_CMD_POWEROFF=y
>
>So the way we deal with defconfigs usually is that we don't really
>enable a command solely for one defconfig. Either we enable it for all
>the boards, or none.
>
>> +# CONFIG_CMD_FLASH is not set
>> +# CONFIG_SPL_DOS_PARTITION is not set
>> +# CONFIG_SPL_EFI_PARTITION is not set
>> +CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinebook"
>> +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
>> +CONFIG_DM_I2C_GPIO=y
>
>Why are you using a bitbanged i2c bus? As far as I know, this is not
>enabled anywhere.
>
>> +# CONFIG_MMC_VERBOSE is not set
>
>This should go away
>
>> +CONFIG_DM_REGULATOR=y
>> +CONFIG_DM_REGULATOR_FIXED=y
>> +CONFIG_DM_PWM=y
>> +CONFIG_PWM_SUNXI=y
>> +CONFIG_USB_EHCI_HCD=y
>> +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
>> +# CONFIG_USB_GADGET is not set
>> +CONFIG_USB_HOST_ETHER=y
>> +CONFIG_USB_ETHER_ASIX=y
>
>Those last three too.
>
>Thanks!
>Maxime
Maxime Ripard Oct. 1, 2018, 10 a.m. UTC | #3
On Mon, Oct 01, 2018 at 05:37:58PM +0800, Icenowy Zheng wrote:
> >>  dtb-$(CONFIG_MACH_SUN9I) += \
> >>  	sun9i-a80-optimus.dtb \
> >>  	sun9i-a80-cubieboard4.dtb \
> >> diff --git a/arch/arm/dts/sun50i-a64-pinebook.dts
> >b/arch/arm/dts/sun50i-a64-pinebook.dts
> >> new file mode 100644
> >> index 0000000000..48bee4cc7f
> >> --- /dev/null
> >> +++ b/arch/arm/dts/sun50i-a64-pinebook.dts
> >> @@ -0,0 +1,99 @@
> >> +/*
> >> + * Copyright (c) 2016 ARM Ltd.
> >> + *
> >> + * This file is dual-licensed: you can use it either under the terms
> >> + * of the GPL or the X11 license, at your option. Note that this
> >dual
> >> + * licensing only applies to this file, and not this project as a
> >> + * whole.
> >> + *
> >> + *  a) This library is free software; you can redistribute it and/or
> >> + *     modify it under the terms of the GNU General Public License
> >as
> >> + *     published by the Free Software Foundation; either version 2
> >of the
> >> + *     License, or (at your option) any later version.
> >> + *
> >> + *     This library is distributed in the hope that it will be
> >useful,
> >> + *     but WITHOUT ANY WARRANTY; without even the implied warranty
> >of
> >> + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> >> + *     GNU General Public License for more details.
> >> + *
> >> + * Or, alternatively,
> >> + *
> >> + *  b) Permission is hereby granted, free of charge, to any person
> >> + *     obtaining a copy of this software and associated
> >documentation
> >> + *     files (the "Software"), to deal in the Software without
> >> + *     restriction, including without limitation the rights to use,
> >> + *     copy, modify, merge, publish, distribute, sublicense, and/or
> >> + *     sell copies of the Software, and to permit persons to whom
> >the
> >> + *     Software is furnished to do so, subject to the following
> >> + *     conditions:
> >> + *
> >> + *     The above copyright notice and this permission notice shall
> >be
> >> + *     included in all copies or substantial portions of the
> >Software.
> >> + *
> >> + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
> >KIND,
> >> + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
> >WARRANTIES
> >> + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> >> + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> >> + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> >> + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> >> + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> >> + *     OTHER DEALINGS IN THE SOFTWARE.
> >> + */
> >> +
> >> +/dts-v1/;
> >> +
> >> +#include <dt-bindings/pwm/pwm.h>
> >> +#include "sun50i-a64-pine64.dts"
> >> +
> >> +/ {
> >> +	model = "Pinebook";
> >> +	compatible = "pine64,pinebook", "allwinner,sun50i-a64";
> >> +
> >> +	aliases {
> >> +		serial0 = &uart0;
> >> +		i2c0 = "/i2c@1f02400";
> >> +	};
> >> +
> >> +	vdd_bl: regulator@0 {
> >> +		compatible = "regulator-fixed";
> >> +		regulator-name = "bl-3v3";
> >> +		regulator-min-microvolt = <3300000>;
> >> +		regulator-max-microvolt = <3300000>;
> >> +		gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
> >> +		enable-active-high;
> >> +	};
> >> +
> >> +
> >> +	backlight: backlight {
> >> +		compatible = "pwm-backlight";
> >> +		pwms = <&pwm 0 50000 0>;
> >> +		brightness-levels = <0 10 20 30 40 50 60 70 100>;
> >> +		default-brightness-level = <3>;
> >> +		enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
> >> +		power-supply = <&vdd_bl>;
> >> +	};
> >> +
> >> +	chosen {
> >> +		stdout-path = "serial0:115200n8";
> >> +	};
> >> +
> >> +	memory {
> >> +		reg = <0x40000000 0x40000000>;
> >> +	};
> >> +};
> >> +
> >> +&pwm {
> >> +	status = "okay";
> >> +};
> >> +
> >> +&r_i2c {
> >> +	pinctrl-names = "default";
> >> +	pinctrl-0 = <&r_i2c_pins_a>;
> >> +	status = "okay";
> >> +	anx6345: edp-bridge@38 {
> >> +		compatible = "analogix,anx6345";
> >> +		reg = <0x38>;
> >> +		reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
> >> +		status = "okay";
> >> +	};
> >> +};
> >
> >I'm not sure why that DT is that different from the one we have in
> >Linux. Ideally, they should be identical.
> 
> Linux one has no ANX6345 yet, so they're not identical.

Right, but it's far from being the only difference.

Maxime
diff mbox series

Patch

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 44ebc50bfa..1bb5d0d47e 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -403,7 +403,8 @@  dtb-$(CONFIG_MACH_SUN50I) += \
 	sun50i-a64-orangepi-win.dtb \
 	sun50i-a64-pine64-plus.dtb \
 	sun50i-a64-pine64.dtb \
-	sun50i-a64-sopine-baseboard.dtb
+	sun50i-a64-sopine-baseboard.dtb \
+	sun50i-a64-pinebook.dtb
 dtb-$(CONFIG_MACH_SUN9I) += \
 	sun9i-a80-optimus.dtb \
 	sun9i-a80-cubieboard4.dtb \
diff --git a/arch/arm/dts/sun50i-a64-pinebook.dts b/arch/arm/dts/sun50i-a64-pinebook.dts
new file mode 100644
index 0000000000..48bee4cc7f
--- /dev/null
+++ b/arch/arm/dts/sun50i-a64-pinebook.dts
@@ -0,0 +1,99 @@ 
+/*
+ * Copyright (c) 2016 ARM Ltd.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/pwm/pwm.h>
+#include "sun50i-a64-pine64.dts"
+
+/ {
+	model = "Pinebook";
+	compatible = "pine64,pinebook", "allwinner,sun50i-a64";
+
+	aliases {
+		serial0 = &uart0;
+		i2c0 = "/i2c@1f02400";
+	};
+
+	vdd_bl: regulator@0 {
+		compatible = "regulator-fixed";
+		regulator-name = "bl-3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
+		enable-active-high;
+	};
+
+
+	backlight: backlight {
+		compatible = "pwm-backlight";
+		pwms = <&pwm 0 50000 0>;
+		brightness-levels = <0 10 20 30 40 50 60 70 100>;
+		default-brightness-level = <3>;
+		enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
+		power-supply = <&vdd_bl>;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory {
+		reg = <0x40000000 0x40000000>;
+	};
+};
+
+&pwm {
+	status = "okay";
+};
+
+&r_i2c {
+	pinctrl-names = "default";
+	pinctrl-0 = <&r_i2c_pins_a>;
+	status = "okay";
+	anx6345: edp-bridge@38 {
+		compatible = "analogix,anx6345";
+		reg = <0x38>;
+		reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
+		status = "okay";
+	};
+};
diff --git a/configs/pinebook_defconfig b/configs/pinebook_defconfig
new file mode 100644
index 0000000000..15d0f50c41
--- /dev/null
+++ b/configs/pinebook_defconfig
@@ -0,0 +1,32 @@ 
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_SPL=y
+CONFIG_MACH_SUN50I=y
+CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
+CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
+CONFIG_DRAM_CLK=552
+CONFIG_DRAM_ZQ=3881949
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_R_I2C_ENABLE=y
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
+CONFIG_CMD_POWEROFF=y
+# CONFIG_CMD_FLASH is not set
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinebook"
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_DM_I2C_GPIO=y
+# CONFIG_MMC_VERBOSE is not set
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_SUNXI=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
+# CONFIG_USB_GADGET is not set
+CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_ETHER_ASIX=y
+CONFIG_VIDEO_BRIDGE=y
+CONFIG_VIDEO_BRIDGE_ANALOGIX_ANX6345=y