[linux-sunxi] Re: Jpeg Encoding

2015-12-17 Thread Thomas Kaiser
Martin wrote:
>
> I know this is a quite old thread, but I would like to implement jpeg 
> thumbnail encoding in XMBC (since jpeg HW decoding is working now), but 
> gitorious has closed down and therefore the link 
> https://gitorious.org/recedro/jepoc 
> is no longer working. 
> Is this proof of concept for JPEG encoding on Allwinner A10/A20 anywhere 
> else available?
>

http://web.archive.org/web/20150101165922/https://gitorious.org/recedro/jepoc/source/78eb98d731467cef2804ba250c9fa5462240fed2

Regards,

Thomas

-- 
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: Jpeg Encoding

2015-12-17 Thread Martin
Manuel Braga  writes:

> 
> > there is no possibility for jpeg-encoding,is it?
> 
> Yes there is, the hardware supports jpeg baseline encoding, maximum
> 4080x4080, this is the same type for mjpeg.
> 
> And it is already almost complete reverse engineered, only misses some
> checks in rounding values in the quantization step.
> https://gitorious.org/recedro/jepoc
> Of course this is a prof of concept, only a test to confirming how the
> hardware works. But all that is need is there.
> 
I know this is a quite old thread, but I would like to implement jpeg
thumbnail encoding in XMBC (since jpeg HW decoding is working now), but
gitorious has closed down and therefore the link
https://gitorious.org/recedro/jepoc
is no longer working.
Is this proof of concept for JPEG encoding on Allwinner A10/A20 anywhere
else available?

Martin



-- 
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: Jpeg Encoding

2015-12-17 Thread Manuel Braga
Hello.

On Thu, 17 Dec 2015 15:30:44 + (UTC) Martin 
wrote:
> Manuel Braga  writes:
> 
> > 
> > > there is no possibility for jpeg-encoding,is it?
> > 
> > Yes there is, the hardware supports jpeg baseline encoding, maximum
> > 4080x4080, this is the same type for mjpeg.
> > 
> > And it is already almost complete reverse engineered, only misses
> > some checks in rounding values in the quantization step.
> > https://gitorious.org/recedro/jepoc
> > Of course this is a prof of concept, only a test to confirming how
> > the hardware works. But all that is need is there.
> > 
> I know this is a quite old thread, but I would like to implement jpeg
> thumbnail encoding in XMBC (since jpeg HW decoding is working now),

This is interesting, is the work(source) available somewhere?


> but gitorious has closed down and therefore the link
> https://gitorious.org/recedro/jepoc
> is no longer working.
> Is this proof of concept for JPEG encoding on Allwinner A10/A20
> anywhere else available?

http://dl.linux-sunxi.org/users/nove/jepoc.tar.gz
Until a new place is found, a tarball should suffice.

But as you well are aware, this a proof of concept with the function to
prove that we understand how to use this hardware. And only that.

It is not recommend to use this for any other function.


The correct solution is to work for a proper driver for this video
engine, and then work with the upstream people to assure proper
support for the (random) software.


But, it is seen that majority of the hardware vendors and its users are
more interested to run around binaries blob with license ambiguity
issues.
Than to support the work this community (linux-sunxi) is doing.

And off course with this unfavorable conditions, is natural this work
for an 100% free-and-open-source proper driver is not at the level of
advance that we all wish it to be.

If only if.

-- 
Manuel Braga

-- 
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] fel-sdboot.sunxi problems on Cubietruck and A20-OLinuXino-MICRO

2015-12-17 Thread Piotr Król
Hi all,
I'm trying to enter FEL mode by using SD card image provided in
sunxi-tools. I follow procedure:

http://linux-sunxi.org/FEL#Through_a_special_SD_card_image

it doesn't seem to work as expected. Booting process stall. It doesn't
not proceed through boot order, so this seems to be ok. But FEL tool
cannot communicate with device and there is no logs in Linux dmesg
showing that new USB device was detected. So I assume device didn't
enter FEL.

Running FEL mode using button works fine, but I would like to validate
procedures that can work without FEL/Recovery button.

What I tried:

* Cubietruck and A20-OLinuXino-MICRO
* toolchains (Linaro 2014.07, 2015.05)
* different order of power on and inserting USB cable
* SD cards (Samsung, SanDisk, Kingston)
* enter using UART method:
  http://linux-sunxi.org/FEL#Through_serial_console

Can someone confirm that this feature ever worked with mentioned boards?

Have you got any ideas what may be wrong or how to enter FEL without
button ?

Best Regards,
-- 
Piotr Król
Embedded Systems Consultant
http://3mdeb.com | @3mdeb_com

-- 
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 v5 0/2] spi: dts: sun4i: Add support for wait time between word transmissions

2015-12-17 Thread Marcus Weseloh
Hi all,

This patch set adds a new property "spi-word-wait-ns" to the spi-bus
binding that allows SPI slave devices to set a wait time between the
transmission of words. Modifies the spi_device struct and slave device
probing to read and store the new property.

Also modifies the sun4i SPI master driver to make use of the new property.
This specific SPI controller needs 3 clock cycles to set up the delay,
which makes the minimum non-zero wait time on this hardware 4 clock cycles.

Changes from v1:
 * renamed the property for more clarity
 * wait time is set in nanoseconds instead of number of clock cycles
 * transparently handle the 3 setup clock cycles

 Changes from v2:
 * fixed typo in comment
 * moved parameter to spi-bus binding, dropping the vendor prefix
 * changed commit summary and description to reflect the changes

 Changes from v3:
 * remove reference to "hardware" in comments and description, as the wait
   time could also be implemented in software
 * read and set property value in spi core

 Changes from v4:
 * log with dev_dbg instead of dev_info
 * split patch into two separate ones for SPI-core and sun4i parts


Marcus Weseloh (2):
  spi: dts: Add new device property to specifcy a wait time between word
transmissions
  spi: sun4i: Add support for wait time between word transmissions

 Documentation/devicetree/bindings/spi/spi-bus.txt |  2 ++
 drivers/spi/spi-sun4i.c   | 22 ++
 drivers/spi/spi.c |  2 ++
 include/linux/spi/spi.h   |  2 ++
 4 files changed, 28 insertions(+)

-- 
1.9.1

-- 
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 v5 1/2] spi: dts: Add new device property to specifcy a wait time between word transmissions

2015-12-17 Thread Marcus Weseloh
Adds a new property "spi-word-wait-ns" to the spi-bus binding that allows
SPI slave devices to set a wait time between the transmission of words.

Signed-off-by: Marcus Weseloh 
---
 Documentation/devicetree/bindings/spi/spi-bus.txt | 2 ++
 drivers/spi/spi.c | 2 ++
 include/linux/spi/spi.h   | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt 
b/Documentation/devicetree/bindings/spi/spi-bus.txt
index bbaa857..434d321 100644
--- a/Documentation/devicetree/bindings/spi/spi-bus.txt
+++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
@@ -61,6 +61,8 @@ contain the following properties.
   used for MOSI. Defaults to 1 if not present.
 - spi-rx-bus-width - (optional) The bus width(number of data wires) that
   used for MISO. Defaults to 1 if not present.
+- spi-word-wait-ns - (optional) Delay between transmission of words
+  in nanoseconds
 
 Some SPI controllers and devices support Dual and Quad SPI transfer mode.
 It allows data in the SPI system to be transferred in 2 wires(DUAL) or 4 
wires(QUAD).
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 2b0a8ec..186373b 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1467,6 +1467,8 @@ of_register_spi_device(struct spi_master *master, struct 
device_node *nc)
if (of_find_property(nc, "spi-lsb-first", NULL))
spi->mode |= SPI_LSB_FIRST;
 
+   of_property_read_u32(nc, "spi-word-wait-ns", >word_wait_ns);
+
/* Device DUAL/QUAD mode */
if (!of_property_read_u32(nc, "spi-tx-bus-width", )) {
switch (value) {
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index cce80e6..ea3037f 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -118,6 +118,7 @@ void spi_statistics_add_transfer_stats(struct 
spi_statistics *stats,
  * for driver coldplugging, and in uevents used for hotplugging
  * @cs_gpio: gpio number of the chipselect line (optional, -ENOENT when
  * when not using a GPIO line)
+ * @word_wait_ns: A wait time between word transfers in nanoseconds
  *
  * @statistics: statistics for the spi_device
  *
@@ -158,6 +159,7 @@ struct spi_device {
void*controller_data;
charmodalias[SPI_NAME_SIZE];
int cs_gpio;/* chip select gpio */
+   u32 word_wait_ns;   /* wait time between words */
 
/* the statistics */
struct spi_statistics   statistics;
-- 
1.9.1

-- 
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 v4] spi: dts: sun4i: Add support for wait time between word transmissions

2015-12-17 Thread Marcus Weseloh
Hi Maxime,

2015-12-16 11:39 GMT+01:00 Maxime Ripard :
> It looks mostly fine, however, please try to make only one thing in
> one patch.
>
> In this case, it would mean having one patch to add the DT property
> and support in the SPI core in a first one, and then add support for
> it in your driver.

Will do.

> I also have a minor comment below
[...]
>> + if (spi->word_wait_ns) {
>> + clk_ns = DIV_ROUND_UP(10, tfr->speed_hz);
>> + wait_clk = DIV_ROUND_UP(spi->word_wait_ns, clk_ns) - 3;
>> + if (wait_clk < 1) {
>> + wait_clk = 1;
>> + dev_info(>dev,
>> +  "using minimum of 4 word wait cycles (%uns)",
>> +  4 * clk_ns);
>
> Logging it at the info loglevel seems a bit too high. debug seems more
> appropriate.

I will change it to debug and send a new version.

Thanks for the review!

Marcus

-- 
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 v5 2/2] spi: sun4i: Add support for wait time between word transmissions

2015-12-17 Thread Marcus Weseloh
Modifies the sun4i SPI master driver to make use of the
"spi-word-wait-ns" property. This specific SPI controller needs 3 clock
cycles to set up the delay, which makes the minimum non-zero wait time
on this hardware 4 clock cycles.

Signed-off-by: Marcus Weseloh 
---
 drivers/spi/spi-sun4i.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index f60a6d6..3b4f5f4 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -173,6 +174,8 @@ static int sun4i_spi_transfer_one(struct spi_master *master,
unsigned int tx_len = 0;
int ret = 0;
u32 reg;
+   int wait_clk = 0;
+   int clk_ns = 0;
 
/* We don't support transfer larger than the FIFO */
if (tfr->len > SUN4I_FIFO_DEPTH)
@@ -261,6 +264,25 @@ static int sun4i_spi_transfer_one(struct spi_master 
*master,
 
sun4i_spi_write(sspi, SUN4I_CLK_CTL_REG, reg);
 
+   /*
+* Setup wait time between words.
+*
+* Wait time is set in SPI_CLK cycles. The SPI hardware needs 3
+* additional cycles to setup the wait counter, so the minimum delay
+* time is 4 cycles.
+*/
+   if (spi->word_wait_ns) {
+   clk_ns = DIV_ROUND_UP(10, tfr->speed_hz);
+   wait_clk = DIV_ROUND_UP(spi->word_wait_ns, clk_ns) - 3;
+   if (wait_clk < 1) {
+   wait_clk = 1;
+   dev_dbg(>dev,
+   "using minimum of 4 word wait cycles (%uns)",
+   4 * clk_ns);
+   }
+   }
+   sun4i_spi_write(sspi, SUN4I_WAIT_REG, (u16)wait_clk);
+
/* Setup the transfer now... */
if (sspi->tx_buf)
tx_len = tfr->len;
-- 
1.9.1

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