[linux-sunxi] Linux 3.4.103 A20 IR pulse width

2014-12-20 Thread dannym
Hello,

since I've seen some activity on the list with people doing IR drivers, I 
figured maybe someone knows what's up with the following:

I tried to use Linux 3.4.103 and a lirc Linux kernel module from 
 on an A20 connected to ir0_rx, which is 
connected (with 50 cm cable) to an IR detector module by Vishay (TSOP) and a 
capacitor in parallel, with script.fex like this:

[ir_para]
ir_used = 1
ir0_tx = port:PB03<2>
ir0_rx = port:PB04<2>

I adapted it to print more debugging messages, so it ends up as 
.

Highlevel LIRC doesn't seem to work then with any remote or IR keyboard I 
tried. 

So I tried the lowlevel mode2 and filtered it through 
 in order to make it 
readable, and this shows the following (I pressed the same remote button, "1", 
multiple times):

#   #   ##    ###  #
###  #   # E
#    #######   #
# E
#   #   #   ##   ## 
##### E
#### ###### 
#  #  # ## E
#   #   #   ######
###### E
## ##   ####  ##
###### E
#####  ##  #
##  ###   ### E
###### #### #   
  ###   # E
#   ## ###   ###   #
##   #   # E
#   #######   #
##   #   ## E
#### #  
   ###   ##### E
######  ###   #  # #
 ###   ###   # E
###### ##   
 ## ##   E
###    # ###  # 
###   ## ### E
#   #   ###   #   
  ## E
### # ###   #   
  ###  ###  #    # E
#  ### ######   
  # # #   ##  E
#####   # ###   
  ##   #### E
##   ####   
 ###   ### E
### # ###   
  #### #  ## # E
## ####   ###   
  # ## E
# ## ###
 #   ### ## E
##   #   ###  ####   # 
# ## E
#   #   ###   ###   #
###   #### E
### ## ###  
   ### # E
## ## ##
 ### # E
## #    #   
# ###   E

Pressing and releasing the "1" button once is

### ##  ###  #
   ##  ##  # E
######  # ## ###  
#  ### ##  E
#  ###  ###   ## ##
### # E
######  # ##  ###   
 ##  ### # E
##   

[linux-sunxi] linux-sunxi/u-boot-sunxi is no longer supported, time to switch to upstream u-boot

2014-12-20 Thread Hans de Goede

Hi All,

There are 3 topics which I would like to cover in this mail:

1) Switching over to upstream u-boot for the linux-sunxi project
2) How to build upstream u-boot for use with linux-sunxi sunxi-3.4 kernels
3) Adding more boards to upstream u-boot


1. Switching over to upstream u-boot for the linux-sunxi project


Upstream u-boot has had sunxi support for a while now, and has slowly been
gaining a lot of features over the linux-sunxi/u-boot-sunxi version at:
https://github.com/linux-sunxi/u-boot-sunxi/

Some of the new features supported upstream are booting from usb, booting from
sata (ahci) and full sun6i (A31) support including SPL support. Also upstream
u-boot supports using hdmi out + an usb keyboard as u-boot console, so that
one does not need to solder a serial console to things like hdmi tv-dongles.

Upstream u-boot also has full sun8i (A23) support in the pipeline including
SPL support.

One of the things which has stopped people from switching to upstream u-boot
so far is that upstream u-boot did not work with the linux-sunxi sunxi-3.4
kernels, but current upstream u-boot git master:
http://git.denx.de/?p=u-boot.git;a=summary

Now also has support for booting older kernels, so it is time that we
stop maintaining linux-sunxi/u-boot-sunxi and start focussing all our
efforts on upstream u-boot.


2. How to build upstream u-boot for use with linux-sunxi sunxi-3.4 kernels
==

Here are some example instructions on how to build upstream u-boot for
the Cubietruck:

git clone git://git.denx.de/u-boot.git
cd u-boot
make -j4 CROSS_COMPILE=arm-linux-gnu- Cubietruck_defconfig
# If you want to use an upstream kernel the next steps can be skipped (*)
make -j4 CROSS_COMPILE=arm-linux-gnu- menuconfig
#  select "ARM architecture" -> "Enable workarounds for booting old kernels"
#  exit & save
make -j4 CROSS_COMPILE=arm-linux-gnu- spl/menuconfig
#  select "ARM architecture" -> "Enable workarounds for booting old kernels"
#  exit & save
# skip to here if you're using an upstream kernel
make -j4 CROSS_COMPILE=arm-linux-gnu-

And now you will have a u-boot-sunxi-with-spl.bin to dd to your sdcard as
usual.

If you look in the upstream configs directory you will already find
defconfig files for a lot of popular boards there, replace
Cubietruck_defconfig with the one for your board to build u-boot for your
board.

See below for instructions on how to add a new board if your board is
missing.

*) These steps can be skipped too when using sun4i (A10) or sun5i (A10s / A13)
with a current linux-sunxi/stage/sunxi-3.4 kernel.


3. Adding more boards to upstream u-boot


If you own a board which is already supported in linux-sunxi/u-boot-sunxi,
and is not yet upstream, please add support for it, there are 3 simple steps
to add a new board to upstream u-boot, see below. If you've any trouble with
this, but are willing to be listed as a contact person for this board let me
know and I'll create a patch adding the board for you to test.

1) Add the dram_foo.c file for your board from
linux-sunxi/u-boot-sunxi/board/sunxi to upstream u-boot/board/sunxi and add a
line for it to u-boot/board/sunxi/Makefile, see existing lines there for how
this should look.

2) Create a configs/foo_defconfig file for your board, take a look at
configs/Cubietruck_defconfig for an example, typically all the options
found in linux-sunxi/u-boot-sunxi/boards.cfg for the board go in the
CONFIG_SYS_EXTRA_OPTIONS field, except for the boardname define, which
gets replaced with a line like this:

+S:CONFIG_TARGET_CUBIETRUCK=y

3) Add an entry for the board to board/sunxi/MAINTAINERS, with yourself as
contact person for the board. For upstream u-boot we want to have a contact
person for each supported board, so that users have someone to mail who owns
the actual board in case of questions. This is also why we've not simply
copied all the boards from linux-sunxi/u-boot-sunxi to upstream u-boot.

Regards,

Hans

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v2 01/11] clk: sunxi: Add mod0 and mmc module clock support for A80

2014-12-20 Thread Chen-Yu Tsai
Hi,

On Sat, Dec 20, 2014 at 2:02 AM, Maxime Ripard
 wrote:
> Hi Chen-Yu,
>
> On Thu, Dec 18, 2014 at 03:00:48PM +0800, Chen-Yu Tsai wrote:
>> The module 0 style clocks, or storage module clocks as named in the
>> official SDK, are almost the same as the module 0 clocks on earlier
>> Allwinner SoCs. The only difference is wider mux register bits.
>>
>> As with earlier Allwinner SoCs, mmc module clocks are a special case
>> of mod0 clocks, with phase controls for 2 child clocks, output and
>> sample.
>>
>> This patch adds support for both.
>>
>> Signed-off-by: Chen-Yu Tsai 
>> ---
>>  Documentation/devicetree/bindings/clock/sunxi.txt |  7 +-
>>  drivers/clk/sunxi/clk-mod0.c  | 99 
>> +++
>>  2 files changed, 104 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt 
>> b/Documentation/devicetree/bindings/clock/sunxi.txt
>> index 8c60433..b660bdb 100644
>> --- a/Documentation/devicetree/bindings/clock/sunxi.txt
>> +++ b/Documentation/devicetree/bindings/clock/sunxi.txt
>> @@ -56,7 +56,9 @@ Required properties:
>>   "allwinner,sun8i-a23-apb2-gates-clk" - for the APB2 gates on A23
>>   "allwinner,sun5i-a13-mbus-clk" - for the MBUS clock on A13
>>   "allwinner,sun4i-a10-mmc-clk" - for the MMC clock
>> + "allwinner,sun9i-a80-mmc-clk" - for mmc module clocks on A80
>>   "allwinner,sun4i-a10-mod0-clk" - for the module 0 family of clocks
>> + "allwinner,sun9i-a80-mod0-clk" - for module 0 (storage) clocks on A80
>>   "allwinner,sun8i-a23-mbus-clk" - for the MBUS clock on A23
>>   "allwinner,sun7i-a20-out-clk" - for the external output clocks
>>   "allwinner,sun7i-a20-gmac-clk" - for the GMAC clock module on A20/A31
>> @@ -72,7 +74,8 @@ Required properties for all clocks:
>>  - #clock-cells : from common clock binding; shall be set to 0 except for
>>   the following compatibles where it shall be set to 1:
>>   "allwinner,*-gates-clk", "allwinner,sun4i-pll5-clk",
>> - "allwinner,sun4i-pll6-clk", "allwinner,sun6i-a31-pll6-clk"
>> + "allwinner,sun4i-pll6-clk", "allwinner,sun6i-a31-pll6-clk",
>> + "allwinner,*-usb-clk", "allwinner,*-mmc-clk"
>>  - clock-output-names : shall be the corresponding names of the outputs.
>>   If the clock module only has one output, the name shall be the
>>   module name.
>> @@ -94,7 +97,7 @@ For "allwinner,sun6i-a31-pll6-clk", there are 2 outputs. 
>> The first output
>>  is the normal PLL6 output, or "pll6". The second output is rate doubled
>>  PLL6, or "pll6x2".
>>
>> -The "allwinner,sun4i-a10-mmc-clk" has three different outputs: the
>> +The "allwinner,*-mmc-clk" clocks have three different outputs: the
>>  main clock, with the ID 0, and the output and sample clocks, with the
>>  IDs 1 and 2, respectively.
>>
>> diff --git a/drivers/clk/sunxi/clk-mod0.c b/drivers/clk/sunxi/clk-mod0.c
>> index 4ac52c7..ef36e89 100644
>> --- a/drivers/clk/sunxi/clk-mod0.c
>> +++ b/drivers/clk/sunxi/clk-mod0.c
>> @@ -93,6 +93,30 @@ static void __init sun4i_a10_mod0_setup(struct 
>> device_node *node)
>>  }
>>  CLK_OF_DECLARE(sun4i_a10_mod0, "allwinner,sun4i-a10-mod0-clk", 
>> sun4i_a10_mod0_setup);
>>
>> +static const struct factors_data sun9i_a80_mod0_data __initconst = {
>> + .enable = 31,
>> + .mux = 24,
>> + .muxmask = BIT(3) | BIT(2) | BIT(1) | BIT(0),
>> + .table = &sun4i_a10_mod0_config,
>> + .getter = sun4i_a10_get_mod0_factors,
>> +};
>> +
>> +static void __init sun9i_a80_mod0_setup(struct device_node *node)
>> +{
>> + void __iomem *reg;
>> +
>> + reg = of_io_request_and_map(node, 0, of_node_full_name(node));
>> + if (!reg) {
>> + pr_err("Could not get registers for mod0-clk: %s\n",
>> +node->name);
>> + return;
>> + }
>> +
>> + sunxi_factors_register(node, &sun9i_a80_mod0_data,
>> +&sun4i_a10_mod0_lock, reg);
>> +}
>> +CLK_OF_DECLARE(sun9i_a80_mod0, "allwinner,sun9i-a80-mod0-clk", 
>> sun9i_a80_mod0_setup);
>> +
>>  static DEFINE_SPINLOCK(sun5i_a13_mbus_lock);
>>
>>  static void __init sun5i_a13_mbus_setup(struct device_node *node)
>> @@ -309,3 +333,78 @@ err_free_data:
>>   kfree(clk_data);
>>  }
>>  CLK_OF_DECLARE(sun4i_a10_mmc, "allwinner,sun4i-a10-mmc-clk", 
>> sun4i_a10_mmc_setup);
>> +
>> +static DEFINE_SPINLOCK(sun9i_a80_mmc_lock);
>> +
>> +static void __init sun9i_a80_mmc_setup(struct device_node *node)
>> +{
>> + struct clk_onecell_data *clk_data;
>> + const char *parent;
>> + void __iomem *reg;
>> + int i;
>> +
>> + reg = of_io_request_and_map(node, 0, of_node_full_name(node));
>> + if (IS_ERR(reg)) {
>> + pr_err("Couldn't map the %s clock registers\n", node->name);
>> + return;
>> + }
>> +
>> + clk_data = kmalloc(sizeof(*clk_data), GFP_KERNEL);
>> + if (!clk_data)
>> + return;
>> +
>> + clk_data->clks = kcalloc(3, sizeof(*clk_data->clks), GFP_KERNEL);

Re: [linux-sunxi] Re: Is it possible to select kernel on boot ?

2014-12-20 Thread Gerardo Di Iorio
hi, with uboot mainline uboot you can use menu like lilo grub
See the option extlinux
My /boot/extlinux/extlinux.conf basically contains this:

menu title LIME2 boot menu
timeout 10
ontimeout linux
LABEL linux
KERNEL /boot/zImage
fdt /boot/sun7i-a20-olinuxino-lime2.dtb
append root=/dev/mmcblk0p1 console=ttyS0,115200 ro rootwait


An exmple image with select menu for hdmi and/or serial
check this page
https://github.com/ssvb/sunxi-bootsetup/releases/tag/20141215-sunxi-bootsetup-prototype

regards


2014-12-20 10:56 GMT+01:00 Bruno Prémont :

> Hi,
>
> On Fri, 19 December 2014 nilsnu...@gmail.com wrote:
> > I use lilo on x86/64 PC from 2002.
> > Why it doesnt work on allwinner ? What is the problem ?
> >
> > > I want try mainline kernel, is it possible to select kernel on boot ?
> > > Something similar to lilo\grub.
>
> Lilo has its core bootloader part written in x86 assembler and also
> depends on BIOS interface to work. So it's not compatible with uboot
> (nor EFI on PCs!).
>
>
> You can select different kernels from uboot if you want. It will
> not provide you with a nice graphical kernel selector but you can
> load the kernel you want from uboot command line (similar to what
> you would do in grub command line).
> With proper uboot scripting you can e.g. select the kernel based on
> status of GPIO lines (or pressed buttons).
>
> Bruno
>
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v3] input: Add new sun4i-lradc-keys driver

2014-12-20 Thread Hans de Goede

Hi Dmitry,

On 18-12-14 18:51, Dmitry Torokhov wrote:

Hi Hans,

On Thu, Dec 18, 2014 at 11:23:13AM +0100, Hans de Goede wrote:

Allwinnner sunxi SoCs have a low resolution adc (called lradc) which is
specifically designed to have various (tablet) keys (ie home, back, search,
etc). attached to it using a resistor network. This adds a driver for this.

There are 2 channels, currently this driver only supports chan0 since there
are no boards known to use chan1.

This has been tested on an olimex a10s-olinuxino-micro, a13-olinuxino, and
a20-olinuxino-micro.

Signed-off-by: Hans de Goede 
--
Changes in v2:
-Change devicetree bindings to use a per key subnode, like gpio-keys does
Changes in v3:
-Handle keyup irq flag before irqdown, in case we get both at once


Thank you for making changes. Can you please tell me if the driver still
works if you drop the patch below on top of it? The changes are:

- split DT parsing into a separate function;
- make sure keymap is not empty;
- change 'ret' variable to 'error';


The proposed changes look good, and I've given them a test-spin and everything
still works fine.

Thanks & Regards,

Hans

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] [PATCH v3] clk: sunxi: Make the mod0 clk driver also a platform driver

2014-12-20 Thread Hans de Goede
With the prcm in sun6i (and some later SoCs) some mod0 clocks are instantiated
through the mfd framework, and as such do not work with of_clk_declare, since
they do not have registers assigned to them yet at of_clk_declare init time.

Silence the error on not finding registers in the of_clk_declare mod0 clk
setup method, and also register mod0-clk support as a platform driver to work
properly with mfd instantiated mod0 clocks.

Signed-off-by: Hans de Goede 
---
Changes in v2:
-New patch in v2 of the sun6i ir support patch-set
Changes in v3:
-Add a comment why sun4i_a10_mod0_setup does not log an error when of_iomap
 fails to get the regs
---
 drivers/clk/sunxi/clk-mod0.c | 43 ---
 1 file changed, 40 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/sunxi/clk-mod0.c b/drivers/clk/sunxi/clk-mod0.c
index 658d74f..bf8fcd8 100644
--- a/drivers/clk/sunxi/clk-mod0.c
+++ b/drivers/clk/sunxi/clk-mod0.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "clk-factors.h"
 
@@ -67,7 +68,7 @@ static struct clk_factors_config sun4i_a10_mod0_config = {
.pwidth = 2,
 };
 
-static const struct factors_data sun4i_a10_mod0_data __initconst = {
+static const struct factors_data sun4i_a10_mod0_data = {
.enable = 31,
.mux = 24,
.muxmask = BIT(1) | BIT(0),
@@ -83,8 +84,11 @@ static void __init sun4i_a10_mod0_setup(struct device_node 
*node)
 
reg = of_iomap(node, 0);
if (!reg) {
-   pr_err("Could not get registers for mod0-clk: %s\n",
-  node->name);
+   /*
+* This happens with mod0 clk nodes instantiated through
+* mfd, as those do not have their resources assigned at
+* CLK_OF_DECLARE time yet, so do not print an error.
+*/
return;
}
 
@@ -93,6 +97,39 @@ static void __init sun4i_a10_mod0_setup(struct device_node 
*node)
 }
 CLK_OF_DECLARE(sun4i_a10_mod0, "allwinner,sun4i-a10-mod0-clk", 
sun4i_a10_mod0_setup);
 
+static int sun4i_a10_mod0_clk_probe(struct platform_device *pdev)
+{
+   struct device_node *np = pdev->dev.of_node;
+   struct resource *r;
+   void __iomem *reg;
+
+   if (!np)
+   return -ENODEV;
+
+   r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   reg = devm_ioremap_resource(&pdev->dev, r);
+   if (IS_ERR(reg))
+   return PTR_ERR(reg);
+
+   sunxi_factors_register(np, &sun4i_a10_mod0_data,
+  &sun4i_a10_mod0_lock, reg);
+   return 0;
+}
+
+static const struct of_device_id sun4i_a10_mod0_clk_dt_ids[] = {
+   { .compatible = "allwinner,sun4i-a10-mod0-clk" },
+   { /* sentinel */ }
+};
+
+static struct platform_driver sun4i_a10_mod0_clk_driver = {
+   .driver = {
+   .name = "sun4i-a10-mod0-clk",
+   .of_match_table = sun4i_a10_mod0_clk_dt_ids,
+   },
+   .probe = sun4i_a10_mod0_clk_probe,
+};
+module_platform_driver(sun4i_a10_mod0_clk_driver);
+
 static DEFINE_SPINLOCK(sun5i_a13_mbus_lock);
 
 static void __init sun5i_a13_mbus_setup(struct device_node *node)
-- 
2.1.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v2 06/13] clk: sunxi: Make the mod0 clk driver also a platform driver

2014-12-20 Thread Hans de Goede

Hi,

On 19-12-14 19:24, Maxime Ripard wrote:

Hi,

On Wed, Dec 17, 2014 at 06:18:17PM +0100, Hans de Goede wrote:

With the prcm in sun6i (and some later SoCs) some mod0 clocks are instantiated
through the mfd framework, and as such do not work with of_clk_declare, since
they do not have registers assigned to them yet at of_clk_declare init time.

Silence the error on not finding registers in the of_clk_declare mod0 clk
setup method, and also register mod0-clk support as a platform driver to work
properly with mfd instantiated mod0 clocks.

Signed-off-by: Hans de Goede 
---
  drivers/clk/sunxi/clk-mod0.c | 41 -
  1 file changed, 36 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/sunxi/clk-mod0.c b/drivers/clk/sunxi/clk-mod0.c
index 658d74f..7ddab6f 100644
--- a/drivers/clk/sunxi/clk-mod0.c
+++ b/drivers/clk/sunxi/clk-mod0.c
@@ -17,6 +17,7 @@
  #include 
  #include 
  #include 
+#include 

  #include "clk-factors.h"

@@ -67,7 +68,7 @@ static struct clk_factors_config sun4i_a10_mod0_config = {
.pwidth = 2,
  };

-static const struct factors_data sun4i_a10_mod0_data __initconst = {
+static const struct factors_data sun4i_a10_mod0_data = {
.enable = 31,
.mux = 24,
.muxmask = BIT(1) | BIT(0),
@@ -82,17 +83,47 @@ static void __init sun4i_a10_mod0_setup(struct device_node 
*node)
void __iomem *reg;

reg = of_iomap(node, 0);
-   if (!reg) {
-   pr_err("Could not get registers for mod0-clk: %s\n",
-  node->name);
+   if (!reg)
return;
-   }


A comment here would be nice to mention that this is intentional.


Ok, I'll respin this patch adding such a comment.

Regards,

Hans

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v2 12/13] ARM: dts: sun6i: Add sun6i-a31s.dtsi

2014-12-20 Thread Hans de Goede

Hi,

On 19-12-14 19:34, Maxime Ripard wrote:

On Wed, Dec 17, 2014 at 06:18:23PM +0100, Hans de Goede wrote:

Add a dtsi file for A31s based boards.

Since the  A31s is the same die as the A31 in a different package, this dtsi
simply includes sun6i-a31.dtsi and then overrides the pinctrl compatible to
reflect the different package, everything else is identical.

Signed-off-by: Hans de Goede 
---
Changes in v2:
-include sun6i-a31.dtsi and override the pinctrl compatible, rather then
  copying everything
---
  arch/arm/boot/dts/sun6i-a31s.dtsi | 62 +++
  1 file changed, 62 insertions(+)
  create mode 100644 arch/arm/boot/dts/sun6i-a31s.dtsi

diff --git a/arch/arm/boot/dts/sun6i-a31s.dtsi 
b/arch/arm/boot/dts/sun6i-a31s.dtsi
new file mode 100644
index 000..d0bd2b9
--- /dev/null
+++ b/arch/arm/boot/dts/sun6i-a31s.dtsi
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2014 Hans de Goede 
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ *
+ * 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.
+ */
+
+/*
+ * The A31s is the same die as the A31 in a different package, this is
+ * reflected by it having different pinctrl compatible everything else is
+ * identical.
+ */
+
+/include/ "sun6i-a31.dtsi"
+
+/ {
+   soc@01c0 {
+   pio: pinctrl@01c20800 {
+   compatible = "allwinner,sun6i-a31s-pinctrl";
+   };
+   };
+};


Given your previous changes, you should also update the enable-method.


I've not added a new compatible for the enable-method, given that
this is the exact same die, so the 2 are 100?% compatible, just like you
insisted that "allwinner,sun4i-a10-mod0-clk" should be used for the ir-clk
since it was 100% compatible to that I believe that the enable method
should use the existing compatible and not invent a new one for something
which is 100% compatible.


Also, for this patch and the next one, Arnd just warned me that we
shouldn't duplicate the DT path, and that we should switch to the new
trend on using label references (like what TI or Amlogic does for
example).


Ok, so something like this, right ?  :

&pio {
compatible = "allwinner,sun6i-a31s-pinctrl";
};

Once we've agreement on the enable-method I'll respin this patch and
the CSQ CS908 board patch.

Regards,

Hans

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [PATCH v2 04/13] rc: sunxi-cir: Add support for an optional reset controller

2014-12-20 Thread Hans de Goede

Hi,

On 19-12-14 19:17, Maxime Ripard wrote:

Hi,

On Thu, Dec 18, 2014 at 09:50:26AM +0100, Hans de Goede wrote:

Hi,

On 18-12-14 03:48, Chen-Yu Tsai wrote:

Hi,

On Thu, Dec 18, 2014 at 1:18 AM, Hans de Goede  wrote:

On sun6i the cir block is attached to the reset controller, add support
for de-asserting the reset if a reset controller is specified in dt.

Signed-off-by: Hans de Goede 
Acked-by: Mauro Carvalho Chehab 
Acked-by: Maxime Ripard 
---
  .../devicetree/bindings/media/sunxi-ir.txt |  2 ++
  drivers/media/rc/sunxi-cir.c   | 25 --
  2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/sunxi-ir.txt 
b/Documentation/devicetree/bindings/media/sunxi-ir.txt
index 23dd5ad..6b70b9b 100644
--- a/Documentation/devicetree/bindings/media/sunxi-ir.txt
+++ b/Documentation/devicetree/bindings/media/sunxi-ir.txt
@@ -10,6 +10,7 @@ Required properties:

  Optional properties:
  - linux,rc-map-name : Remote control map name.
+- resets : phandle + reset specifier pair


Should it be optional? Or should we use a sun6i compatible with
a mandatory reset phandle? I mean, the driver/hardware is not
going to work with the reset missing on sun6i.

Seems we are doing it one way for some of our drivers, and
the other (optional) way for more generic ones, like USB.


I do not believe that we should add a new compatible just because
the reset line of a block is hooked up differently. It is the
exact same ip-block. Only now the reset is not controlled
through the apb-gate, but controlled separately.


He has a point though. Your driver might very well probe nicely and
everything, but still wouldn't be functional at all because the reset
line wouldn't have been specified in the DT.


Right, just like other drivers we've, see e.g.:

Documentation/devicetree/bindings/mmc/sunxi-mmc.txt

Which is dealing with this in the same way.


The easiest way to deal with that would be in the bindings doc to
update it with a compatible for the A31, and mentionning that the
reset property is mandatory there.


No the easiest way to deal with this is to expect people writing
the dts to know what they are doing, just like we do for a lot
of the other blocks in sun6i.

Maybe put a generic note somewhere that sun6i has a reset controller,
and that for all the blocks with optional resets property it should
be considered mandatory on sun6i ?

I'm sorry but I'm not going to make this change for the ir bindings
given that we've the same situation in a lot of other places.

Consistency is important. Moreover I believe that having a sun6i
specific compatible string is just wrong, since it is the exact
same hardware block as on sun5i, just with its reset line routed
differently, just like e.g. the mmc controller, the uarts or the gmac
all of which also do not have a sun6i specific compatible to enforce
reset controller usage.

Regards,

Hans




Note that the code itself might not change at all though. I'd just
like to avoid any potential breaking of the DT bindings themselves. If
we further want to refine the code, we can do that however we want.

I have a slight preference for a clean error if reset is missing, but
I won't get in the way just for that.

Maxime



--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: Is it possible to select kernel on boot ?

2014-12-20 Thread Bruno Prémont
Hi,

On Fri, 19 December 2014 nilsnu...@gmail.com wrote:
> I use lilo on x86/64 PC from 2002.
> Why it doesnt work on allwinner ? What is the problem ?
> 
> > I want try mainline kernel, is it possible to select kernel on boot ? 
> > Something similar to lilo\grub.

Lilo has its core bootloader part written in x86 assembler and also
depends on BIOS interface to work. So it's not compatible with uboot
(nor EFI on PCs!).


You can select different kernels from uboot if you want. It will
not provide you with a nice graphical kernel selector but you can
load the kernel you want from uboot command line (similar to what
you would do in grub command line).
With proper uboot scripting you can e.g. select the kernel based on
status of GPIO lines (or pressed buttons).

Bruno

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.