[linux-sunxi] Re: A20 mainline kernel questions

2015-08-30 Thread Andrea Venturi


Il giorno domenica 30 agosto 2015 13:55:14 UTC+2, Alexis Jeandet ha scritto:
>
> Hi Andrea,
>
> Indeed my song is mono, so that may explain the issue.
>
>
ok
 

> I also continued to investigate the code from Marcus, which if I 
> understood correctly, is based on your code. I got some successful results 
> also with this code. I think that Marcus wanted to merge the two structures 
> sunxi_priv 
> and sunxi_i2s_info and remove the sunxi_iis instance. 
>


yes; the sunxi_iis is a leftover of the original legacy AW driver and the 
useful fields should be folded into the "private" data structure of the 
relevant  alsa module.


> There is still some points I don't get yet, if I understand correctly the 
> UDA is supposed to generate the sysclock with it's own PLL from bclk? 
>

IIRC it's a PLL from the "left right" clock (ie frame rate 44.1 or 48 KHz) 
and the proper UDA register is set when there's WSPLL=1 on device tree..
 

> Then you have to set the multiplication factor on the UDA? For each song? 
>

for earch sample rate.. 
 

> Or you just set it to 256 or 128fs and then just focus on i2s interface? 
> In this case 24 bits resolution wouldn't be possible? 
>

the bit clock is a multiple of the FS changing when you have different bit 
resolutions.
 

> Don't understand yet what ALSA does exactly, and I didn't check what is 
> done on i2c side.
>
> Best regards,
> Alexis.
>

-- 
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 sunxi-tools 5/6] fel: Make the SPL load address configurable instead of hardcoded 0x0

2015-08-30 Thread Ian Campbell
On Sat, 2015-08-29 at 09:33 +0300, Siarhei Siamashka wrote:
> Add a new field 'spl_addr' to the SoC description structure and adjust
> the code to honor it. This is needed for supporting Allwinner A80.
> 
> Tested on Allwinner A20 by changing the 'spl_addr' to 0x28000 in the
> 'fel' tool and using a custom build of U-Boot (CONFIG_SPL_TEXT_BASE
> changed from 0x20 to 0x28020).
> 
> Signed-off-by: Siarhei Siamashka 
> ---
>  fel-to-spl-thunk.S | 22 ++
>  fel-to-spl-thunk.h | 89 
> ++
>  fel.c  | 29 ++
>  3 files changed, 70 insertions(+), 70 deletions(-)
> 
> diff --git a/fel-to-spl-thunk.S b/fel-to-spl-thunk.S
> index fb5dfde..e3fa6f2 100644
> --- a/fel-to-spl-thunk.S
> +++ b/fel-to-spl-thunk.S
> @@ -69,6 +69,7 @@ SWAPTBL>>   > .req> > r4
>  FULLSIZE>> .req> > r5
>  BUFSIZE> >   > .req> > r6
>  CHECKSUM>> .req> > r7
> +SPL_ADDR>> .req> > r8
>  
>  entry_point:
>  >> b>> setup_stack
> @@ -87,7 +88,7 @@ stack_end:
>  
>  >> /* A function, which walks the table and swaps all buffers */
>  swap_all_buffers:
> ->> adr>  > SWAPTBL,   swaptbl_start
> +>> adr>  > SWAPTBL,   appended_data + 4
>  swap_next_buffer:
>  >> ldr>  > BUF1,  [SWAPTBL],  #4
>  >> ldr>  > BUF2,  [SWAPTBL],  #4
> @@ -104,6 +105,7 @@ swap_next_word:
>  >> b>> swap_next_buffer
>  
>  setup_stack: /* Save the original SP, LR and CPSR to stack */
> +>> ldr>  > SPL_ADDR,  appended_data
>  >> adr>  > BUF1,  stack_end
>  >> str>  > sp,[BUF1, #-4]!
>  >> mov>  > sp,BUF1
> @@ -125,7 +127,7 @@ setup_stack: /* Save the original SP, LR and CPSR to 
> stack */
>  verify_checksum:
>  >> movw> > CHECKSUM,  #0x6c39
>  >> movt> > CHECKSUM,  #0x5f0a
> ->> mov>  > BUF1,  #0
> +>> mov>  > BUF1,  SPL_ADDR
>  >> ldr FULLSIZE,  [BUF1, #16]
>  check_next_word:
>  >> ldr>  > TMP1,  [BUF1],   #4
> @@ -133,39 +135,35 @@ check_next_word:
>  >> add>  > CHECKSUM,  CHECKSUM, TMP1
>  >> bne>  > check_next_word
>  
> ->> mov>  > BUF1,  #0
> ->> ldr>  > TMP1,  [BUF1, #12]
> +>> ldr>  > TMP1,  [SPL_ADDR, #12]
>  >> subs> > CHECKSUM,  CHECKSUM, TMP1, lsl #1
>  >> bne>  > checksum_is_bad
>  
>  >> /* Change 'eGON.BT0' -> 'eGON.FEL' */
> ->> mov>  > BUF1,  #0
>  >> movw> > TMP1,  (('F' << 8) + '.')
>  >> movt> > TMP1,  (('L' << 8) + 'E')
> ->> str>  > TMP1,  [BUF1, #8]
> +>> str>  > TMP1,  [SPL_ADDR, #8]
>  
>  >> /* Call the SPL code */
>  >> dsb
>  >> isb
> ->> blx>  > BUF1
> +>> blx>  > SPL_ADDR
>  
>  >> /* Return back to FEL */
>  >> b>> return_to_fel
>  
>  cache_is_unsupported:
>  >> /* Bail out if cache is enabled and change 'eGON.BT0' -> 'eGON.???' */
> ->> mov>  > BUF1,  #0
>  >> movw> > TMP1,  (('?' << 8) + '.')
>  >> movt> > TMP1,  (('?' << 8) + '?')
> ->> str>  > TMP1,  [BUF1, #8]
> +>> str>  > TMP1,  [SPL_ADDR, #8]
>  >> b>> return_to_fel_noswap
>  
>  checksum_is_bad:
>  >> /* The checksum test failed, so change 'eGON.BT0' -> 'eGON.BAD' */
> ->> mov>  > BUF1,  #0
>  >> movw> > TMP1,  (('B' << 8) + '.')
>  >> movt> > TMP1,  (('D' << 8) + 'A')
> ->> str>  > TMP1,  [BUF1, #8]
> +>> str>  > TMP1,  [SPL_ADDR, #8]
>  
>  return_to_fel:
>  >> bl>   > swap_all_buffers
> @@ -175,4 +173,4 @@ return_to_fel_noswap:
>  >> ldr sp,[sp]
>  >> bx>   > lr
>  
> -swaptbl_start:
> +appended_data:

If I'm reading correctly you've changed things so that there is an
implicit data structure present here, namely the spl addr followed by
the swaptbl (as before).

I think this would be clearer if it were explicit, can you do:
spl_addr:
.word 0 /* Filled in by fel tool */
swaptbl_start:

or does something prevent this? I suppose it would make the thunk
appear larger are require accessing from C with END-N rather than
END+N, which might be undesirable.

If it isn't possible/desirable maybe just a comment describing what
should live here and/or some #define's for the offsets would be useful?

Doing asm-offset.S style tricks to let the C and ASM code use a shared
data structure is probably overkill at this point, but might be worth
considering if this grows more fields.

Ian.

-- 
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: A20 mainline kernel questions

2015-08-30 Thread Alexis Jeandet
Hi Andrea,

Indeed my song is mono, so that may explain the issue.

I also continued to investigate the code from Marcus, which if I understood 
correctly, is based on your code. I got some successful results also with 
this code. I think that Marcus wanted to merge the two structures sunxi_priv 
and sunxi_i2s_info and remove the sunxi_iis instance. 

There is still some points I don't get yet, if I understand correctly the 
UDA is supposed to generate the sysclock with it's own PLL from bclk? Then 
you have to set the multiplication factor on the UDA? For each song? Or you 
just set it to 256 or 128fs and then just focus on i2s interface? In this 
case 24 bits resolution wouldn't be possible? Don't understand yet what 
ALSA does exactly, and I didn't check what is done on i2c side.

Best regards,
Alexis.

-- 
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 sunxi-tools 0/6] Fixes which should provide "fel spl" command support for A80

2015-08-30 Thread Hans de Goede

Hi,

On 29-08-15 08:33, Siarhei Siamashka wrote:

This is a set of patches, which are intended to eventually support booting
Allwinner A80 over USB with the "fel spl" and "fel uboot" commands.

The memory map in Allwinner A80 differs from all the other known
Allwinner SoC variant. The SPL (or BOOT0) load location is now moved
to 0x1 from 0x0, which means that we can't have this address
hardcoded in the 'fel' tool, but need to make it configurable.

Additionally, "fel: Report FEL stack pointers" improves diagnostic
messages by reporting the stack locations. Also "fel-to-spl-thunk.S:
Fix safety guard which checks for enabled cache" and "Makefile:
'fel' tool depends on fel-to-spl-thunk.h" provide fixes for a few
minor problems, discovered when working on this code.

The last patch "fel: add fel spl support for A80" has not been
fully tested on real A80 hardware yet (to boot at least the SD card
variant of BOOT0), so it should not be applied until somebody
confirms that it actually works.


Siarhei Siamashka (6):
   fel: Report FEL stack pointers
   fel: get rid of the FEL_EXEC_SCRATCH_AREA constant
   fel-to-spl-thunk.S: Fix safety guard which checks for enabled cache
   Makefile: 'fel' tool depends on fel-to-spl-thunk.h
   fel: Make the SPL load address configurable instead of hardcoded 0x0
   fel: add fel spl support for A80


The entire series looks good to me and is:

Acked-by: Hans de Goede 

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 sunxi-tools 1/2] README: Remove the obsolete 'usb-boot' script

2015-08-30 Thread Hans de Goede

Hi,

On 30-08-15 01:25, Siarhei Siamashka wrote:

It was designed to be used with the legacy u-boot-sunxi
bootloader and has many assumptions, which are specific to
it (a special FEL configuration, hardcoded addresses, etc.)

The mainline U-Boot can now be booted over USB with the
"fel uboot u-boot-sunxi-with-spl.bin" command. And this
makes the old 'usb-boot' script obsolete.

The presence of the 'usb-boot' script in the repository may
confuse the users, so we are removing it now. The users of the
old u-boot-sunxi bootloader still can always get this script
from one of the old sunxi-tools tags.

Signed-off-by: Siarhei Siamashka 
---
  README   |  7 ++---
  usb-boot | 91 
  2 files changed, 2 insertions(+), 96 deletions(-)
  delete mode 100755 usb-boot



The entire series looks good to me and is:

Acked-by: Hans de Goede 

Regards,

Hans




diff --git a/README b/README
index e71933f..02747cd 100644
--- a/README
+++ b/README
@@ -24,11 +24,8 @@ fex2bin:
  fel:
script interface for talking to the FEL USB handler built in to
th CPU. You activate FEL mode by pushing the usboot/recovery
-   button at poweron.
-
-usb-boot:
-   Simple wrapper to automate USB booting in FEL mode
-   See http://linux-sunxi.org/FEL/USBBoot for details
+   button at poweron. See http://linux-sunxi.org/FEL/USBBoot for
+   a detailed usage guide.

  fel-gpio:
Simple wrapper around fel-pio and fel to allos GPIO manipulations
diff --git a/usb-boot b/usb-boot
deleted file mode 100755
index 3881d29..000
--- a/usb-boot
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh -e
-
-# Copyright (C) 2013  Henrik Nordstrom 
-#
-# 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.
-
-top=`dirname $0`
-if [ $# -lt 2 ]; then
-   echo "Usage: $0 u-boot-spl.bin u-boot.bin [boot.scr] [kernel script.bin 
[initramfs]]"
-   exit 1
-fi
-board=$1; shift || (echo "ERROR: u-boot-spl.bin must be specified"; exit 1;)
-uboot=$1; shift || (echo "ERROR: u-boot.bin must be specified"; exit 1;)
-bootscr=$top/felboot/ramboot.scr
-if [ ! -f $bootscr ]; then
-   bootscr=$top/bin/ramboot.scr
-fi
-case "$1" in
-*.scr) bootscr="$1"; shift
-   ;;
-esac
-if [ $# -ge 1 ]; then
-   kernel=$1; shift || true
-fi
-if [ $# -ge 1 ]; then
-   scriptbin=$1; shift || true
-fi
-if [ $# -ge 1 ]; then
-   initramfs=$1; shift || true
-fi
-fel() {
-   echo fel "$@"
-   $top/fel $@
-}
-case $board in
-*/*)   felboot=$board
-   ;;
-*)
-   felboot=$top/felboot/fel-boot-${board}.bin
-   if [ ! -f $felboot ]; then
-   felboot=$top/bin/fel-boot-${board}.bin
-   fi
-   ;;
-esac
-if [ ! -f $felboot ]; then
-   echo "ERROR: Can't find SPL FEL binary ${board}"
-   exit 1
-fi
-if [ `wc -c $felboot | cut '-d ' -f1` -gt 15616 ]; then
-   echo "ERROR: SPL FEL binary too large. Must be the FEL version of SPL"
-   exit 1
-fi
-if [ ! -f $bootscr ]; then
-   echo "ERROR: Can't find boot script '${bootscr}'"
-   exit 1
-fi
-fel write 0x2000 $felboot
-fel exe 0x2000
-sleep 1 # Wait for DRAM initialization to complete
-if [ -n "$uboot" ]; then
-   fel write 0x4a00 $uboot
-fi
-if [ -n "$bootscr" ]; then
-   fel write 0x4100 $bootscr
-fi
-if [ -n "$kernel" ]; then
- if [ -n "$scriptbin" ]; then
-  fel write 0x4300 $scriptbin
- fi
- fel write 0x4400 $kernel
- if [ -n "$initramfs" ]; then
-  fel write 0x4c00 $initramfs
- fi
-fi
-fel exe 0x4a00



--
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: A20 mainline kernel questions

2015-08-30 Thread Andrea Venturi


Il giorno venerdì 28 agosto 2015 15:11:47 UTC+2, Alexis Jeandet ha scritto:
>
> Hi Andrea,
>
> Good news! I can hear some sounds :).
>

good!
 

> After some discussions with Marcus I've checked I2S pins with logic 
> analyser, the data where at the output but really fast (340kS/s). I decided 
> to replace the I2S driver from Marcus 
>  repo  with your code(only 
> sunxi-i2s.c plus sunxi.h). At least I can hear sound, it still refuse to 
> play 32 bits wave file(with aply) and my sample is read at twice the 
> speed(looks like mickey mouse) but it works! 
>

is your sample a mono (single channel) one?

i had the "speed doubling" when i tested a mono wav file. i suppose there's 
a bug as it's still sending samples to two channels. so the speed is 
doubled..
  

> With the sample you provided it works at nominal speed, I think(not easy 
> to say).
>

you are right. my sample indeed has no "words spoken" so it's not easy to 
say... but if you feel good and inspired listening to it, so it's working 
ok ! :-)

bye

andrea
 

> If you are interested here are the screenshots of what I saw with Marcus 
> patch:
>
> https://www.dropbox.com/s/t2cn38hl5aywwiz/Capture%20d%27%C3%A9cran%20de%202015-08-27%2014-18-08.png?dl=0
>
> As a conclusion, on Marcus repo I2C works but something broke on I2S code.
>
> Best regards,
> Alexis.
>

-- 
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: Banana pi BPI-M2 uboot 2015-7 and kernel 4.1.6 test

2015-08-30 Thread Thomas Kaiser
lion wang wrote:
>
> BPI team have test linux kernel 4.1.6 on BPI-M1,BPI-M1+,BPI-M2,BPI-M3
>

Where's the M3 stuff?

And I would assume the only bit of interest inside your forked kernel is 
one single file (since everything else already worked before and you didn't 
change a single line of code). The device tree definition for the M2 (that 
not you developed but a community member instead):

https://github.com/BPI-SINOVOIP/BPI-Mainline-kernel/blob/master/arch/arm/boot/dts/sun6i-a31s-bananapi-m2.dts

-- 
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.