Re: [PATCH] earlycon: initialise baud field of earlycon device structure

2017-08-15 Thread Rob Herring
On Tue, Aug 15, 2017 at 12:21 PM, Eugeniy Paltsev
 wrote:
> For now baud field of earlycon structure device is't initialised at all
> in of_setup_earlycon (in oppositе to register_earlycon).
>
> So when I use stdout-path to point earlycon device
> (like stdout-path = &serial or stdout-path = "serial:115200n8")
> baud field of earlycon device structure remains uninitialised and
> earlycon initialization is not performed correctly as
> of_setup_earlycon is used.

Because the console driver is supposed to parse the option string.
That allows in theory for the options to be specific for each console.
Maybe your earlycon driver is failing to do that.

> When pass all arguments via bootargs
> (like bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8")
> initialization is performed correctly as register_earlycon is used.
>
> So initialise baud field of earlycon device structure by baud value
> from device tree or from options (if they exist) when we use
> of_setup_earlycon
>
> Signed-off-by: Eugeniy Paltsev 
> ---
>  drivers/tty/serial/earlycon.c | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> index c365154..6c2e2b6 100644
> --- a/drivers/tty/serial/earlycon.c
> +++ b/drivers/tty/serial/earlycon.c
> @@ -240,6 +240,7 @@ int __init of_setup_earlycon(const struct earlycon_id 
> *match,
>  {
> int err;
> struct uart_port *port = &early_console_dev.port;
> +   unsigned long baud;
> const __be32 *val;
> bool big_endian;
> u64 addr;
> @@ -282,7 +283,15 @@ int __init of_setup_earlycon(const struct earlycon_id 
> *match,
> }
> }
>
> +   val = of_get_flat_dt_prop(node, "baud", NULL);

No, we already have a defined way to set the baud, we don't need a
property in addition. Plus you didn't document it.

> +   if (val)
> +   early_console_dev.baud = be32_to_cpu(*val);
> +
> if (options) {
> +   err = kstrtoul(options, 10, &baud);
> +   if (!err)
> +   early_console_dev.baud = baud;

This seems fine to do here, but then we should also parse the other
standard options here too. And we should make sure we're not doing it
twice.

> +
> strlcpy(early_console_dev.options, options,
> sizeof(early_console_dev.options));
> }
> --
> 2.9.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

[PATCH 0/3 v8] hsdk: initial port for HSDK board

2017-08-15 Thread Eugeniy Paltsev
This series introduces some required preparations and initial
port of ARC HS Development Kit board with some basic features such
as serial port, USB, SD/MMC and Ethernet.

Essentially we run Linux kernel on all 4 cores (i.e. utilize SMP) and
heavily use IO Coherency for speeding-up DMA-aware peripherals.

Note as opposed to other ARC boards we link Linux kernel to
0x9000_ intentionally because cores 1 and 3 configured with DCCM
situated at our more usual link base 0x8000_.

Note that two patches of this series ("ARC: Decouple linux kernel memory
address and link address" and "ARC: Set IO-coherency aperture base to 
LINUX_LINK_BASE") are prerequisites for HDSK support as its hardware
configuration differs quite a bit from what we used to have on other
ARC boards.

Alexey Brodkin (1):
  ARC: hsdk: initial port for HSDK board

Eugeniy Paltsev (2):
  ARC: Set IO-coherency aperture base to LINUX_LINK_BASE
  ARC: Decouple linux kernel memory address and link address

Changes v8 -> v9:
 * Revert removing of ARC_PLAT_HSDK (now it is called ARC_SOC_HSDK)
   as it breaks uniprocessor configuation build.
 * Enable INPUT_EVDEV in hsdk_defconfig as it is required for 
   user-space apps to work with keyboard/mice

Changes v7 -> v8:
 * DTS: move cpu_intc, idu_intc, arcpct, timer, gfrc nodes to root
   level and out of the cpus node.
 * DTS: add vendor-specific compatible for ohci and ehci nodes.
 * DTS: style fixes

Changes v6 -> v7:
 * DTS: get rid of skeleton.dts, move cpus nodes to hsdk.dts
 * DTS: style fixes
 * Enable loadable modules, module unloading and NFS client as defaults
 * Get rid of ARC_PLAT_HSDK board config option

Changes v5 -> v6:
 * Add support of USB-to-HDMI adapter
 * Revert removing of resetting CREG_PAE bits.
   PAE remapping for DMA clients does not work due to an RTL bug, so
   CREG_PAE register must be programmed to all zeroes, otherwise it
   will cause problems with DMA to/from peripherals even if PAE40 is
   not used.

Changes v4 -> v5:
 * Move DCCM outside of 0x8000_ adress at kernel boot time.
 * Decouple linux kernel memory address and link address.
 * Remove hardcoding of IO-coherency aperture base.
 * Remove resetting CREG_PAE bits as default value is suitable for us.

Changes v3 -> v4:
 * Removed senseless "ranges" property from "memory" node in .dts
 * Refined early-boot code:
- ICCM relocation should be done on each and every core that sports ICCM
  so we leave it in init_per_cpu(). Even though init_per_cpu() gets called
  on the master core pretty late still it is way much earlier than that
  moment when it might affect us - as it only huts us when addresses in
  0x7z-0x7fff_ range are used, i.e. virtual addresses that we don't
  use during init. This also makes code much cleaner compared to
  additional check in case of master etc.

Changes v2 -> v3:
 * Added Rob to Cc-list for DT binding approval
 * Removed mention of prerequsite patch from commit message
 * Removed hsdk_early_init() as hsdk_init_per_cpu() is executed on
   all cores anyways including master
 * Cleaned-up board's .dts a little bit
 * Removed CONFIG_DP83867_PHY from defconfig as it was only used on
   FPGA prototype, on real board we use MICREL PHY which is still selected

Changes v1 -> v2:
 * Update copyright year from 2016 to more up to date 2017
 * Merge early UART clock with AXS10x as in both cases that's 33.3 MHz
 * Bump memory to 1Gb, we don't use more for now because it requires
   trickier IOC setup and usage
 * Update early platform init code:
- Added missing fixup_pae_regs() to per-cpu init
- Mark most of functions as "static __init"
- Use writel_relaxed() for setting CREG_PAE, CREG_PAE_UPDATE is still
  written with stronger writel() since we don't want reordering to happen,
  otherwise value written to CREG_PAE won't be applied

 Documentation/devicetree/bindings/arc/hsdk.txt |   7 ++
 arch/arc/Kconfig   |   6 +
 arch/arc/Makefile  |   1 +
 arch/arc/boot/dts/hsdk.dts | 150 +
 arch/arc/boot/dts/include/dt-bindings  |   1 +
 arch/arc/configs/hsdk_defconfig|  72 
 arch/arc/include/asm/page.h|   2 +-
 arch/arc/kernel/devtree.c  |   5 +-
 arch/arc/mm/cache.c|  33 --
 arch/arc/mm/init.c |   6 +-
 arch/arc/plat-hsdk/Kconfig |  12 ++
 arch/arc/plat-hsdk/Makefile|   9 ++
 arch/arc/plat-hsdk/platform.c  |  77 +
 13 files changed, 366 insertions(+), 15 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arc/hsdk.txt
 create mode 100644 arch/arc/boot/dts/hsdk.dts
 create mode 12 arch/arc/boot/dts/include/dt-bindings
 create mode 100644 arch/arc/configs/hsdk_defconfig
 create mode 100644 arch/arc/plat-hsdk/Kconfig
 create mode 100644 a

[PATCH 3/3] ARC: hsdk: initial port for HSDK board

2017-08-15 Thread Eugeniy Paltsev
From: Alexey Brodkin 

This initial port adds support of ARC HS Development Kit board with some
basic features such serial port, USB, SD/MMC and Ethernet.

Essentially we run Linux kernel on all 4 cores (i.e. utilize SMP) and
heavily use IO Coherency for speeding-up DMA-aware peripherals.

Note as opposed to other ARC boards we link Linux kernel to
0x9000_ intentionally because cores 1 and 3 configured with DCCM
situated at our more usual link base 0x8000_. We still can use
memory region starting at 0x8000_ as we reallocate DCCM in our
platform code.

Note that PAE remapping for DMA clients does not work due to an RTL bug,
so CREG_PAE register must be programmed to all zeroes, otherwise it will
cause problems with DMA to/from peripherals even if PAE40 is not used.

Acked-by: Rob Herring 
Signed-off-by: Alexey Brodkin 
Signed-off-by: Eugeniy Paltsev 
---
Changes v8 -> v9:
 * Revert removing of ARC_PLAT_HSDK (now it is called ARC_SOC_HSDK)
   as it breaks uniprocessor configuation build.
 * Enable INPUT_EVDEV in hsdk_defconfig as it is required for 
   user-space apps to work with keyboard/mice

 Documentation/devicetree/bindings/arc/hsdk.txt |   7 +
 arch/arc/Kconfig   |   1 +
 arch/arc/Makefile  |   1 +
 arch/arc/boot/dts/hsdk.dts | 189 +
 arch/arc/configs/hsdk_defconfig|  80 +++
 arch/arc/kernel/devtree.c  |   5 +-
 arch/arc/plat-hsdk/Kconfig |   9 ++
 arch/arc/plat-hsdk/Makefile|   9 ++
 arch/arc/plat-hsdk/platform.c  |  79 +++
 9 files changed, 378 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arc/hsdk.txt
 create mode 100644 arch/arc/boot/dts/hsdk.dts
 create mode 100644 arch/arc/configs/hsdk_defconfig
 create mode 100644 arch/arc/plat-hsdk/Kconfig
 create mode 100644 arch/arc/plat-hsdk/Makefile
 create mode 100644 arch/arc/plat-hsdk/platform.c

diff --git a/Documentation/devicetree/bindings/arc/hsdk.txt 
b/Documentation/devicetree/bindings/arc/hsdk.txt
new file mode 100644
index 000..be50654
--- /dev/null
+++ b/Documentation/devicetree/bindings/arc/hsdk.txt
@@ -0,0 +1,7 @@
+Synopsys DesignWare ARC HS Development Kit Device Tree Bindings
+---
+
+ARC HSDK Board with quad-core ARC HS38x4 in silicon.
+
+Required root node properties:
+- compatible = "snps,hsdk";
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 75e5276..825a112 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -101,6 +101,7 @@ source "arch/arc/plat-tb10x/Kconfig"
 source "arch/arc/plat-axs10x/Kconfig"
 #New platform adds here
 source "arch/arc/plat-eznps/Kconfig"
+source "arch/arc/plat-hsdk/Kconfig"
 
 endmenu
 
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index 44ef35d..e81f2bd 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -111,6 +111,7 @@ core-$(CONFIG_ARC_PLAT_SIM) += arch/arc/plat-sim/
 core-$(CONFIG_ARC_PLAT_TB10X)  += arch/arc/plat-tb10x/
 core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/plat-axs10x/
 core-$(CONFIG_ARC_PLAT_EZNPS)  += arch/arc/plat-eznps/
+core-$(CONFIG_ARC_SOC_HSDK)+= arch/arc/plat-hsdk/
 
 ifdef CONFIG_ARC_PLAT_EZNPS
 KBUILD_CPPFLAGS += -I$(srctree)/arch/arc/plat-eznps/include
diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts
new file mode 100644
index 000..e096879
--- /dev/null
+++ b/arch/arc/boot/dts/hsdk.dts
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * Device Tree for ARC HS Development Kit
+ */
+/dts-v1/;
+
+#include 
+
+/ {
+   model = "snps,hsdk";
+   compatible = "snps,hsdk";
+
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   chosen {
+   bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8 
console=ttyS0,115200n8 debug print-fatal-signals=1";
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   cpu@0 {
+   device_type = "cpu";
+   compatible = "snps,archs38";
+   reg = <0>;
+   clocks = <&core_clk>;
+   };
+
+   cpu@1 {
+   device_type = "cpu";
+   compatible = "snps,archs38";
+   reg = <1>;
+   clocks = <&core_clk>;
+   };
+
+   cpu@2 {
+   device_type = "cpu";
+   compatible = "snps,archs38";
+   reg = <2>;
+   clocks = <&core_clk>;
+   };
+
+   cpu@3 {
+   

[PATCH 1/3] ARC: Set IO-coherency aperture base to LINUX_LINK_BASE

2017-08-15 Thread Eugeniy Paltsev
Most of the time we indeed use the one and only LINUX_LINK_BASE
set to 0x8000_. But there might be good reasons to move
the kernel to another location like 0x9z etc.

And we want IOC aperture to cover entire area used by the kernel,
so let's make its base matching link base and add required asserts:
checking IOC aperture base address and size to be supported by IOC.

Signed-off-by: Eugeniy Paltsev 
---
 arch/arc/mm/cache.c | 33 -
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c
index a867575..383ff77 100644
--- a/arch/arc/mm/cache.c
+++ b/arch/arc/mm/cache.c
@@ -1083,7 +1083,8 @@ SYSCALL_DEFINE3(cacheflush, uint32_t, start, uint32_t, 
sz, uint32_t, flags)
  */
 noinline void __init arc_ioc_setup(void)
 {
-   unsigned int ap_sz;
+   unsigned int ap_base;
+   long ap_size;
 
/* Flush + invalidate + disable L1 dcache */
__dc_disable();
@@ -1092,18 +1093,32 @@ noinline void __init arc_ioc_setup(void)
if (read_aux_reg(ARC_REG_SLC_BCR))
slc_entire_op(OP_FLUSH_N_INV);
 
-   /* IOC Aperture start: TDB: handle non default CONFIG_LINUX_LINK_BASE */
-   write_aux_reg(ARC_REG_IO_COH_AP0_BASE, 0x8);
-
/*
-* IOC Aperture size:
-*   decoded as 2 ^ (SIZE + 2) KB: so setting 0x11 implies 512M
-* TBD: fix for PGU + 1GB of low mem
+* IOC Aperture size is equal to memory size.
+* TBD: fix for PGU + 1GiB of low mem
 * TBD: fix for PAE
 */
-   ap_sz = order_base_2(arc_get_mem_sz()/1024) - 2;
-   write_aux_reg(ARC_REG_IO_COH_AP0_SIZE, ap_sz);
+   ap_size = arc_get_mem_sz();
+
+   if (!is_power_of_2(ap_size) || ap_size < 4096)
+   panic("IOC Aperture size must be power of 2 larger than 4KiB");
+
+   /*
+* IOC Aperture size decoded as 2 ^ (SIZE + 2) KiB,
+* so setting 0x11 implies 512MiB, 0x12 implies 1G...
+*/
+   write_aux_reg(ARC_REG_IO_COH_AP0_SIZE, order_base_2(ap_size / 1024) - 
2);
+
+   /*
+* For now we assume IOC aperture to cover all the memory used by the
+* kernel.
+*/
+   ap_base = CONFIG_LINUX_LINK_BASE;
+
+   if (ap_base % ap_size != 0)
+   panic("IOC Aperture start must be aligned to the size of the 
aperture");
 
+   write_aux_reg(ARC_REG_IO_COH_AP0_BASE, ap_base >> 12);
write_aux_reg(ARC_REG_IO_COH_PARTIAL, 1);
write_aux_reg(ARC_REG_IO_COH_ENABLE, 1);
 
-- 
2.9.3


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH 2/3] ARC: Decouple linux kernel memory address and link address

2017-08-15 Thread Eugeniy Paltsev
We faced with problem when we tried to utilize 1G DRAM by linux on
HSDK.

We can't use our usual kernel memory address (0x8000) like on
AXS103 because of DCCM memory bank located at exactly same
address (0x8000)
But we can't simply move kernel memory address to another address (like
0x9000) because IOC base address must be aligned to the
size of the aperture as specified in the IOC size register.

So we had to use 1G aligned address for kernel memory.

We can't use 0x or 0x4000 addresses because addresses
lover then 0x8000 are MMU-translated.
We can't use 0xB000 address because we can define a volatile
uncached region only from AUX_NON_VOLATILE_LIMIT to the
0x. (the end of region is hardcoded)

So, the decision is to link kernel to 0x9000, but use
0x8000-0xBFFF memory region and reallocate DCCM in our platform
code.
This patch only makes possible to set kernel memory address not equal to
kernel link address.

Signed-off-by: Eugeniy Paltsev 
---
 arch/arc/Kconfig| 5 +
 arch/arc/include/asm/page.h | 2 +-
 arch/arc/mm/cache.c | 2 +-
 arch/arc/mm/init.c  | 6 +++---
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index a545969..75e5276 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -430,6 +430,11 @@ config LINUX_LINK_BASE
  However some customers have peripherals mapped at this addr, so
  Linux needs to be scooted a bit.
  If you don't know what the above means, leave this setting alone.
+
+config KERNEL_RAM_BASE_ADDRESS
+   hex "Linux ram base address"
+   default LINUX_LINK_BASE
+   help
  This needs to match memory start address specified in Device Tree
 
 config HIGHMEM
diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h
index 296c342..777f676 100644
--- a/arch/arc/include/asm/page.h
+++ b/arch/arc/include/asm/page.h
@@ -85,7 +85,7 @@ typedef pte_t * pgtable_t;
  */
 #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
 
-#define ARCH_PFN_OFFSETvirt_to_pfn(CONFIG_LINUX_LINK_BASE)
+#define ARCH_PFN_OFFSET
virt_to_pfn(CONFIG_KERNEL_RAM_BASE_ADDRESS)
 
 #ifdef CONFIG_FLATMEM
 #define pfn_valid(pfn) (((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c
index 383ff77..f303274 100644
--- a/arch/arc/mm/cache.c
+++ b/arch/arc/mm/cache.c
@@ -1113,7 +1113,7 @@ noinline void __init arc_ioc_setup(void)
 * For now we assume IOC aperture to cover all the memory used by the
 * kernel.
 */
-   ap_base = CONFIG_LINUX_LINK_BASE;
+   ap_base = CONFIG_KERNEL_RAM_BASE_ADDRESS;
 
if (ap_base % ap_size != 0)
panic("IOC Aperture start must be aligned to the size of the 
aperture");
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index 8c9415e..f84cba2 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -26,7 +26,7 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD] __aligned(PAGE_SIZE);
 char empty_zero_page[PAGE_SIZE] __aligned(PAGE_SIZE);
 EXPORT_SYMBOL(empty_zero_page);
 
-static const unsigned long low_mem_start = CONFIG_LINUX_LINK_BASE;
+static const unsigned long low_mem_start = CONFIG_KERNEL_RAM_BASE_ADDRESS;
 static unsigned long low_mem_sz;
 
 #ifdef CONFIG_HIGHMEM
@@ -63,7 +63,7 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
 
if (!low_mem_sz) {
if (base != low_mem_start)
-   panic("CONFIG_LINUX_LINK_BASE != DT memory { }");
+   panic("CONFIG_KERNEL_RAM_BASE_ADDRESS != DT memory { 
}");
 
low_mem_sz = size;
in_use = 1;
@@ -161,7 +161,7 @@ void __init setup_arch_memory(void)
 * We can't use the helper free_area_init(zones[]) because it uses
 * PAGE_OFFSET to compute the @min_low_pfn which would be wrong
 * when our kernel doesn't start at PAGE_OFFSET, i.e.
-* PAGE_OFFSET != CONFIG_LINUX_LINK_BASE
+* PAGE_OFFSET != CONFIG_KERNEL_RAM_BASE_ADDRESS
 */
free_area_init_node(0,  /* node-id */
zones_size, /* num pages per zone */
-- 
2.9.3


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH] hsdk: Enable INPUT_EVDEV

2017-08-15 Thread Eugeniy Paltsev
I'll add this to 
[PATCH 3/3 v9] ARC: hsdk: initial port for HSDK board

On Tue, 2017-08-15 at 20:12 +0300, Alexey Brodkin wrote:
> This is required for user-space apps to work with keyboard/mice.
> 
> Signed-off-by: Alexey Brodkin 
> Cc: Eugeniy Paltsev 
> ---
>  arch/arc/configs/hsdk_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arc/configs/hsdk_defconfig
> b/arch/arc/configs/hsdk_defconfig
> index f4190bcde594..b3d21277608c 100644
> --- a/arch/arc/configs/hsdk_defconfig
> +++ b/arch/arc/configs/hsdk_defconfig
> @@ -37,6 +37,7 @@ CONFIG_BLK_DEV_SD=y
>  CONFIG_NETDEVICES=y
>  CONFIG_STMMAC_ETH=y
>  CONFIG_MICREL_PHY=y
> +CONFIG_INPUT_EVDEV=y
>  # CONFIG_INPUT_KEYBOARD is not set
>  # CONFIG_INPUT_MOUSE is not set
>  # CONFIG_SERIO is not set
-- 
 Eugeniy Paltsev
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

[PATCH] earlycon: initialise baud field of earlycon device structure

2017-08-15 Thread Eugeniy Paltsev
For now baud field of earlycon structure device is't initialised at all
in of_setup_earlycon (in oppositе to register_earlycon).

So when I use stdout-path to point earlycon device
(like stdout-path = &serial or stdout-path = "serial:115200n8")
baud field of earlycon device structure remains uninitialised and
earlycon initialization is not performed correctly as
of_setup_earlycon is used.
When pass all arguments via bootargs
(like bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8")
initialization is performed correctly as register_earlycon is used.

So initialise baud field of earlycon device structure by baud value
from device tree or from options (if they exist) when we use
of_setup_earlycon

Signed-off-by: Eugeniy Paltsev 
---
 drivers/tty/serial/earlycon.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index c365154..6c2e2b6 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -240,6 +240,7 @@ int __init of_setup_earlycon(const struct earlycon_id 
*match,
 {
int err;
struct uart_port *port = &early_console_dev.port;
+   unsigned long baud;
const __be32 *val;
bool big_endian;
u64 addr;
@@ -282,7 +283,15 @@ int __init of_setup_earlycon(const struct earlycon_id 
*match,
}
}
 
+   val = of_get_flat_dt_prop(node, "baud", NULL);
+   if (val)
+   early_console_dev.baud = be32_to_cpu(*val);
+
if (options) {
+   err = kstrtoul(options, 10, &baud);
+   if (!err)
+   early_console_dev.baud = baud;
+
strlcpy(early_console_dev.options, options,
sizeof(early_console_dev.options));
}
-- 
2.9.3


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

[PATCH] hsdk: Enable INPUT_EVDEV

2017-08-15 Thread Alexey Brodkin
This is required for user-space apps to work with keyboard/mice.

Signed-off-by: Alexey Brodkin 
Cc: Eugeniy Paltsev 
---
 arch/arc/configs/hsdk_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig
index f4190bcde594..b3d21277608c 100644
--- a/arch/arc/configs/hsdk_defconfig
+++ b/arch/arc/configs/hsdk_defconfig
@@ -37,6 +37,7 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
 CONFIG_STMMAC_ETH=y
 CONFIG_MICREL_PHY=y
+CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
-- 
2.11.0


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc