All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 5/5] malta: Use device model & tree for UART
Date: Mon, 16 May 2016 20:56:32 +0200	[thread overview]
Message-ID: <573A17E0.7050906@gmail.com> (raw)
In-Reply-To: <1463420679-5042-6-git-send-email-paul.burton@imgtec.com>



Am 16.05.2016 um 19:44 schrieb Paul Burton:
> Make use of device model & device tree to probe the UART driver. This is
> the initial step in bringing Malta up to date with driver model, and
> allows for cleaner handling of the different I/O addresses for different
> system controllers by specifying the ISA bus address instead of a
> translated memory address.
> 
> Signed-off-by: Paul Burton <paul.burton@imgtec.com>

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

nits below

> ---
> 
> Changes in v2:
> - Only handle the UART we already use, for simplicity.
> 
>  arch/mips/Kconfig           |  5 +++++
>  arch/mips/dts/Makefile      |  3 ++-
>  arch/mips/dts/mti,malta.dts | 32 ++++++++++++++++++++++++++++++++
>  configs/malta_defconfig     |  1 +
>  configs/maltael_defconfig   |  1 +
>  include/configs/malta.h     |  6 ------
>  6 files changed, 41 insertions(+), 7 deletions(-)
>  create mode 100644 arch/mips/dts/mti,malta.dts
> 
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index fe37d1f..e407b19 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -23,7 +23,12 @@ config TARGET_QEMU_MIPS
>  
>  config TARGET_MALTA
>  	bool "Support malta"
> +	select DM
> +	select DM_SERIAL

actually DM_SERIAL should be selected in the defconfig. But Malta is a single target so it's ok.

>  	select DYNAMIC_IO_PORT_BASE
> +	select OF_CONTROL
> +	select OF_EMBED

but OF_EMBED should go into the defconfig. The user should decide if the DTB should be appended or be embedded.

> +	select OF_ISA_BUS
>  	select SUPPORTS_BIG_ENDIAN
>  	select SUPPORTS_LITTLE_ENDIAN
>  	select SUPPORTS_CPU_MIPS32_R1
> diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile
> index b513918..45d623f 100644
> --- a/arch/mips/dts/Makefile
> +++ b/arch/mips/dts/Makefile
> @@ -2,7 +2,8 @@
>  # SPDX-License-Identifier:	GPL-2.0+
>  #
>  
> -dtb-$(CONFIG_TARGET_PIC32MZDASK) += pic32mzda_sk.dtb
> +dtb-$(CONFIG_TARGET_MALTA)		+= mti,malta.dtb
> +dtb-$(CONFIG_TARGET_PIC32MZDASK)	+= pic32mzda_sk.dtb

this doesn't apply to u-boot-mips/next but I can fix it.

>  
>  targets += $(dtb-y)
>  
> diff --git a/arch/mips/dts/mti,malta.dts b/arch/mips/dts/mti,malta.dts
> new file mode 100644
> index 0000000..1dba606
> --- /dev/null
> +++ b/arch/mips/dts/mti,malta.dts
> @@ -0,0 +1,32 @@
> +/dts-v1/;
> +
> +/memreserve/ 0x00000000 0x00001000;	/* Exception vectors */
> +/memreserve/ 0x000f0000 0x00010000;	/* PIIX4 ISA memory */
> +
> +/ {
> +	#address-cells = <1>;
> +	#size-cells = <1>;
> +	compatible = "mti,malta";
> +
> +	chosen {
> +		stdout-path = &uart0;
> +	};
> +
> +	isa {
> +		compatible = "isa";
> +		#address-cells = <2>;
> +		#size-cells = <1>;
> +		ranges = <1 0 0 0x1000>;

is following dtc warning fixable?

Warning (unit_address_vs_reg): Node /isa has a reg or ranges property, but no unit name

> +
> +		uart0: serial at 3f8 {
> +			compatible = "ns16550a";
> +
> +			reg = <1 0x3f8 0x40>;
> +			reg-shift = <0>;
> +
> +			clock-frequency = <1843200>;
> +
> +			u-boot,dm-pre-reloc;
> +		};
> +	};
> +};
> diff --git a/configs/malta_defconfig b/configs/malta_defconfig
> index a16f10b..0b5075f 100644
> --- a/configs/malta_defconfig
> +++ b/configs/malta_defconfig
> @@ -11,3 +11,4 @@ CONFIG_CMD_DHCP=y
>  CONFIG_CMD_PING=y
>  CONFIG_SYS_NS16550=y
>  CONFIG_USE_PRIVATE_LIBGCC=y
> +CONFIG_DEFAULT_DEVICE_TREE="mti,malta"
> diff --git a/configs/maltael_defconfig b/configs/maltael_defconfig
> index 5289797..876e806 100644
> --- a/configs/maltael_defconfig
> +++ b/configs/maltael_defconfig
> @@ -12,3 +12,4 @@ CONFIG_CMD_DHCP=y
>  CONFIG_CMD_PING=y
>  CONFIG_SYS_NS16550=y
>  CONFIG_USE_PRIVATE_LIBGCC=y
> +CONFIG_DEFAULT_DEVICE_TREE="mti,malta"
> diff --git a/include/configs/malta.h b/include/configs/malta.h
> index 1c3c83c..e03935b 100644
> --- a/include/configs/malta.h
> +++ b/include/configs/malta.h
> @@ -65,13 +65,7 @@
>   * Serial driver
>   */
>  #define CONFIG_BAUDRATE			115200
> -
> -#define CONFIG_SYS_NS16550_SERIAL
>  #define CONFIG_SYS_NS16550_PORT_MAPPED
> -#define CONFIG_SYS_NS16550_REG_SIZE	1
> -#define CONFIG_SYS_NS16550_CLK		(115200 * 16)
> -#define CONFIG_SYS_NS16550_COM1		0x3f8
> -#define CONFIG_CONS_INDEX		1
>  
>  /*
>   * Flash configuration
> 

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160516/600b8cb0/attachment.sig>

  reply	other threads:[~2016-05-16 18:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-16 17:44 [U-Boot] [PATCH v2 0/5] Malta UART using device model & device tree Paul Burton
2016-05-16 17:44 ` [U-Boot] [PATCH v2 1/5] fdt: Support for ISA busses Paul Burton
2016-05-17 12:11   ` Simon Glass
2016-05-16 17:44 ` [U-Boot] [PATCH v2 2/5] fdt: Document the rest of struct of_bus Paul Burton
2016-05-17 12:11   ` Simon Glass
2016-05-16 17:44 ` [U-Boot] [PATCH v2 3/5] dm: ns16550: Don't map_physmem for I/O ports Paul Burton
2016-05-16 18:58   ` Daniel Schwierzeck
2016-05-17 12:11   ` Simon Glass
2016-05-17 12:48     ` Paul Burton
2016-05-17 15:51       ` Daniel Schwierzeck
2016-05-17 15:54         ` Simon Glass
2016-05-17 15:58           ` Paul Burton
2016-05-17 16:00             ` Simon Glass
2016-05-18 10:04               ` Daniel Schwierzeck
2016-05-18 14:52                 ` Simon Glass
2016-05-21 16:50                   ` Daniel Schwierzeck
2016-05-24 15:34                     ` Paul Burton
2016-05-16 17:44 ` [U-Boot] [PATCH v2 4/5] malta: Tidy up UART address selection Paul Burton
2016-05-16 18:57   ` Daniel Schwierzeck
2016-05-16 17:44 ` [U-Boot] [PATCH v2 5/5] malta: Use device model & tree for UART Paul Burton
2016-05-16 18:56   ` Daniel Schwierzeck [this message]
2016-05-17  6:40     ` Paul Burton
2016-05-17 10:57       ` Daniel Schwierzeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=573A17E0.7050906@gmail.com \
    --to=daniel.schwierzeck@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.