Re: [PATCH v6 2/3] spi: sun4i: Fix clock calculations to be predictable and never exceed the requested rate

2015-12-28 Thread Marcus Weseloh
Hi again, 2015-12-28 0:29 GMT+01:00 Marcus Weseloh : > 2015-12-27 22:09 GMT+01:00 Maxime Ripard : [...] > [...] >>> - /* Ensure that we have a parent clock fast enough */ >>> + /* >>> + * Ensure that the parent clock is set to

Re: [PATCH v6 2/3] spi: sun4i: Fix clock calculations to be predictable and never exceed the requested rate

2015-12-27 Thread Maxime Ripard
On Sat, Dec 26, 2015 at 04:53:05PM +0100, Marcus Weseloh wrote: > This patch fixes multiple problems with the current clock calculations: > > 1. The A10/A20 datasheet contains the formula AHB_CLK / (2^(n+1)) to > calculate SPI_CLK from CDR1, but this formula is wrong. The actual > formula -

Re: [PATCH v6 2/3] spi: sun4i: Fix clock calculations to be predictable and never exceed the requested rate

2015-12-27 Thread Marcus Weseloh
Hi, 2015-12-27 22:09 GMT+01:00 Maxime Ripard : > On Sat, Dec 26, 2015 at 04:53:05PM +0100, Marcus Weseloh wrote: >> This patch fixes multiple problems with the current clock calculations: >> >> 1. The A10/A20 datasheet contains the formula AHB_CLK / (2^(n+1)) to

[PATCH v6 2/3] spi: sun4i: Fix clock calculations to be predictable and never exceed the requested rate

2015-12-26 Thread Marcus Weseloh
This patch fixes multiple problems with the current clock calculations: 1. The A10/A20 datasheet contains the formula AHB_CLK / (2^(n+1)) to calculate SPI_CLK from CDR1, but this formula is wrong. The actual formula - determined by analyzing the actual waveforms - is AHB_CLK / (2^n). 2. The