* Re: [1/2, v9] powerpc/mpc85xx:Add initial device tree support of T104x
From: Prabhakar Kushwaha @ 2014-04-06 13:18 UTC (permalink / raw)
To: Scott Wood; +Cc: Varun Sethi, Poonam Aggrwal, linuxppc-dev, Priyanka Jain
In-Reply-To: <20140319223334.GA28875@home.buserror.net>
On 3/20/2014 4:03 AM, Scott Wood wrote:
> On Sat, Jan 25, 2014 at 05:10:59PM +0530, Prabhakar Kushwaha wrote:
>> + corenet-cf@18000 {
>> + compatible = "fsl,corenet-cf";
>> + reg = <0x18000 0x1000>;
>> + interrupts = <16 2 1 31>;
>> + fsl,ccf-num-csdids = <32>;
>> + fsl,ccf-num-snoopids = <32>;
>> + };
> I know this isn't a new problem, but this needs a binding -- and a
> different compatible from p4080-era CCF. AFAICT it's a completely
> different programming model, and even the block version registers weren't
> present in the original version.
No binding present for corenet-cf looks like new binding needs to be
sent with possible compatabile.
>> +/include/ "qoriq-mpic.dtsi"
>> +
>> + guts: global-utilities@e0000 {
>> + compatible = "fsl,t1040-device-config", "fsl,qoriq-device-config-2.0";
>> + reg = <0xe0000 0xe00>;
>> + fsl,has-rstcr;
>> + fsl,liodn-bits = <12>;
>> + };
>> +
>> + clockgen: global-utilities@e1000 {
>> + compatible = "fsl,t1040-clockgen", "fsl,qoriq-clockgen-2.0",
>> + "fixed-clock";
>> + ranges = <0x0 0xe1000 0x1000>;
>> + clock-frequency = <100000000>;
> Why is clock-frequency hardcoded here rather than supplied by U-Boot?
> Especially since this is an SoC file, not a board file.
Your are correct.
Means, clock-frequency should be added to clockgen in board device tree ??
>> + reg = <0xe1000 0x1000>;
>> + clock-output-names = "sysclk";
>> + #address-cells = <1>;
>> + #size-cells = <1>;
> clock-output-names and fixed-clock doesn't belong on this node.
Yes, clock-output-names and fixed-clock should be present in sysclk node.
>
>> +
>> + sysclk: sysclk {
>> + #clock-cells = <0>;
>> + compatible = "fsl,qoriq-sysclk-2.0";
>> + clock-output-names = "sysclk";
>> + };
>> +
>> +
>> + pll0: pll0@800 {
>> + #clock-cells = <1>;
>> + reg = <0x800 4>;
>> + compatible = "fsl,qoriq-core-pll-2.0";
>> + clocks = <&clockgen>;
>> + clock-output-names = "pll0", "pll0-div2", "pll0-div4";
>> + };
>> +
>> + pll1: pll1@820 {
>> + #clock-cells = <1>;
>> + reg = <0x820 4>;
>> + compatible = "fsl,qoriq-core-pll-2.0";
>> + clocks = <&clockgen>;
>> + clock-output-names = "pll1", "pll1-div2", "pll1-div4";
>> + };
> clocks should point to sysclk.
got it!!
>
>> + display@180000 {
>> + compatible = "fsl,t1040-diu", "fsl,diu";
>> + reg = <0x180000 1000>;
>> + interrupts = <74 2 0 0>;
>> + };
>> +
>> +/include/ "qoriq-sata2-0.dtsi"
>> +sata@220000 {
>> + fsl,iommu-parent = <&pamu0>;
>> + fsl,liodn-reg = <&guts 0x550>; /* SATA1LIODNR */
>> +};
>> +/include/ "qoriq-sata2-1.dtsi"
>> +sata@221000 {
>> + fsl,iommu-parent = <&pamu0>;
>> + fsl,liodn-reg = <&guts 0x554>; /* SATA2LIODNR */
>> +};
>> +/include/ "qoriq-sec5.0-0.dtsi"
>> +};
> Whitespace
>
>
i did not find this whitespace :(
Regards,
Prabhakar
^ permalink raw reply
* Re: [PATCH] cpuidle: add freescale e500 family porcessors idle support
From: Scott Wood @ 2014-04-04 23:00 UTC (permalink / raw)
To: Dongsheng Wang
Cc: chenhui.zhao, linux-pm, daniel.lezcano, rjw, jason.jin,
linuxppc-dev
In-Reply-To: <1396341234-40515-1-git-send-email-dongsheng.wang@freescale.com>
On Tue, 2014-04-01 at 16:33 +0800, Dongsheng Wang wrote:
> From: Wang Dongsheng <dongsheng.wang@freescale.com>
>
> Add cpuidle support for e500 family, using cpuidle framework to
> manage various low power modes. The new implementation will remain
> compatible with original idle method.
>
> I have done test about power consumption and latency. Cpuidle framework
> will make CPU response time faster than original method, but power
> consumption is higher than original method.
>
> Power consumption:
> The original method, power consumption is 10.51202 (W).
> The cpuidle framework, power consumption is 10.5311 (W).
>
> Latency:
> The original method, avg latency is 6782 (us).
> The cpuidle framework, avg latency is 6482 (us).
>
> Initially, this supports PW10, PW20 and subsequent patches will support
> DOZE/NAP and PH10, PH20.
Have you tried tuning the timebase bit for the original method, to match
what you're doing in cpuidle and/or for general optimization?
Do you get similar results for a variety of workloads?
> +static struct cpuidle_state pw_idle_states[] = {
> + {
> + .name = "pw10",
> + .desc = "pw10",
> + .flags = CPUIDLE_FLAG_TIME_VALID,
> + .exit_latency = 0,
> + .target_residency = 0,
> + .enter = &pw10_enter
> + },
> +
> + {
> + .name = "pw20",
> + .desc = "pw20-core-idle",
> + .flags = CPUIDLE_FLAG_TIME_VALID,
> + .exit_latency = 1,
> + .target_residency = 50,
> + .enter = &pw20_enter
> + },
> +};
Where did exit_latency and target_residency come from? It looks rather
different from the ~1ms delay before entering PW20 with the original
method.
Though, I'd have expected a shorter PW20 delay to have longer wake
latency, due to entering the lower power state more often...
> +static void replace_orig_idle(void *dummy)
> +{
> + return;
> +}
Why? If you're using this as some sort of barrier to ensure that all
CPUs have done something before continuing, explain that, along with why
it matters.
-Scott
^ permalink raw reply
* Re: [PATCH V2 1/2] mm: move FAULT_AROUND_ORDER to arch/
From: David Miller @ 2014-04-04 17:50 UTC (permalink / raw)
To: dave.hansen
Cc: linux-arch, rusty, maddy, riel, x86, linux-kernel, linux-mm,
peterz, ak, paulus, mgorman, akpm, linuxppc-dev, mingo,
kirill.shutemov
In-Reply-To: <533EDB63.8090909@intel.com>
From: Dave Hansen <dave.hansen@intel.com>
Date: Fri, 04 Apr 2014 09:18:43 -0700
> On 04/03/2014 11:27 PM, Madhavan Srinivasan wrote:
>> This patch creates infrastructure to move the FAULT_AROUND_ORDER
>> to arch/ using Kconfig. This will enable architecture maintainers
>> to decide on suitable FAULT_AROUND_ORDER value based on
>> performance data for that architecture. Patch also adds
>> FAULT_AROUND_ORDER Kconfig element in arch/X86.
>
> Please don't do it this way.
>
> In mm/Kconfig, put
>
> config FAULT_AROUND_ORDER
> int
> default 1234 if POWERPC
> default 4
>
> The way you have it now, every single architecture that needs to enable
> this has to go put that in their Kconfig. That's madness. This way,
> you only put it in one place, and folks only have to care if they want
> to change the default to be something other than 4.
It looks more like it's necessary only to change the default, not
to enable it. Unless I read his patch wrong...
^ permalink raw reply
* Re: [PATCH V2 1/2] mm: move FAULT_AROUND_ORDER to arch/
From: Dave Hansen @ 2014-04-04 16:18 UTC (permalink / raw)
To: Madhavan Srinivasan, linux-kernel, linuxppc-dev, linux-mm,
linux-arch, x86
Cc: riel, ak, peterz, rusty, paulus, mgorman, akpm, mingo,
kirill.shutemov
In-Reply-To: <1396592835-24767-2-git-send-email-maddy@linux.vnet.ibm.com>
On 04/03/2014 11:27 PM, Madhavan Srinivasan wrote:
> This patch creates infrastructure to move the FAULT_AROUND_ORDER
> to arch/ using Kconfig. This will enable architecture maintainers
> to decide on suitable FAULT_AROUND_ORDER value based on
> performance data for that architecture. Patch also adds
> FAULT_AROUND_ORDER Kconfig element in arch/X86.
Please don't do it this way.
In mm/Kconfig, put
config FAULT_AROUND_ORDER
int
default 1234 if POWERPC
default 4
The way you have it now, every single architecture that needs to enable
this has to go put that in their Kconfig. That's madness. This way,
you only put it in one place, and folks only have to care if they want
to change the default to be something other than 4.
^ permalink raw reply
* Re: [PATCH 09/20] of/fdt: create common debugfs
From: Michal Simek @ 2014-04-04 14:11 UTC (permalink / raw)
To: Rob Herring
Cc: Grant Likely, linuxppc-dev, Paul Mackerras,
linux-kernel@vger.kernel.org
In-Reply-To: <CAL_Jsq+tf4wgjB7uTNipWEj5d6tPkd6QwO_xiW87P51Y_y48vw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4876 bytes --]
On 04/04/2014 03:32 PM, Rob Herring wrote:
> On Fri, Apr 4, 2014 at 8:22 AM, Michal Simek <monstr@monstr.eu> wrote:
>> On 04/04/2014 03:00 PM, Rob Herring wrote:
>>> On Fri, Apr 4, 2014 at 7:16 AM, Michal Simek <monstr@monstr.eu> wrote:
>>>> On 04/04/2014 12:16 AM, Rob Herring wrote:
>>>>> From: Rob Herring <robh@kernel.org>
>>>>>
>>>>> Both powerpc and microblaze have the same FDT blob in debugfs feature.
>>>>> Move this to common location and remove the powerpc and microblaze
>>>>> implementations. This feature could become more useful when FDT
>>>>> overlay support is added.
>>>
>>> [snip]
>
>> Anyway I am testing it for microblaze and getting problem
>> caused by this patch:
>> commit 3d2ee8571ac0580d49c3f41fa28336289934900a
>> Author: Rob Herring <robh@kernel.org>
>> Date: Wed Apr 2 15:10:14 2014 -0500
>>
>> of/fdt: Convert FDT functions to use libfdt
>>
>> And reason is that in unflatten_dt_node()
>>
>> pathp = fdt_get_name(blob, *poffset, &l);
>>
>> is returning NULL
>> and here
>> /* version 0x10 has a more compact unit name here instead of the full
>> * path. we accumulate the full path size using "fpsize", we'll rebuild
>> * it later. We detect this because the first character of the name is
>> * not '/'.
>> */
>> if ((*pathp) != '/') {
>>
>> code is trying to read it which is causing this kernel bug:
>> Oops: kernel access of bad area, sig: 11
>>
>> It means fdt_next_node(is doing something wrong)
>>
>> Any easy way how to debug it?
>
> I didn't think fdt_get_path should fail. Can you add a print of
> *poffset and pathp values.
Early console on uart16650 at 0x40401000
bootconsole [earlyser0] enabled
Ramdisk addr 0x00000000,
FDT at 0x806b96d4
Linux version 3.14.0-rc8-next-20140331-12541-g43b5fdb-dirty (monstr@monstr-desktop) (gcc version 4.6.4 20120924 (prerelease) (crosstool-NG 1.18.0) ) #51 Fri Apr 4 16:09:17 CEST 2014
-> unflatten_device_tree()
Unflattening device tree:
magic: d00dfeed
size: 00014e20
version: 00000011
unflatten_dt_node blob c0298b00, c0331f84 0
unflatten_dt_node 1a c0298b3c/ -- len 0
unflatten_dt_node 8 old offset 0
unflatten_dt_node 8 new offset 6c
unflatten_dt_node blob c0298b00, c0331f84 6c
unflatten_dt_node 1a c0298ba8/aliases -- len 7
unflatten_dt_node 8 old offset 6c
unflatten_dt_node 8 new offset cc
unflatten_dt_node blob c0298b00, c0331f84 cc
unflatten_dt_node 1a c0298c08/chosen -- len 6
unflatten_dt_node 8 old offset cc
unflatten_dt_node 8 new offset 130
unflatten_dt_node blob c0298b00, c0331f84 130
unflatten_dt_node 1a c0298c6c/cpus -- len 4
unflatten_dt_node 8 old offset 130
unflatten_dt_node 8 new offset 16c
unflatten_dt_node blob c0298b00, c0331f84 16c
unflatten_dt_node 1a c0298ca8/cpu@0 -- len 5
unflatten_dt_node 8 old offset 16c
unflatten_dt_node 8 new offset 7bc
unflatten_dt_node blob c0298b00, c0331f84 7bc
unflatten_dt_node 1a (null)/NULL -- len fffffffc
Below is the possition of debug messages.
Thanks,
Michal
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index ee8853c..5422e4e 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -8,6 +8,7 @@
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*/
+#define DEBUG
#include <linux/kernel.h>
#include <linux/initrd.h>
@@ -116,9 +117,15 @@ static void * unflatten_dt_node(struct boot_param_header *blob,
int has_name = 0;
int new_format = 0;
+printk("%s blob %x, %x %x\n", __func__, blob, poffset, *poffset);
+
pathp = fdt_get_name(blob, *poffset, &l);
+printk("%s 1a %p/%s -- len %x\n", __func__, pathp, pathp ? pathp : "NULL", l);
+
allocl = l++;
+ if (!pathp)
+ while (1);
/* version 0x10 has a more compact unit name here instead of the full
* path. we accumulate the full path size using "fpsize", we'll rebuild
* it later. We detect this because the first character of the name is
@@ -267,7 +274,9 @@ static void * unflatten_dt_node(struct boot_param_header *blob,
}
old_depth = depth;
+printk("%s 8 old offset %x\n", __func__, *poffset);
*poffset = fdt_next_node(blob, *poffset, &depth);
+printk("%s 8 new offset %x\n", __func__, *poffset);
while (*poffset > 0 && depth > old_depth) {
mem = unflatten_dt_node(blob, mem, poffset, np, allnextpp,
fpsize);
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply related
* Re: [PATCH 09/20] of/fdt: create common debugfs
From: Rob Herring @ 2014-04-04 13:32 UTC (permalink / raw)
To: Michal Simek
Cc: Grant Likely, linuxppc-dev, Paul Mackerras,
linux-kernel@vger.kernel.org
In-Reply-To: <533EB207.1020203@monstr.eu>
On Fri, Apr 4, 2014 at 8:22 AM, Michal Simek <monstr@monstr.eu> wrote:
> On 04/04/2014 03:00 PM, Rob Herring wrote:
>> On Fri, Apr 4, 2014 at 7:16 AM, Michal Simek <monstr@monstr.eu> wrote:
>>> On 04/04/2014 12:16 AM, Rob Herring wrote:
>>>> From: Rob Herring <robh@kernel.org>
>>>>
>>>> Both powerpc and microblaze have the same FDT blob in debugfs feature.
>>>> Move this to common location and remove the powerpc and microblaze
>>>> implementations. This feature could become more useful when FDT
>>>> overlay support is added.
>>
>> [snip]
> Anyway I am testing it for microblaze and getting problem
> caused by this patch:
> commit 3d2ee8571ac0580d49c3f41fa28336289934900a
> Author: Rob Herring <robh@kernel.org>
> Date: Wed Apr 2 15:10:14 2014 -0500
>
> of/fdt: Convert FDT functions to use libfdt
>
> And reason is that in unflatten_dt_node()
>
> pathp = fdt_get_name(blob, *poffset, &l);
>
> is returning NULL
> and here
> /* version 0x10 has a more compact unit name here instead of the full
> * path. we accumulate the full path size using "fpsize", we'll rebuild
> * it later. We detect this because the first character of the name is
> * not '/'.
> */
> if ((*pathp) != '/') {
>
> code is trying to read it which is causing this kernel bug:
> Oops: kernel access of bad area, sig: 11
>
> It means fdt_next_node(is doing something wrong)
>
> Any easy way how to debug it?
I didn't think fdt_get_path should fail. Can you add a print of
*poffset and pathp values.
Rob
^ permalink raw reply
* Re: [PATCH 09/20] of/fdt: create common debugfs
From: Michal Simek @ 2014-04-04 13:22 UTC (permalink / raw)
To: Rob Herring
Cc: Grant Likely, linuxppc-dev, Paul Mackerras,
linux-kernel@vger.kernel.org
In-Reply-To: <CAL_JsqKFK8YDoODYKg5b8SmDzqdNSS6UvYr3_atzhcL2uR-=rA@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 3686 bytes --]
On 04/04/2014 03:00 PM, Rob Herring wrote:
> On Fri, Apr 4, 2014 at 7:16 AM, Michal Simek <monstr@monstr.eu> wrote:
>> On 04/04/2014 12:16 AM, Rob Herring wrote:
>>> From: Rob Herring <robh@kernel.org>
>>>
>>> Both powerpc and microblaze have the same FDT blob in debugfs feature.
>>> Move this to common location and remove the powerpc and microblaze
>>> implementations. This feature could become more useful when FDT
>>> overlay support is added.
>>>
>>> This changes the path of the blob from "$arch/flat-device-tree" to
>>> "device-tree/flat-device-tree".
>
> [snip]
>
>>> -#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
>>> -static struct debugfs_blob_wrapper flat_dt_blob;
>>> -
>>> -static int __init export_flat_device_tree(void)
>>> -{
>>> - struct dentry *d;
>>> -
>>> - flat_dt_blob.data = initial_boot_params;
>>> - flat_dt_blob.size = initial_boot_params->totalsize;
>>
>> As I see even microblaze version was buggy.
>
> How so?
if you compare it with powerpc version here is missing
be to cpu conversion.
>
>> ...
>>
>>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>>> index fa16a91..2085d47 100644
>>> --- a/drivers/of/fdt.c
>>> +++ b/drivers/of/fdt.c
>>> @@ -20,6 +20,7 @@
>>> #include <linux/string.h>
>>> #include <linux/errno.h>
>>> #include <linux/slab.h>
>>> +#include <linux/debugfs.h>
>>>
>>> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
>>> #ifdef CONFIG_PPC
>>> @@ -1084,4 +1085,27 @@ void __init unflatten_and_copy_device_tree(void)
>>> unflatten_device_tree();
>>> }
>>>
>>> +#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
>>> +static struct debugfs_blob_wrapper flat_dt_blob;
>>> +
>>> +static int __init of_flat_dt_debugfs_export_fdt(void)
>>> +{
>>> + struct dentry *d = debugfs_create_dir("device-tree", NULL);
>>> +
>>> + if (!d)
>>> + return -ENOENT;
>>> +
>>> + flat_dt_blob.data = initial_boot_params;
>>> + flat_dt_blob.size = fdt_totalsize(initial_boot_params);
>>
>> Have you tried to compile this?
>>
>> From my tests fdt_totalsize is not available for target just for host
>> from libfdt.h
>>
>> drivers/of/fdt.c: In function 'of_flat_dt_debugfs_export_fdt':
>> drivers/of/fdt.c:957:2: error: implicit declaration of function 'fdt_totalsize' [-Werror=implicit-function-declaration]
>
> Ah, it needs to be re-ordered after the libfdt conversion when
> libfdt.h gets added.
I just pick some of them not all of them and send email. :-(
Anyway I am testing it for microblaze and getting problem
caused by this patch:
commit 3d2ee8571ac0580d49c3f41fa28336289934900a
Author: Rob Herring <robh@kernel.org>
Date: Wed Apr 2 15:10:14 2014 -0500
of/fdt: Convert FDT functions to use libfdt
And reason is that in unflatten_dt_node()
pathp = fdt_get_name(blob, *poffset, &l);
is returning NULL
and here
/* version 0x10 has a more compact unit name here instead of the full
* path. we accumulate the full path size using "fpsize", we'll rebuild
* it later. We detect this because the first character of the name is
* not '/'.
*/
if ((*pathp) != '/') {
code is trying to read it which is causing this kernel bug:
Oops: kernel access of bad area, sig: 11
It means fdt_next_node(is doing something wrong)
Any easy way how to debug it?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #1.2: system.dts --]
[-- Type: text/plain, Size: 13423 bytes --]
/*
* Device Tree Generator version: 1.1
*
* (C) Copyright 2007-2013 Xilinx, Inc.
* (C) Copyright 2007-2013 Michal Simek
* (C) Copyright 2007-2012 PetaLogix Qld Pty Ltd
*
* Michal SIMEK <monstr@monstr.eu>
*
* CAUTION: This file is automatically generated by libgen.
* Version: Xilinx EDK 2013.3 EDK_P.20131013
* Today is: Thursday, the 21 of November, 2013; 19:47:51
*
* XPS project directory: .
*/
/dts-v1/;
/ {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,microblaze";
hard-reset-gpios = <&reset_gpio 0 1>;
model = ".";
aliases {
ethernet0 = &axi_ethernet_eth_buf;
serial0 = &rs232_uart;
} ;
chosen {
bootargs = "console=ttyS0,115200 earlyprintk";
linux,stdout-path = "/axi@0/serial@40400000";
} ;
cpus {
#address-cells = <1>;
#cpus = <0x1>;
#size-cells = <0>;
microblaze_0: cpu@0 {
bus-handle = <µblaze_0_axi_periph_xbar>;
clock-frequency = <100000000>;
compatible = "xlnx,microblaze-9.2";
d-cache-baseaddr = <0x80000000>;
d-cache-highaddr = <0xbfffffff>;
d-cache-line-size = <0x20>;
d-cache-size = <0x4000>;
device_type = "cpu";
i-cache-baseaddr = <0x80000000>;
i-cache-highaddr = <0xbfffffff>;
i-cache-line-size = <0x10>;
i-cache-size = <0x4000>;
interrupt-handle = <µblaze_0_axi_intc>;
model = "microblaze,9.2";
reg = <0>;
timebase-frequency = <100000000>;
xlnx,addr-tag-bits = <0x10>;
xlnx,allow-dcache-wr = <0x1>;
xlnx,allow-icache-wr = <0x1>;
xlnx,area-optimized = <0x0>;
xlnx,async-interrupt = <0x1>;
xlnx,avoid-primitives = <0x0>;
xlnx,base-vectors = <0x0>;
xlnx,branch-target-cache-size = <0x0>;
xlnx,cache-byte-size = <0x4000>;
xlnx,d-axi = <0x1>;
xlnx,d-lmb = <0x1>;
xlnx,data-size = <0x20>;
xlnx,dcache-addr-tag = <0x10>;
xlnx,dcache-always-used = <0x1>;
xlnx,dcache-byte-size = <0x4000>;
xlnx,dcache-data-width = <0x0>;
xlnx,dcache-force-tag-lutram = <0x0>;
xlnx,dcache-line-len = <0x8>;
xlnx,dcache-use-writeback = <0x1>;
xlnx,dcache-victims = <0x0>;
xlnx,debug-enabled = <0x1>;
xlnx,div-zero-exception = <0x1>;
xlnx,dynamic-bus-sizing = <0x0>;
xlnx,ecc-use-ce-exception = <0x0>;
xlnx,edge-is-positive = <0x0>;
xlnx,enable-discrete-ports = <0x0>;
xlnx,endianness = <0x1>;
xlnx,fault-tolerant = <0x0>;
xlnx,fpu-exception = <0x0>;
xlnx,freq = <0x5f5e100>;
xlnx,fsl-exception = <0x0>;
xlnx,fsl-links = <0x0>;
xlnx,i-axi = <0x0>;
xlnx,i-lmb = <0x1>;
xlnx,icache-always-used = <0x1>;
xlnx,icache-data-width = <0x0>;
xlnx,icache-force-tag-lutram = <0x0>;
xlnx,icache-line-len = <0x4>;
xlnx,icache-streams = <0x1>;
xlnx,icache-victims = <0x8>;
xlnx,ill-opcode-exception = <0x1>;
xlnx,instance = "kc705_microblaze_0_0";
xlnx,interconnect = <0x2>;
xlnx,interrupt-is-edge = <0x0>;
xlnx,lockstep-select = <0x0>;
xlnx,lockstep-slave = <0x0>;
xlnx,mmu-dtlb-size = <0x4>;
xlnx,mmu-itlb-size = <0x2>;
xlnx,mmu-privileged-instr = <0x0>;
xlnx,mmu-tlb-access = <0x3>;
xlnx,mmu-zones = <0x2>;
xlnx,number-of-pc-brk = <0x1>;
xlnx,number-of-rd-addr-brk = <0x0>;
xlnx,number-of-wr-addr-brk = <0x0>;
xlnx,opcode-0x0-illegal = <0x1>;
xlnx,optimization = <0x0>;
xlnx,pc-width = <0x20>;
xlnx,pvr = <0x2>;
xlnx,pvr-user1 = <0x0>;
xlnx,pvr-user2 = <0x0>;
xlnx,reset-msr = <0x0>;
xlnx,sco = <0x0>;
xlnx,trace = <0x0>;
xlnx,unaligned-exceptions = <0x1>;
xlnx,use-barrel = <0x1>;
xlnx,use-branch-target-cache = <0x1>;
xlnx,use-config-reset = <0x0>;
xlnx,use-dcache = <0x1>;
xlnx,use-div = <0x1>;
xlnx,use-ext-brk = <0x0>;
xlnx,use-ext-nm-brk = <0x0>;
xlnx,use-extended-fsl-instr = <0x0>;
xlnx,use-fpu = <0x0>;
xlnx,use-hw-mul = <0x2>;
xlnx,use-icache = <0x1>;
xlnx,use-interrupt = <0x2>;
xlnx,use-mmu = <0x3>;
xlnx,use-msr-instr = <0x1>;
xlnx,use-pcmp-instr = <0x1>;
xlnx,use-reorder-instr = <0x1>;
xlnx,use-stack-protection = <0x0>;
} ;
} ;
ddr3_sdram: memory@80000000 {
device_type = "memory";
reg = <0x80000000 0x40000000>;
} ;
microblaze_0_axi_periph_xbar: axi@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "xlnx,axi-crossbar-2.1", "simple-bus";
ranges ;
axi_ethernet_dma: axi-dma@41e00000 {
axistream-connected = <&axi_ethernet_eth_buf>;
axistream-control-connected = <&axi_ethernet_eth_buf>;
compatible = "xlnx,axi-dma-7.1", "xlnx,axi-dma-1.00.a";
interrupt-parent = <µblaze_0_axi_intc>;
interrupts = <2 2>, <3 2>;
reg = <0x41e00000 0x10000>;
xlnx,dlytmr-resolution = <0x7d>;
xlnx,enable-multi-channel = <0x0>;
xlnx,include-mm2s = <0x1>;
xlnx,include-mm2s-dre = <0x1>;
xlnx,include-mm2s-sf = <0x1>;
xlnx,include-s2mm = <0x1>;
xlnx,include-s2mm-dre = <0x1>;
xlnx,include-s2mm-sf = <0x1>;
xlnx,include-sg = <0x1>;
xlnx,micro-dma = <0x0>;
xlnx,mm2s-burst-size = <0x10>;
xlnx,num-mm2s-channels = <0x1>;
xlnx,num-s2mm-channels = <0x1>;
xlnx,prmry-is-aclk-async = <0x0>;
xlnx,s2mm-burst-size = <0x10>;
xlnx,sg-include-stscntrl-strm = <0x1>;
xlnx,sg-length-width = <0xe>;
xlnx,sg-use-stsapp-length = <0x1>;
} ;
axi_ethernet_eth_buf: axi-ethernet@44a00000 {
axistream-connected = <&axi_ethernet_dma>;
axistream-control-connected = <&axi_ethernet_dma>;
clock-frequency = <100000000>;
compatible = "xlnx,axi-ethernet-buffer-2.0", "xlnx,axi-ethernet-1.00.a";
device_type = "network";
interrupt-parent = <µblaze_0_axi_intc>;
interrupts = <1 2>;
local-mac-address = [ 00 0a 35 00 42 4a ];
phy-handle = <&phy0>;
reg = <0x44a00000 0x40000>;
xlnx,avb = <0x0>;
xlnx,halfdup = "1";
xlnx,include-io = "1";
xlnx,mcast-extend = <0x0>;
xlnx,phy-type = <0x1>;
xlnx,phyaddr = <0x1>;
xlnx,rxcsum = <0x0>;
xlnx,rxmem = <0x1000>;
xlnx,rxvlan-strp = <0x0>;
xlnx,rxvlan-tag = <0x0>;
xlnx,rxvlan-tran = <0x0>;
xlnx,stats = <0x0>;
xlnx,txcsum = <0x0>;
xlnx,txmem = <0x1000>;
xlnx,txvlan-strp = <0x0>;
xlnx,txvlan-tag = <0x0>;
xlnx,txvlan-tran = <0x0>;
xlnx,type = <0x1>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
phy0: phy@7 {
compatible = "marvell,88e1111";
device_type = "ethernet-phy";
reg = <7>;
} ;
} ;
} ;
axi_timer_0: system-timer@41c00000 {
clock-frequency = <100000000>;
compatible = "xlnx,axi-timer-2.0", "xlnx,xps-timer-1.00.a";
interrupt-parent = <µblaze_0_axi_intc>;
interrupts = <0 2>;
reg = <0x41c00000 0x10000>;
xlnx,count-width = <0x20>;
xlnx,gen0-assert = <0x1>;
xlnx,gen1-assert = <0x1>;
xlnx,one-timer-only = <0x0>;
xlnx,trig0-assert = <0x1>;
xlnx,trig1-assert = <0x1>;
} ;
dip_switches_4bits: gpio@40010000 {
#gpio-cells = <2>;
compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
gpio-controller ;
reg = <0x40010000 0x10000>;
xlnx,all-inputs = <0x1>;
xlnx,all-inputs-2 = <0x0>;
xlnx,all-outputs = <0x0>;
xlnx,all-outputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,gpio-width = <0x4>;
xlnx,gpio2-width = <0x20>;
xlnx,interrupt-present = <0x0>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xffffffff>;
xlnx,tri-default-2 = <0xffffffff>;
} ;
led_8bits: gpio@40020000 {
#gpio-cells = <2>;
compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
gpio-controller ;
reg = <0x40020000 0x10000>;
xlnx,all-inputs = <0x0>;
xlnx,all-inputs-2 = <0x0>;
xlnx,all-outputs = <0x1>;
xlnx,all-outputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,gpio-width = <0x8>;
xlnx,gpio2-width = <0x20>;
xlnx,interrupt-present = <0x0>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xffffffff>;
xlnx,tri-default-2 = <0xffffffff>;
} ;
microblaze_0_axi_intc: interrupt-controller@41200000 {
#interrupt-cells = <0x2>;
compatible = "xlnx,axi-intc-4.0", "xlnx,xps-intc-1.00.a";
interrupt-controller ;
reg = <0x41200000 0x10000>;
xlnx,kind-of-intr = <0x0>;
xlnx,num-intr-inputs = <0x5>;
} ;
primary_flash: flash@60000000 {
#address-cells = <1>;
#size-cells = <1>;
bank-width = <2>;
compatible = "xlnx,axi-emc-2.0", "cfi-flash";
reg = <0x60000000 0x8000000>;
xlnx,axi-clk-period-ps = <0x2710>;
xlnx,include-datawidth-matching-0 = <0x1>;
xlnx,include-datawidth-matching-1 = <0x1>;
xlnx,include-datawidth-matching-2 = <0x1>;
xlnx,include-datawidth-matching-3 = <0x1>;
xlnx,include-negedge-ioregs = <0x0>;
xlnx,instance = "axi_emc_inst";
xlnx,lflash-period-ps = <0x4e20>;
xlnx,linear-flash-sync-burst = <0x0>;
xlnx,max-mem-width = <0x10>;
xlnx,mem0-type = <0x2>;
xlnx,mem0-width = <0x10>;
xlnx,mem1-type = <0x2>;
xlnx,mem1-width = <0x10>;
xlnx,mem2-type = <0x2>;
xlnx,mem2-width = <0x10>;
xlnx,mem3-type = <0x2>;
xlnx,mem3-width = <0x10>;
xlnx,num-banks-mem = <0x1>;
xlnx,parity-type-mem-0 = <0x0>;
xlnx,parity-type-mem-1 = <0x0>;
xlnx,parity-type-mem-2 = <0x0>;
xlnx,parity-type-mem-3 = <0x0>;
xlnx,s-axi-en-reg = <0x0>;
xlnx,s-axi-mem-addr-width = <0x20>;
xlnx,s-axi-mem-data-width = <0x20>;
xlnx,s-axi-mem-id-width = <0x1>;
xlnx,s-axi-reg-addr-width = <0x5>;
xlnx,s-axi-reg-data-width = <0x20>;
xlnx,synch-pipedelay-0 = <0x1>;
xlnx,synch-pipedelay-1 = <0x1>;
xlnx,synch-pipedelay-2 = <0x1>;
xlnx,synch-pipedelay-3 = <0x1>;
xlnx,tavdv-ps-mem-0 = <0x1fbd0>;
xlnx,tavdv-ps-mem-1 = <0x3a98>;
xlnx,tavdv-ps-mem-2 = <0x3a98>;
xlnx,tavdv-ps-mem-3 = <0x3a98>;
xlnx,tcedv-ps-mem-0 = <0x1fbd0>;
xlnx,tcedv-ps-mem-1 = <0x3a98>;
xlnx,tcedv-ps-mem-2 = <0x3a98>;
xlnx,tcedv-ps-mem-3 = <0x3a98>;
xlnx,thzce-ps-mem-0 = <0x1b58>;
xlnx,thzce-ps-mem-1 = <0x1b58>;
xlnx,thzce-ps-mem-2 = <0x1b58>;
xlnx,thzce-ps-mem-3 = <0x1b58>;
xlnx,thzoe-ps-mem-0 = <0x1b58>;
xlnx,thzoe-ps-mem-1 = <0x1b58>;
xlnx,thzoe-ps-mem-2 = <0x1b58>;
xlnx,thzoe-ps-mem-3 = <0x1b58>;
xlnx,tlzwe-ps-mem-0 = <0xc350>;
xlnx,tlzwe-ps-mem-1 = <0x0>;
xlnx,tlzwe-ps-mem-2 = <0x0>;
xlnx,tlzwe-ps-mem-3 = <0x0>;
xlnx,tpacc-ps-flash-0 = <0x61a8>;
xlnx,tpacc-ps-flash-1 = <0x61a8>;
xlnx,tpacc-ps-flash-2 = <0x61a8>;
xlnx,tpacc-ps-flash-3 = <0x61a8>;
xlnx,twc-ps-mem-0 = <0x3a98>;
xlnx,twc-ps-mem-1 = <0x3a98>;
xlnx,twc-ps-mem-2 = <0x3a98>;
xlnx,twc-ps-mem-3 = <0x3a98>;
xlnx,twp-ps-mem-0 = <0x13880>;
xlnx,twp-ps-mem-1 = <0x2ee0>;
xlnx,twp-ps-mem-2 = <0x2ee0>;
xlnx,twp-ps-mem-3 = <0x2ee0>;
xlnx,twph-ps-mem-0 = <0x13880>;
xlnx,twph-ps-mem-1 = <0x2ee0>;
xlnx,twph-ps-mem-2 = <0x2ee0>;
xlnx,twph-ps-mem-3 = <0x2ee0>;
xlnx,wr-rec-time-mem-0 = <0x186a0>;
xlnx,wr-rec-time-mem-1 = <0x6978>;
xlnx,wr-rec-time-mem-2 = <0x6978>;
xlnx,wr-rec-time-mem-3 = <0x6978>;
partition@0x00000000 {
label = "fpga";
reg = <0x00000000 0x00b00000>;
};
partition@0x00b00000 {
label = "boot";
reg = <0x00b00000 0x00040000>;
};
partition@0x00b40000 {
label = "bootenv";
reg = <0x00b40000 0x00020000>;
};
partition@0x00b60000 {
label = "image";
reg = <0x00b60000 0x00c00000>;
};
partition@0x01760000 {
label = "spare";
reg = <0x01760000 0x00000000>;
};
} ;
push_buttons_5bits: gpio@40030000 {
#gpio-cells = <2>;
compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
gpio-controller ;
reg = <0x40030000 0x10000>;
xlnx,all-inputs = <0x1>;
xlnx,all-inputs-2 = <0x0>;
xlnx,all-outputs = <0x0>;
xlnx,all-outputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,gpio-width = <0x5>;
xlnx,gpio2-width = <0x20>;
xlnx,interrupt-present = <0x0>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xffffffff>;
xlnx,tri-default-2 = <0xffffffff>;
} ;
reset_gpio: gpio@40000000 {
#gpio-cells = <2>;
compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
gpio-controller ;
reg = <0x40000000 0x10000>;
xlnx,all-inputs = <0x0>;
xlnx,all-inputs-2 = <0x0>;
xlnx,all-outputs = <0x1>;
xlnx,all-outputs-2 = <0x0>;
xlnx,dout-default = <0x0>;
xlnx,dout-default-2 = <0x0>;
xlnx,gpio-width = <0x1>;
xlnx,gpio2-width = <0x20>;
xlnx,interrupt-present = <0x0>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xffffffff>;
xlnx,tri-default-2 = <0xffffffff>;
} ;
rs232_uart: serial@40400000 {
clock-frequency = <100000000>;
compatible = "xlnx,axi-uart16550-2.0", "xlnx,xps-uart16550-2.00.a", "ns16550a";
current-speed = <115200>;
device_type = "serial";
interrupt-parent = <µblaze_0_axi_intc>;
interrupts = <4 2>;
reg = <0x40400000 0x2000>;
reg-offset = <0x1000>;
reg-shift = <2>;
xlnx,external-xin-clk-hz = <0x17d7840>;
xlnx,external-xin-clk-hz-d = <0x19>;
xlnx,has-external-rclk = <0x0>;
xlnx,has-external-xin = <0x0>;
xlnx,is-a-16550 = <0x1>;
xlnx,s-axi-aclk-freq-hz-d = <0x64>;
xlnx,use-modem-ports = <0x1>;
xlnx,use-user-ports = <0x1>;
} ;
} ;
} ;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply
* Re: [PATCH V2 1/2] mm: move FAULT_AROUND_ORDER to arch/
From: Kirill A. Shutemov @ 2014-04-04 13:17 UTC (permalink / raw)
To: Madhavan Srinivasan
Cc: linux-arch, riel, rusty, peterz, x86, linux-kernel, linux-mm, ak,
paulus, mgorman, akpm, linuxppc-dev, mingo, kirill.shutemov
In-Reply-To: <1396592835-24767-2-git-send-email-maddy@linux.vnet.ibm.com>
On Fri, Apr 04, 2014 at 11:57:14AM +0530, Madhavan Srinivasan wrote:
> Kirill A. Shutemov with faultaround patchset introduced
> vm_ops->map_pages() for mapping easy accessible pages around
> fault address in hope to reduce number of minor page faults.
>
> This patch creates infrastructure to move the FAULT_AROUND_ORDER
> to arch/ using Kconfig. This will enable architecture maintainers
> to decide on suitable FAULT_AROUND_ORDER value based on
> performance data for that architecture. Patch also adds
> FAULT_AROUND_ORDER Kconfig element in arch/X86.
>
> Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
> ---
> arch/x86/Kconfig | 4 ++++
> include/linux/mm.h | 9 +++++++++
> mm/memory.c | 12 +++++-------
> 3 files changed, 18 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 9c0a657..5833f22 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -1177,6 +1177,10 @@ config DIRECT_GBPAGES
> support it. This can improve the kernel's performance a tiny bit by
> reducing TLB pressure. If in doubt, say "Y".
>
> +config FAULT_AROUND_ORDER
> + int
> + default "4"
> +
> # Common NUMA Features
> config NUMA
> bool "Numa Memory Allocation and Scheduler Support"
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 0bd4359..b93c1c3 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -26,6 +26,15 @@ struct file_ra_state;
> struct user_struct;
> struct writeback_control;
>
> +/*
> + * Fault around order is a control knob to decide the fault around pages.
> + * Default value is set to 0UL (disabled), but the arch can override it as
> + * desired.
> + */
> +#ifndef CONFIG_FAULT_AROUND_ORDER
> +#define CONFIG_FAULT_AROUND_ORDER 0
> +#endif
> +
I don't think it should be in header file: nobody except mm/memory.c cares.
Just put it instead '#define FAULT_AROUND_ORDER'.
> #ifndef CONFIG_NEED_MULTIPLE_NODES /* Don't use mapnrs, do it properly */
> extern unsigned long max_mapnr;
>
> diff --git a/mm/memory.c b/mm/memory.c
> index b02c584..22a4a89 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -3358,10 +3358,8 @@ void do_set_pte(struct vm_area_struct *vma, unsigned long address,
> update_mmu_cache(vma, address, pte);
> }
>
> -#define FAULT_AROUND_ORDER 4
> -
> #ifdef CONFIG_DEBUG_FS
> -static unsigned int fault_around_order = FAULT_AROUND_ORDER;
> +static unsigned int fault_around_order = CONFIG_FAULT_AROUND_ORDER;
>
> static int fault_around_order_get(void *data, u64 *val)
> {
> @@ -3371,7 +3369,7 @@ static int fault_around_order_get(void *data, u64 *val)
>
> static int fault_around_order_set(void *data, u64 val)
> {
> - BUILD_BUG_ON((1UL << FAULT_AROUND_ORDER) > PTRS_PER_PTE);
> + BUILD_BUG_ON((1UL << CONFIG_FAULT_AROUND_ORDER) > PTRS_PER_PTE);
> if (1UL << val > PTRS_PER_PTE)
> return -EINVAL;
> fault_around_order = val;
> @@ -3406,14 +3404,14 @@ static inline unsigned long fault_around_pages(void)
> {
> unsigned long nr_pages;
>
> - nr_pages = 1UL << FAULT_AROUND_ORDER;
> + nr_pages = 1UL << CONFIG_FAULT_AROUND_ORDER;
> BUILD_BUG_ON(nr_pages > PTRS_PER_PTE);
> return nr_pages;
> }
>
> static inline unsigned long fault_around_mask(void)
> {
> - return ~((1UL << (PAGE_SHIFT + FAULT_AROUND_ORDER)) - 1);
> + return ~((1UL << (PAGE_SHIFT + CONFIG_FAULT_AROUND_ORDER)) - 1);
> }
> #endif
>
> @@ -3471,7 +3469,7 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma,
> * if page by the offset is not ready to be mapped (cold cache or
> * something).
> */
> - if (vma->vm_ops->map_pages) {
> + if ((vma->vm_ops->map_pages) && (fault_around_pages() > 1)) {
if (vma->vm_ops->map_pages && fault_around_pages()) {
> pte = pte_offset_map_lock(mm, pmd, address, &ptl);
> do_fault_around(vma, address, pte, pgoff, flags);
> if (!pte_same(*pte, orig_pte))
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Kirill A. Shutemov
^ permalink raw reply
* Re: [PATCH 09/20] of/fdt: create common debugfs
From: Rob Herring @ 2014-04-04 13:00 UTC (permalink / raw)
To: Michal Simek
Cc: Grant Likely, linuxppc-dev, Paul Mackerras,
linux-kernel@vger.kernel.org
In-Reply-To: <533EA2B0.7080703@monstr.eu>
On Fri, Apr 4, 2014 at 7:16 AM, Michal Simek <monstr@monstr.eu> wrote:
> On 04/04/2014 12:16 AM, Rob Herring wrote:
>> From: Rob Herring <robh@kernel.org>
>>
>> Both powerpc and microblaze have the same FDT blob in debugfs feature.
>> Move this to common location and remove the powerpc and microblaze
>> implementations. This feature could become more useful when FDT
>> overlay support is added.
>>
>> This changes the path of the blob from "$arch/flat-device-tree" to
>> "device-tree/flat-device-tree".
[snip]
>> -#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
>> -static struct debugfs_blob_wrapper flat_dt_blob;
>> -
>> -static int __init export_flat_device_tree(void)
>> -{
>> - struct dentry *d;
>> -
>> - flat_dt_blob.data = initial_boot_params;
>> - flat_dt_blob.size = initial_boot_params->totalsize;
>
> As I see even microblaze version was buggy.
How so?
> ...
>
>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>> index fa16a91..2085d47 100644
>> --- a/drivers/of/fdt.c
>> +++ b/drivers/of/fdt.c
>> @@ -20,6 +20,7 @@
>> #include <linux/string.h>
>> #include <linux/errno.h>
>> #include <linux/slab.h>
>> +#include <linux/debugfs.h>
>>
>> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
>> #ifdef CONFIG_PPC
>> @@ -1084,4 +1085,27 @@ void __init unflatten_and_copy_device_tree(void)
>> unflatten_device_tree();
>> }
>>
>> +#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
>> +static struct debugfs_blob_wrapper flat_dt_blob;
>> +
>> +static int __init of_flat_dt_debugfs_export_fdt(void)
>> +{
>> + struct dentry *d = debugfs_create_dir("device-tree", NULL);
>> +
>> + if (!d)
>> + return -ENOENT;
>> +
>> + flat_dt_blob.data = initial_boot_params;
>> + flat_dt_blob.size = fdt_totalsize(initial_boot_params);
>
> Have you tried to compile this?
>
> From my tests fdt_totalsize is not available for target just for host
> from libfdt.h
>
> drivers/of/fdt.c: In function 'of_flat_dt_debugfs_export_fdt':
> drivers/of/fdt.c:957:2: error: implicit declaration of function 'fdt_totalsize' [-Werror=implicit-function-declaration]
Ah, it needs to be re-ordered after the libfdt conversion when
libfdt.h gets added.
Rob
^ permalink raw reply
* Re: [PATCH 09/20] of/fdt: create common debugfs
From: Michal Simek @ 2014-04-04 12:22 UTC (permalink / raw)
To: monstr
Cc: Rob Herring, linux-kernel, Rob Herring, Grant Likely,
Paul Mackerras, linuxppc-dev
In-Reply-To: <533EA2B0.7080703@monstr.eu>
[-- Attachment #1: Type: text/plain, Size: 1602 bytes --]
>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>> index fa16a91..2085d47 100644
>> --- a/drivers/of/fdt.c
>> +++ b/drivers/of/fdt.c
>> @@ -20,6 +20,7 @@
>> #include <linux/string.h>
>> #include <linux/errno.h>
>> #include <linux/slab.h>
>> +#include <linux/debugfs.h>
>>
>> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
>> #ifdef CONFIG_PPC
>> @@ -1084,4 +1085,27 @@ void __init unflatten_and_copy_device_tree(void)
>> unflatten_device_tree();
>> }
>>
>> +#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
>> +static struct debugfs_blob_wrapper flat_dt_blob;
>> +
>> +static int __init of_flat_dt_debugfs_export_fdt(void)
>> +{
>> + struct dentry *d = debugfs_create_dir("device-tree", NULL);
>> +
>> + if (!d)
>> + return -ENOENT;
>> +
>> + flat_dt_blob.data = initial_boot_params;
>> + flat_dt_blob.size = fdt_totalsize(initial_boot_params);
>
> Have you tried to compile this?
>
> From my tests fdt_totalsize is not available for target just for host
> from libfdt.h
>
> drivers/of/fdt.c: In function 'of_flat_dt_debugfs_export_fdt':
> drivers/of/fdt.c:957:2: error: implicit declaration of function 'fdt_totalsize' [-Werror=implicit-function-declaration]
Ignore this one - there is no compilation problem.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply
* Re: [PATCH 09/20] of/fdt: create common debugfs
From: Michal Simek @ 2014-04-04 12:16 UTC (permalink / raw)
To: Rob Herring
Cc: Rob Herring, linux-kernel, Paul Mackerras, Grant Likely,
linuxppc-dev
In-Reply-To: <1396563423-30893-10-git-send-email-robherring2@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3432 bytes --]
On 04/04/2014 12:16 AM, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
>
> Both powerpc and microblaze have the same FDT blob in debugfs feature.
> Move this to common location and remove the powerpc and microblaze
> implementations. This feature could become more useful when FDT
> overlay support is added.
>
> This changes the path of the blob from "$arch/flat-device-tree" to
> "device-tree/flat-device-tree".
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> ---
> arch/microblaze/kernel/prom.c | 31 -------------------------------
> arch/powerpc/kernel/prom.c | 21 ---------------------
> drivers/of/fdt.c | 24 ++++++++++++++++++++++++
> 3 files changed, 24 insertions(+), 52 deletions(-)
>
> diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
> index abdfb10..1312cd2 100644
> --- a/arch/microblaze/kernel/prom.c
> +++ b/arch/microblaze/kernel/prom.c
> @@ -114,34 +114,3 @@ void __init early_init_devtree(void *params)
>
> pr_debug(" <- early_init_devtree()\n");
> }
> -
> -/*******
> - *
> - * New implementation of the OF "find" APIs, return a refcounted
> - * object, call of_node_put() when done. The device tree and list
> - * are protected by a rw_lock.
> - *
> - * Note that property management will need some locking as well,
> - * this isn't dealt with yet.
> - *
> - *******/
> -
> -#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
> -static struct debugfs_blob_wrapper flat_dt_blob;
> -
> -static int __init export_flat_device_tree(void)
> -{
> - struct dentry *d;
> -
> - flat_dt_blob.data = initial_boot_params;
> - flat_dt_blob.size = initial_boot_params->totalsize;
As I see even microblaze version was buggy.
...
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index fa16a91..2085d47 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -20,6 +20,7 @@
> #include <linux/string.h>
> #include <linux/errno.h>
> #include <linux/slab.h>
> +#include <linux/debugfs.h>
>
> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
> #ifdef CONFIG_PPC
> @@ -1084,4 +1085,27 @@ void __init unflatten_and_copy_device_tree(void)
> unflatten_device_tree();
> }
>
> +#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
> +static struct debugfs_blob_wrapper flat_dt_blob;
> +
> +static int __init of_flat_dt_debugfs_export_fdt(void)
> +{
> + struct dentry *d = debugfs_create_dir("device-tree", NULL);
> +
> + if (!d)
> + return -ENOENT;
> +
> + flat_dt_blob.data = initial_boot_params;
> + flat_dt_blob.size = fdt_totalsize(initial_boot_params);
Have you tried to compile this?
From my tests fdt_totalsize is not available for target just for host
from libfdt.h
drivers/of/fdt.c: In function 'of_flat_dt_debugfs_export_fdt':
drivers/of/fdt.c:957:2: error: implicit declaration of function 'fdt_totalsize' [-Werror=implicit-function-declaration]
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply
* [PATCH v3 2/2] ARM: dts: Append clock bindings for sai2 on VF610 platform
From: Nicolin Chen @ 2014-04-04 10:08 UTC (permalink / raw)
To: broonie, shawn.guo
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
ijc+devicetree, linux-kernel, robh+dt, timur, Li.Xiubo, rob,
galak, linuxppc-dev
In-Reply-To: <cover.1396605772.git.Guangyu.Chen@freescale.com>
Since we added fours clock to the DT binding, we should update the current
SAI dts/dtsi so as not to break their functions.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Tested-by: Xiubo Li <Li.Xiubo@freescale.com>
---
arch/arm/boot/dts/vf610.dtsi | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
index d31ce1b..9fd0007 100644
--- a/arch/arm/boot/dts/vf610.dtsi
+++ b/arch/arm/boot/dts/vf610.dtsi
@@ -139,8 +139,10 @@
compatible = "fsl,vf610-sai";
reg = <0x40031000 0x1000>;
interrupts = <0 86 0x04>;
- clocks = <&clks VF610_CLK_SAI2>;
- clock-names = "sai";
+ clocks = <&clks VF610_CLK_SAI2>,
+ <&clks VF610_CLK_SAI2>,
+ <&clks 0>, <&clks 0>;
+ clock-names = "bus", "mclk1", "mclk2", "mclk3";
status = "disabled";
};
--
1.8.4
^ permalink raw reply related
* [PATCH v3 1/2] ASoC: fsl_sai: Add clock controls for SAI
From: Nicolin Chen @ 2014-04-04 10:08 UTC (permalink / raw)
To: broonie, shawn.guo
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
ijc+devicetree, linux-kernel, robh+dt, timur, Li.Xiubo, rob,
galak, linuxppc-dev
In-Reply-To: <cover.1396605772.git.Guangyu.Chen@freescale.com>
The SAI mainly has the following clocks:
bus clock
control and configuration registers and to generate synchronous
interrupts and DMA requests.
mclk1, mclk2, mclk3
to generate the bit clock when the receiver or transmitter is
configured for an internally generated bit clock.
So this patch adds these clocks to the driver and their clock controls.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
---
.../devicetree/bindings/sound/fsl-sai.txt | 8 ++--
sound/soc/fsl/fsl_sai.c | 51 ++++++++++++++++++++--
sound/soc/fsl/fsl_sai.h | 4 ++
3 files changed, 56 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/fsl-sai.txt b/Documentation/devicetree/bindings/sound/fsl-sai.txt
index 35c09fe..8a273bc 100644
--- a/Documentation/devicetree/bindings/sound/fsl-sai.txt
+++ b/Documentation/devicetree/bindings/sound/fsl-sai.txt
@@ -10,7 +10,8 @@ Required properties:
- compatible: Compatible list, contains "fsl,vf610-sai" or "fsl,imx6sx-sai".
- reg: Offset and length of the register set for the device.
- clocks: Must contain an entry for each entry in clock-names.
-- clock-names : Must include the "sai" entry.
+- clock-names : Must include the "bus" for register access and "mclk1" "mclk2"
+ "mclk3" for bit clock and frame clock providing.
- dmas : Generic dma devicetree binding as described in
Documentation/devicetree/bindings/dma/dma.txt.
- dma-names : Two dmas have to be defined, "tx" and "rx".
@@ -30,8 +31,9 @@ sai2: sai@40031000 {
reg = <0x40031000 0x1000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai2_1>;
- clocks = <&clks VF610_CLK_SAI2>;
- clock-names = "sai";
+ clocks = <&clks VF610_CLK_SAI2>, <&clks VF610_CLK_SAI2>
+ <&clks 0>, <&clks 0>;
+ clock-names = "bus", "mclk1", "mclk2", "mclk3";
dma-names = "tx", "rx";
dmas = <&edma0 0 VF610_EDMA_MUXID0_SAI2_TX>,
<&edma0 0 VF610_EDMA_MUXID0_SAI2_RX>;
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 9cd1764..2dae440 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -401,7 +401,23 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{
struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
- u32 reg;
+ struct device *dev = &sai->pdev->dev;
+ u32 reg, i;
+ int ret;
+
+ ret = clk_prepare_enable(sai->bus_clk);
+ if (ret) {
+ dev_err(dev, "failed to enable bus clock\n");
+ return ret;
+ }
+
+ for (i = 0; i < FSL_SAI_MCLK_MAX; i++) {
+ ret = clk_prepare_enable(sai->mclk_clk[i]);
+ if (ret) {
+ dev_err(dev, "failed to enable mclk%d clock\n", i + 1);
+ goto err;
+ }
+ }
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
reg = FSL_SAI_TCR3;
@@ -412,13 +428,20 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream,
FSL_SAI_CR3_TRCE);
return 0;
+
+err:
+ for (; i > 0; i--)
+ clk_disable_unprepare(sai->mclk_clk[i - 1]);
+ clk_disable_unprepare(sai->bus_clk);
+
+ return ret;
}
static void fsl_sai_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{
struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
- u32 reg;
+ u32 reg, i;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
reg = FSL_SAI_TCR3;
@@ -427,6 +450,10 @@ static void fsl_sai_shutdown(struct snd_pcm_substream *substream,
regmap_update_bits(sai->regmap, reg, FSL_SAI_CR3_TRCE,
~FSL_SAI_CR3_TRCE);
+
+ for (i = 0; i < FSL_SAI_MCLK_MAX; i++)
+ clk_disable_unprepare(sai->mclk_clk[i]);
+ clk_disable_unprepare(sai->bus_clk);
}
static const struct snd_soc_dai_ops fsl_sai_pcm_dai_ops = {
@@ -559,7 +586,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
struct fsl_sai *sai;
struct resource *res;
void __iomem *base;
- int irq, ret;
+ char tmp[8];
+ int irq, ret, i;
sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL);
if (!sai)
@@ -582,12 +610,27 @@ static int fsl_sai_probe(struct platform_device *pdev)
return PTR_ERR(base);
sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev,
- "sai", base, &fsl_sai_regmap_config);
+ "bus", base, &fsl_sai_regmap_config);
if (IS_ERR(sai->regmap)) {
dev_err(&pdev->dev, "regmap init failed\n");
return PTR_ERR(sai->regmap);
}
+ sai->bus_clk = devm_clk_get(&pdev->dev, "bus");
+ if (IS_ERR(sai->bus_clk)) {
+ dev_err(&pdev->dev, "failed to get bus clock\n");
+ return PTR_ERR(sai->bus_clk);
+ }
+
+ for (i = 0; i < FSL_SAI_MCLK_MAX; i++) {
+ sprintf(tmp, "mclk%d", i + 1);
+ sai->mclk_clk[i] = devm_clk_get(&pdev->dev, tmp);
+ if (IS_ERR(sai->mclk_clk[i])) {
+ dev_err(&pdev->dev, "failed to get mclk%d clock\n", i + 1);
+ return PTR_ERR(sai->mclk_clk[i]);
+ }
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h
index 677670d..0e6c9f5 100644
--- a/sound/soc/fsl/fsl_sai.h
+++ b/sound/soc/fsl/fsl_sai.h
@@ -119,6 +119,8 @@
#define FSL_SAI_CLK_MAST2 2
#define FSL_SAI_CLK_MAST3 3
+#define FSL_SAI_MCLK_MAX 3
+
/* SAI data transfer numbers per DMA request */
#define FSL_SAI_MAXBURST_TX 6
#define FSL_SAI_MAXBURST_RX 6
@@ -126,6 +128,8 @@
struct fsl_sai {
struct platform_device *pdev;
struct regmap *regmap;
+ struct clk *bus_clk;
+ struct clk *mclk_clk[FSL_SAI_MCLK_MAX];
bool big_endian_regs;
bool big_endian_data;
--
1.8.4
^ permalink raw reply related
* [PATCH v3 0/2] ASoC: fsl_sai: Add bus clock and mclks with clock controls
From: Nicolin Chen @ 2014-04-04 10:08 UTC (permalink / raw)
To: broonie, shawn.guo
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
ijc+devicetree, linux-kernel, robh+dt, timur, Li.Xiubo, rob,
galak, linuxppc-dev
This series of patches add clock controls to fsl_sai driver and updates
the vf610.dtsi accordingly.
Changelog
v3:
* Use int type for ret instead of u32.
* Added Acked-by and Tested-by from Xiubo Li.
v2:
* Appended two extra mclks to the driver since SAI actually has three.
* Renamed clock name to 'bus' and 'mclk' according to the reference manual.
Nicolin Chen (2):
ASoC: fsl_sai: Add clock controls for SAI
ARM: dts: Append clock bindings for sai2 on VF610 platform
.../devicetree/bindings/sound/fsl-sai.txt | 8 ++--
arch/arm/boot/dts/vf610.dtsi | 6 ++-
sound/soc/fsl/fsl_sai.c | 51 ++++++++++++++++++++--
sound/soc/fsl/fsl_sai.h | 4 ++
4 files changed, 60 insertions(+), 9 deletions(-)
--
1.8.4
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_sai: Fix Bit Clock Polarity configurations
From: Mark Brown @ 2014-04-04 10:05 UTC (permalink / raw)
To: Nicolin Chen; +Cc: alsa-devel, Li.Xiubo, linuxppc-dev, linux-kernel, timur
In-Reply-To: <1396595387-4371-1-git-send-email-Guangyu.Chen@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 348 bytes --]
On Fri, Apr 04, 2014 at 03:09:47PM +0800, Nicolin Chen wrote:
> The BCP bit in TCR4/RCR4 register rules as followings:
> 0 Bit clock is active high with drive outputs on rising edge
> and sample inputs on falling edge.
> 1 Bit clock is active low with drive outputs on falling edge
> and sample inputs on rising edge.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* RE: [PATCH v2 2/2] ARM: dts: Append clock bindings for sai2 on VF610 platform
From: Li.Xiubo @ 2014-04-04 9:52 UTC (permalink / raw)
To: guangyu.chen@freescale.com, Shawn Guo
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org, pawel.moll@arm.com,
linux-doc@vger.kernel.org, ijc+devicetree@hellion.org.uk,
linux-kernel@vger.kernel.org, robh+dt@kernel.org, timur@tabi.org,
broonie@kernel.org, rob@landley.net, galak@codeaurora.org,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20140402133955.GB29440@MrMyself>
> Subject: Re: [PATCH v2 2/2] ARM: dts: Append clock bindings for sai2 on V=
F610
> platform
>=20
> Hi Shawn,
>=20
> Thanks for the comments, but...
>=20
> On Wed, Apr 02, 2014 at 09:03:04PM +0800, Shawn Guo wrote:
> > On Wed, Apr 02, 2014 at 06:10:20PM +0800, Nicolin Chen wrote:
> > > Since we added fours clock to the DT binding, we should update the cu=
rrent
> > > SAI dts/dtsi so as not to break their functions.
> > >
> > > Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
> > > ---
> > > arch/arm/boot/dts/vf610.dtsi | 6 ++++--
> > > 1 file changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.d=
tsi
> > > index d31ce1b..9fd0007 100644
> > > --- a/arch/arm/boot/dts/vf610.dtsi
> > > +++ b/arch/arm/boot/dts/vf610.dtsi
> > > @@ -139,8 +139,10 @@
> > > compatible =3D "fsl,vf610-sai";
> > > reg =3D <0x40031000 0x1000>;
> > > interrupts =3D <0 86 0x04>;
> > > - clocks =3D <&clks VF610_CLK_SAI2>;
> > > - clock-names =3D "sai";
> > > + clocks =3D <&clks VF610_CLK_SAI2>,
> > > + <&clks VF610_CLK_SAI2>,
> > > + <&clks 0>, <&clks 0>;
> >
> > So it seems that SAI on vf610 does work with only one clock. So the
> > driver change will break old DTB for vf610? If that's case, we will
> > have to need a new compatible for cases where 4 clocks are needed.
>=20
> According to Vybrid's RM Chapter 9.11.12 SAI clocking, the SoC actually
> connects SAI with two clocks: SAI_CLK and Platform Bus Clock. So the DT
> binding here still needs to be corrected even if ignoring driver change.
>=20
> Besides, I've checked both SAI on imx and vf610 and found that they are
> seemly identical, especially for the clock part -- "The transmitter and
> receiver can independently select between the bus clock and up to three
> audio master clocks to generate the bit clock." And the driver that was
> designed for vf610 already contains the code to switch the clock between
> Bus Clock and Three MCLKs. What I want to say is, even if SAI on vf610
> does work with only one clock, it still doesn't have the full function
> on vf610 -- driving clock from Platform Bus Clock unless we make this
> improvement to the DT binding.
>=20
> So I think it's fair to complete the code here for both platforms, even
> though we might take the risk of merging conflict. And I understand
> your point to avoid function break on those platform both of us aren't
> convenient to test. But I've already involved Xiubo in the list. And
> we can wait for his test result.
>=20
This has been test on my Vybird-TWR board and it's fine.
Thanks,
Brs
Xiubo
> Hope you can understand the circumstance,
> Nicolin
^ permalink raw reply
* Re: [PATCH 1/2] ASoC: fsl_sai: Add clock control for SAI
From: Nicolin Chen @ 2014-04-04 9:38 UTC (permalink / raw)
To: Xiubo Li-B47053
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org, pawel.moll@arm.com,
linux-doc@vger.kernel.org, ijc+devicetree@hellion.org.uk,
timur@tabi.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org,
broonie@kernel.org, rob@landley.net, galak@codeaurora.org,
shawn.guo@linaro.org, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <f713ce2310f44ef883194429ba97d4a8@BY2PR03MB505.namprd03.prod.outlook.com>
On Fri, Apr 04, 2014 at 05:43:12PM +0800, Xiubo Li-B47053 wrote:
> > Subject: Re: [PATCH 1/2] ASoC: fsl_sai: Add clock control for SAI
> >
> > Hi Xiubo,
> >
> > On Fri, Apr 04, 2014 at 05:24:39PM +0800, Xiubo Li-B47053 wrote:
> > > Hi,
> > >
> > > I have test this series on my Vybrid-TWR board and it works happily.
> >
> > You just checked the wrong version. I've sent a mail to let people disregard
> > this version and a newer v2.
> >
>
> Sorry, I didn't receive these, I will search it in the web page.
>
> > >
> > > [...]
> > > > diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> > > > index 3847d2a..2d749df 100644
> > > > --- a/sound/soc/fsl/fsl_sai.c
> > > > +++ b/sound/soc/fsl/fsl_sai.c
> > > > @@ -428,5 +428,18 @@ static int fsl_sai_startup(struct snd_pcm_substream
> > > > *substream,
> > > > {
> > > > struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
> > > > - u32 reg;
> > > > + struct device *dev = &sai->pdev->dev;
> > > > + u32 reg, ret;
> > > > +
> > >
> > > I'd prefer:
> > > + int ret;
> >
> > Just like last time I said, it would be converted to 'int' any way. There's
> > no much difference between them.
> >
>
> Yes, it is...
>
> I have ever encounter something like this in the feature maybe someone will
> do the following check:
>
> If (ret < 0)
> ...
>
> Just one potential problem and one suggestion.
Fine...I'll revise it as you wish..after you checked the v2.
Thanks,
Nicolin
^ permalink raw reply
* RE: [PATCH 1/2] ASoC: fsl_sai: Add clock control for SAI
From: Li.Xiubo @ 2014-04-04 9:43 UTC (permalink / raw)
To: guangyu.chen@freescale.com
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org, pawel.moll@arm.com,
linux-doc@vger.kernel.org, ijc+devicetree@hellion.org.uk,
timur@tabi.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org,
broonie@kernel.org, rob@landley.net, galak@codeaurora.org,
shawn.guo@linaro.org, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20140404092804.GA2735@MrMyself>
> Subject: Re: [PATCH 1/2] ASoC: fsl_sai: Add clock control for SAI
>=20
> Hi Xiubo,
>=20
> On Fri, Apr 04, 2014 at 05:24:39PM +0800, Xiubo Li-B47053 wrote:
> > Hi,
> >
> > I have test this series on my Vybrid-TWR board and it works happily.
>=20
> You just checked the wrong version. I've sent a mail to let people disreg=
ard
> this version and a newer v2.
>=20
Sorry, I didn't receive these, I will search it in the web page.
> >
> > [...]
> > > diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> > > index 3847d2a..2d749df 100644
> > > --- a/sound/soc/fsl/fsl_sai.c
> > > +++ b/sound/soc/fsl/fsl_sai.c
> > > @@ -428,5 +428,18 @@ static int fsl_sai_startup(struct snd_pcm_substr=
eam
> > > *substream,
> > > {
> > > struct fsl_sai *sai =3D snd_soc_dai_get_drvdata(cpu_dai);
> > > - u32 reg;
> > > + struct device *dev =3D &sai->pdev->dev;
> > > + u32 reg, ret;
> > > +
> >
> > I'd prefer:
> > + int ret;
>=20
> Just like last time I said, it would be converted to 'int' any way. There=
's
> no much difference between them.
>=20
Yes, it is...
I have ever encounter something like this in the feature maybe someone will
do the following check:
If (ret < 0)
...
Just one potential problem and one suggestion.
Thanks,
> >
> > > + ret =3D clk_prepare_enable(sai->ipg_clk);
> > > + if (ret) {
> > > + dev_err(dev, "failed to prepare and enable ipg clock\n");
> > > + return ret;
> > > + }
> > > +
> >
> > [...]
> >
> > > @@ -609,5 +630,5 @@ static int fsl_sai_probe(struct platform_device *=
pdev)
> > >
> > > sai->regmap =3D devm_regmap_init_mmio_clk(&pdev->dev,
> > > - "sai", base, &fsl_sai_regmap_config);
> > > + "ipg", base, &fsl_sai_regmap_config);
> > > if (IS_ERR(sai->regmap)) {
> > > dev_err(&pdev->dev, "regmap init failed\n");
> > > @@ -615,4 +636,16 @@ static int fsl_sai_probe(struct platform_device =
*pdev)
> > > }
> > >
> > > + sai->ipg_clk =3D devm_clk_get(&pdev->dev, "ipg");
> > > + if (IS_ERR(sai->ipg_clk)) {
> > > + dev_err(&pdev->dev, "failed to get ipg clock\n");
> > > + return PTR_ERR(sai->ipg_clk);
> > > + }
> > > +
> >
> > Since the 'ipg' clock is just intend to be used for registers accessing=
and
> > We are using the regmap_init_mmio_clk(), so we can just drop it here an=
d
> > Let the regmap APIs to do the clock options properly.
>=20
> This 'ipg' clock, which I renamed in v2 to 'bus clock', is not just used
> in the way you said but also able to drive bit clock as your own code in
> the fsl_sai_set_dai_sysclk_tr(), and as reference manual describes:
>=20
> 52.3.1.3 Bus clock
> The bus clock is used by the control and configuration registers and to
> generate synchronous interrupts and DMA requests.
>=20
> Thanks,
> Nicolin
>=20
> >
> > Otherwise it look good to me.
> >
> > After this:
> > Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
> >
> >
> >
> > Thanks,
> >
> > Brs,
> > Xiubo
> >
> >
> >
> >
> > > + sai->sai_clk =3D devm_clk_get(&pdev->dev, "sai");
> > > + if (IS_ERR(sai->sai_clk)) {
> > > + dev_err(&pdev->dev, "failed to get sai clock\n");
> > > + return PTR_ERR(sai->sai_clk);
> > > + }
> > > +
> > > irq =3D platform_get_irq(pdev, 0);
> > > if (irq < 0) {
> > > diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h
> > > index 677670d..cbaf114 100644
> > > --- a/sound/soc/fsl/fsl_sai.h
> > > +++ b/sound/soc/fsl/fsl_sai.h
> > > @@ -127,4 +127,6 @@ struct fsl_sai {
> > > struct platform_device *pdev;
> > > struct regmap *regmap;
> > > + struct clk *ipg_clk;
> > > + struct clk *sai_clk;
> > >
> > > bool big_endian_regs;
> > > --
> > > 1.8.4
> > >
> >
^ permalink raw reply
* Re: [PATCH 1/2] ASoC: fsl_sai: Add clock control for SAI
From: Nicolin Chen @ 2014-04-04 9:28 UTC (permalink / raw)
To: Xiubo Li-B47053
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org, pawel.moll@arm.com,
linux-doc@vger.kernel.org, ijc+devicetree@hellion.org.uk,
timur@tabi.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org,
broonie@kernel.org, rob@landley.net, galak@codeaurora.org,
shawn.guo@linaro.org, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <49295d4f0f0f42c4b9c6de77583b978e@BY2PR03MB505.namprd03.prod.outlook.com>
Hi Xiubo,
On Fri, Apr 04, 2014 at 05:24:39PM +0800, Xiubo Li-B47053 wrote:
> Hi,
>
> I have test this series on my Vybrid-TWR board and it works happily.
You just checked the wrong version. I've sent a mail to let people disregard
this version and a newer v2.
>
> [...]
> > diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> > index 3847d2a..2d749df 100644
> > --- a/sound/soc/fsl/fsl_sai.c
> > +++ b/sound/soc/fsl/fsl_sai.c
> > @@ -428,5 +428,18 @@ static int fsl_sai_startup(struct snd_pcm_substream
> > *substream,
> > {
> > struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
> > - u32 reg;
> > + struct device *dev = &sai->pdev->dev;
> > + u32 reg, ret;
> > +
>
> I'd prefer:
> + int ret;
Just like last time I said, it would be converted to 'int' any way. There's
no much difference between them.
>
> > + ret = clk_prepare_enable(sai->ipg_clk);
> > + if (ret) {
> > + dev_err(dev, "failed to prepare and enable ipg clock\n");
> > + return ret;
> > + }
> > +
>
> [...]
>
> > @@ -609,5 +630,5 @@ static int fsl_sai_probe(struct platform_device *pdev)
> >
> > sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev,
> > - "sai", base, &fsl_sai_regmap_config);
> > + "ipg", base, &fsl_sai_regmap_config);
> > if (IS_ERR(sai->regmap)) {
> > dev_err(&pdev->dev, "regmap init failed\n");
> > @@ -615,4 +636,16 @@ static int fsl_sai_probe(struct platform_device *pdev)
> > }
> >
> > + sai->ipg_clk = devm_clk_get(&pdev->dev, "ipg");
> > + if (IS_ERR(sai->ipg_clk)) {
> > + dev_err(&pdev->dev, "failed to get ipg clock\n");
> > + return PTR_ERR(sai->ipg_clk);
> > + }
> > +
>
> Since the 'ipg' clock is just intend to be used for registers accessing and
> We are using the regmap_init_mmio_clk(), so we can just drop it here and
> Let the regmap APIs to do the clock options properly.
This 'ipg' clock, which I renamed in v2 to 'bus clock', is not just used
in the way you said but also able to drive bit clock as your own code in
the fsl_sai_set_dai_sysclk_tr(), and as reference manual describes:
52.3.1.3 Bus clock
The bus clock is used by the control and configuration registers and to
generate synchronous interrupts and DMA requests.
Thanks,
Nicolin
>
> Otherwise it look good to me.
>
> After this:
> Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
>
>
>
> Thanks,
>
> Brs,
> Xiubo
>
>
>
>
> > + sai->sai_clk = devm_clk_get(&pdev->dev, "sai");
> > + if (IS_ERR(sai->sai_clk)) {
> > + dev_err(&pdev->dev, "failed to get sai clock\n");
> > + return PTR_ERR(sai->sai_clk);
> > + }
> > +
> > irq = platform_get_irq(pdev, 0);
> > if (irq < 0) {
> > diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h
> > index 677670d..cbaf114 100644
> > --- a/sound/soc/fsl/fsl_sai.h
> > +++ b/sound/soc/fsl/fsl_sai.h
> > @@ -127,4 +127,6 @@ struct fsl_sai {
> > struct platform_device *pdev;
> > struct regmap *regmap;
> > + struct clk *ipg_clk;
> > + struct clk *sai_clk;
> >
> > bool big_endian_regs;
> > --
> > 1.8.4
> >
>
^ permalink raw reply
* RE: [PATCH 1/2] ASoC: fsl_sai: Add clock control for SAI
From: Li.Xiubo @ 2014-04-04 9:24 UTC (permalink / raw)
To: guangyu.chen@freescale.com, broonie@kernel.org,
shawn.guo@linaro.org
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org, pawel.moll@arm.com,
linux-doc@vger.kernel.org, ijc+devicetree@hellion.org.uk,
linux-kernel@vger.kernel.org, timur@tabi.org, robh+dt@kernel.org,
rob@landley.net, galak@codeaurora.org,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <87d225a25812d730c0865f9d0bb733c67d8b3ed1.1396352401.git.Guangyu.Chen@freescale.com>
Hi,
I have test this series on my Vybrid-TWR board and it works happily.
[...]
> diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> index 3847d2a..2d749df 100644
> --- a/sound/soc/fsl/fsl_sai.c
> +++ b/sound/soc/fsl/fsl_sai.c
> @@ -428,5 +428,18 @@ static int fsl_sai_startup(struct snd_pcm_substream
> *substream,
> {
> struct fsl_sai *sai =3D snd_soc_dai_get_drvdata(cpu_dai);
> - u32 reg;
> + struct device *dev =3D &sai->pdev->dev;
> + u32 reg, ret;
> +
I'd prefer:
+ int ret;
> + ret =3D clk_prepare_enable(sai->ipg_clk);
> + if (ret) {
> + dev_err(dev, "failed to prepare and enable ipg clock\n");
> + return ret;
> + }
> +
[...]
> @@ -609,5 +630,5 @@ static int fsl_sai_probe(struct platform_device *pdev=
)
>=20
> sai->regmap =3D devm_regmap_init_mmio_clk(&pdev->dev,
> - "sai", base, &fsl_sai_regmap_config);
> + "ipg", base, &fsl_sai_regmap_config);
> if (IS_ERR(sai->regmap)) {
> dev_err(&pdev->dev, "regmap init failed\n");
> @@ -615,4 +636,16 @@ static int fsl_sai_probe(struct platform_device *pde=
v)
> }
>=20
> + sai->ipg_clk =3D devm_clk_get(&pdev->dev, "ipg");
> + if (IS_ERR(sai->ipg_clk)) {
> + dev_err(&pdev->dev, "failed to get ipg clock\n");
> + return PTR_ERR(sai->ipg_clk);
> + }
> +
Since the 'ipg' clock is just intend to be used for registers accessing and
We are using the regmap_init_mmio_clk(), so we can just drop it here and
Let the regmap APIs to do the clock options properly.
Otherwise it look good to me.
After this:
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Thanks,
Brs,
Xiubo
> + sai->sai_clk =3D devm_clk_get(&pdev->dev, "sai");
> + if (IS_ERR(sai->sai_clk)) {
> + dev_err(&pdev->dev, "failed to get sai clock\n");
> + return PTR_ERR(sai->sai_clk);
> + }
> +
> irq =3D platform_get_irq(pdev, 0);
> if (irq < 0) {
> diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h
> index 677670d..cbaf114 100644
> --- a/sound/soc/fsl/fsl_sai.h
> +++ b/sound/soc/fsl/fsl_sai.h
> @@ -127,4 +127,6 @@ struct fsl_sai {
> struct platform_device *pdev;
> struct regmap *regmap;
> + struct clk *ipg_clk;
> + struct clk *sai_clk;
>=20
> bool big_endian_regs;
> --
> 1.8.4
>=20
^ permalink raw reply
* [PATCH v2] powerpc/tm: Disable IRQ in tm_recheckpoint
From: Michael Neuling @ 2014-04-04 9:19 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <1395985234-27281-1-git-send-email-mikey@neuling.org>
We can't take an IRQ when we're about to do a trechkpt as our GPR state is set
to user GPR values.
We've hit this when running some IBM Java stress tests in the lab resulting in
the following dump:
cpu 0x3f: Vector: 700 (Program Check) at [c000000007eb3d40]
pc: c000000000050074: restore_gprs+0xc0/0x148
lr: 00000000b52a8184
sp: ac57d360
msr: 8000000100201030
current = 0xc00000002c500000
paca = 0xc000000007dbfc00 softe: 0 irq_happened: 0x00
pid = 34535, comm = Pooled Thread #
R00 = 00000000b52a8184 R16 = 00000000b3e48fda
R01 = 00000000ac57d360 R17 = 00000000ade79bd8
R02 = 00000000ac586930 R18 = 000000000fac9bcc
R03 = 00000000ade60000 R19 = 00000000ac57f930
R04 = 00000000f6624918 R20 = 00000000ade79be8
R05 = 00000000f663f238 R21 = 00000000ac218a54
R06 = 0000000000000002 R22 = 000000000f956280
R07 = 0000000000000008 R23 = 000000000000007e
R08 = 000000000000000a R24 = 000000000000000c
R09 = 00000000b6e69160 R25 = 00000000b424cf00
R10 = 0000000000000181 R26 = 00000000f66256d4
R11 = 000000000f365ec0 R27 = 00000000b6fdcdd0
R12 = 00000000f66400f0 R28 = 0000000000000001
R13 = 00000000ada71900 R29 = 00000000ade5a300
R14 = 00000000ac2185a8 R30 = 00000000f663f238
R15 = 0000000000000004 R31 = 00000000f6624918
pc = c000000000050074 restore_gprs+0xc0/0x148
cfar= c00000000004fe28 dont_restore_vec+0x1c/0x1a4
lr = 00000000b52a8184
msr = 8000000100201030 cr = 24804888
ctr = 0000000000000000 xer = 0000000000000000 trap = 700
This moves tm_recheckpoint to a C function and moves the tm_restore_sprs into
that function. It then adds IRQ disabling over the trechkpt critical section.
It also sets the TEXASR FS in the signals code to ensure this is never set now
that we explictly write the TM sprs in tm_recheckpoint.
Signed-off-by: Michael Neuling <mikey@neuling.org>
cc: stable@vger.kernel.org
---
v2:
Fix bug where TM SPRs are not saved when outside a transaction.
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index af064d2..31d0215 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -610,6 +610,31 @@ out_and_saveregs:
tm_save_sprs(thr);
}
+extern void __tm_recheckpoint(struct thread_struct *thread,
+ unsigned long orig_msr);
+
+void tm_recheckpoint(struct thread_struct *thread,
+ unsigned long orig_msr)
+{
+ unsigned long flags;
+
+ /* We really can't be interrupted here as the TEXASR registers can't
+ * change and later in the trecheckpoint code, we have a userspace R1.
+ * So let's hard disable over this region.
+ */
+ local_irq_save(flags);
+ hard_irq_disable();
+
+ /* The TM SPRs are restored here, so that TEXASR.FS can be set
+ * before the trecheckpoint and no explosion occurs.
+ */
+ tm_restore_sprs(thread);
+
+ __tm_recheckpoint(thread, orig_msr);
+
+ local_irq_restore(flags);
+}
+
static inline void tm_recheckpoint_new_task(struct task_struct *new)
{
unsigned long msr;
@@ -628,13 +653,10 @@ static inline void tm_recheckpoint_new_task(struct task_struct *new)
if (!new->thread.regs)
return;
- /* The TM SPRs are restored here, so that TEXASR.FS can be set
- * before the trecheckpoint and no explosion occurs.
- */
- tm_restore_sprs(&new->thread);
-
- if (!MSR_TM_ACTIVE(new->thread.regs->msr))
+ if (!MSR_TM_ACTIVE(new->thread.regs->msr)){
+ tm_restore_sprs(&new->thread);
return;
+ }
msr = new->thread.tm_orig_msr;
/* Recheckpoint to restore original checkpointed register state. */
TM_DEBUG("*** tm_recheckpoint of pid %d "
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index a67e00a..4e47db6 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -881,6 +881,8 @@ static long restore_tm_user_regs(struct pt_regs *regs,
* transactional versions should be loaded.
*/
tm_enable();
+ /* Make sure the transaction is marked as failed */
+ current->thread.tm_texasr |= TEXASR_FS;
/* This loads the checkpointed FP/VEC state, if used */
tm_recheckpoint(¤t->thread, msr);
/* Get the top half of the MSR */
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 8d253c2..d501dc4 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -527,6 +527,8 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,
}
#endif
tm_enable();
+ /* Make sure the transaction is marked as failed */
+ current->thread.tm_texasr |= TEXASR_FS;
/* This loads the checkpointed FP/VEC state, if used */
tm_recheckpoint(¤t->thread, msr);
diff --git a/arch/powerpc/kernel/tm.S b/arch/powerpc/kernel/tm.S
index ef47bcb..03567c0 100644
--- a/arch/powerpc/kernel/tm.S
+++ b/arch/powerpc/kernel/tm.S
@@ -307,7 +307,7 @@ dont_backup_fp:
* Call with IRQs off, stacks get all out of sync for
* some periods in here!
*/
-_GLOBAL(tm_recheckpoint)
+_GLOBAL(__tm_recheckpoint)
mfcr r5
mflr r0
stw r5, 8(r1)
^ permalink raw reply related
* RE: [PATCH] ASoC: fsl_sai: Fix Bit Clock Polarity configurations
From: Li.Xiubo @ 2014-04-04 8:54 UTC (permalink / raw)
To: guangyu.chen@freescale.com
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
timur@tabi.org
In-Reply-To: <20140404074359.GA2599@MrMyself>
>=20
> Is that possible for you to test those two clock patches for fsl_sai?
>=20
> I think most of us are waiting for your reply to it. And I'd really
> like to move on to append clock dividing code into the driver so both
> of vybrid and imx can easily enable the DAI master mode.
>=20
Certainly, I will test them later.
Thanks,
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_sai: Fix Bit Clock Polarity configurations
From: Nicolin Chen @ 2014-04-04 7:44 UTC (permalink / raw)
To: Xiubo Li-B47053
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
timur@tabi.org
In-Reply-To: <9cb53ac6e0e04c01bc0c6ae6a4d42557@BY2PR03MB505.namprd03.prod.outlook.com>
Hi Xiubo,
On Fri, Apr 04, 2014 at 03:37:00PM +0800, Xiubo Li-B47053 wrote:
>
> > Subject: [PATCH] ASoC: fsl_sai: Fix Bit Clock Polarity configurations
> >
> > The BCP bit in TCR4/RCR4 register rules as followings:
> > 0 Bit clock is active high with drive outputs on rising edge
> > and sample inputs on falling edge.
> > 1 Bit clock is active low with drive outputs on falling edge
> > and sample inputs on rising edge.
> >
> > For all formats currently supported in the fsl_sai driver, they're exactly
> > sending data on the falling edge and sampling on the rising edge.
> >
> > However, the driver clears this BCP bit for all of them which results click
> > noise when working with SGTL5000 and big noise with WM8962.
> >
> > Thus this patch corrects the BCP settings for all the formats here to fix
> > the nosie issue.
> >
> > Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
> > ---
>
> Good catch.
>
> Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
>
> Thanks,
Is that possible for you to test those two clock patches for fsl_sai?
I think most of us are waiting for your reply to it. And I'd really
like to move on to append clock dividing code into the driver so both
of vybrid and imx can easily enable the DAI master mode.
Thank you,
Nicolin
> --
>
> BRs,
> Xiubo
>
>
> > sound/soc/fsl/fsl_sai.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> > index 99051c7..9bbebea 100644
> > --- a/sound/soc/fsl/fsl_sai.c
> > +++ b/sound/soc/fsl/fsl_sai.c
> > @@ -180,7 +180,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai
> > *cpu_dai,
> > * that is, together with the last bit of the previous
> > * data word.
> > */
> > - val_cr2 &= ~FSL_SAI_CR2_BCP;
> > + val_cr2 |= FSL_SAI_CR2_BCP;
> > val_cr4 |= FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP;
> > break;
> > case SND_SOC_DAIFMT_LEFT_J:
> > @@ -188,7 +188,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai
> > *cpu_dai,
> > * Frame high, one word length for frame sync,
> > * frame sync asserts with the first bit of the frame.
> > */
> > - val_cr2 &= ~FSL_SAI_CR2_BCP;
> > + val_cr2 |= FSL_SAI_CR2_BCP;
> > val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP);
> > break;
> > case SND_SOC_DAIFMT_DSP_A:
> > @@ -198,7 +198,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai
> > *cpu_dai,
> > * that is, together with the last bit of the previous
> > * data word.
> > */
> > - val_cr2 &= ~FSL_SAI_CR2_BCP;
> > + val_cr2 |= FSL_SAI_CR2_BCP;
> > val_cr4 &= ~FSL_SAI_CR4_FSP;
> > val_cr4 |= FSL_SAI_CR4_FSE;
> > sai->is_dsp_mode = true;
> > @@ -208,7 +208,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai
> > *cpu_dai,
> > * Frame high, one bit for frame sync,
> > * frame sync asserts with the first bit of the frame.
> > */
> > - val_cr2 &= ~FSL_SAI_CR2_BCP;
> > + val_cr2 |= FSL_SAI_CR2_BCP;
> > val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP);
> > sai->is_dsp_mode = true;
> > break;
> > --
> > 1.8.4
> >
>
^ permalink raw reply
* Re: MPC8641 based custom board Kernel stuck at 1000Mhz core clock
From: Ashish @ 2014-04-04 7:42 UTC (permalink / raw)
To: sanjeev sharma; +Cc: scottwood, linuxppc-dev, Valdis Kletnieks, kernelnewbies
In-Reply-To: <CAGUYZuR+rymKURoHURemEggZ8uktagyhGGuqtaWvN=11DQsoxw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5874 bytes --]
On Thursday 03 April 2014 08:55 AM, sanjeev sharma wrote:
> Are you able to capture kernel logs ?
>
> Regards
> Sanjeev Sharma
>
>
> On Thu, Mar 27, 2014 at 10:01 PM, <Valdis.Kletnieks@vt.edu
> <mailto:Valdis.Kletnieks@vt.edu>> wrote:
>
> On Thu, 27 Mar 2014 16:04:37 +0530, Ashish said:
> > Hi,
> >
> > I am using MPC8641-HPCN based custom board and able to boot
> linux at
> > MPX clock 400Mhz and core clock 800mhz. When I am increasing core
> > frequency ie MPX clock at 400Mhz and core at 1Ghz, kernel stuck.
>
> Step 0: Prove to us that your core actually runs reliable and
> stably at 1Ghz.
>
> Step 1: Figure out *where* it gets stuck. If you have earlyprintk
> working on
> your board, adding 'initcall_debug ignore_loglevel' to the kernel
> cmdline often
> helps track down where a kernel hangs during boot.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> <mailto:Kernelnewbies@kernelnewbies.org>
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
Hi,
Does kernel logs means debugging information that kernel prints while
booting using printk or it is something else?
Here is kernel boot logs that kernel printed while booting...
U-Boot 2013.04 (Jan 27 2014 - 11:21:21)
Unicore software on multiprocessor system!!
To enable mutlticore build define CONFIG_MP
CPU: 8641, Version: 2.1, (0x80900021)
Core: E600 Core 0, Version: 2.2, (0x80040202)
Clock Configuration:
CPU:1000 MHz, MPX:400 MHz
DDR:200 MHz (400 MT/s data rate), LBC:25 MHz
L1: D-cache 32 KB enabled
I-cache 32 KB enabled
L2: 512 KB enabled
Board: MPC8641-HPCN
I2C: ready
DRAM: 512 MiB
SDRAM test phase 1:
SDRAM test phase 2:
SDRAM test passed.
Flash: 16 MiB
EEPROM: NXID v1
In: serial
Out: serial
Err: serial
Net: eTSEC1, eTSEC2, eTSEC3, eTSEC4 [PRIME]
Hit any key to stop autoboot:
Speed: 1000, full duplex
Using eTSEC4 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename 'uRamdisk'.
Load address: 0x600000
Loading:
*\b#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
##################################################
13.1 MiB/s
done
Bytes transferred = 22680188 (15a127c hex)
Speed: 1000, full duplex
Using eTSEC4 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename 'uImage'.
Load address: 0x16000000
Loading:
*\b#################################################################
#################################################################
#######################################
14 MiB/s
done
Bytes transferred = 2476304 (25c910 hex)
Speed: 1000, full duplex
Using eTSEC4 device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename 'mpc8641_hpcn.dtb'.
Load address: 0x14000000
Loading: *\b#
2.6 MiB/s
done
Bytes transferred = 5540 (15a4 hex)
## Booting kernel from Legacy Image at 16000000 ...
Image Name: Linux-3.13.6
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 2476240 Bytes = 2.4 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 00600000 ...
Image Name: rootfs
Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
Data Size: 22680124 Bytes = 21.6 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 14000000
Booting using the fdt blob at 0x14000000
Uncompressing Kernel Image ... OK
Loading Ramdisk to 1e923000, end 1fec423c ... OK
Loading Device Tree to 007fb000, end 007ff5a3 ... OK /_*(some times
it stucking here) *_/
Using MPC86xx HPCN machine description
Total memory = 512MB; using 1024kB for hash table (at cff00000)
Linux version 3.13.6 (ashish@ashish-VirtualBox) (gcc version 4.7.2 (GCC)
) #8 Sat Mar 29 10:31:58 IST 2014
Found initrd at 0xde923000:0xdfec423c
bootconsole [udbg0] enabled
setup_arch: bootmem
mpc86xx_hpcn_setup_arch()
MPC86xx HPCN board from Freescale Semiconductor
arch: exit
Zone ranges:
DMA [mem 0x00000000-0x1fffffff]
Normal empty
HighMem empty
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x00000000-0x1fffffff] /_*(some times here) *_/
[-- Attachment #2: Type: text/html, Size: 9651 bytes --]
^ permalink raw reply
* RE: [PATCH] ASoC: fsl_sai: Fix Bit Clock Polarity configurations
From: Li.Xiubo @ 2014-04-04 7:37 UTC (permalink / raw)
To: guangyu.chen@freescale.com, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, timur@tabi.org
In-Reply-To: <1396595387-4371-1-git-send-email-Guangyu.Chen@freescale.com>
> Subject: [PATCH] ASoC: fsl_sai: Fix Bit Clock Polarity configurations
>=20
> The BCP bit in TCR4/RCR4 register rules as followings:
> 0 Bit clock is active high with drive outputs on rising edge
> and sample inputs on falling edge.
> 1 Bit clock is active low with drive outputs on falling edge
> and sample inputs on rising edge.
>=20
> For all formats currently supported in the fsl_sai driver, they're exactl=
y
> sending data on the falling edge and sampling on the rising edge.
>=20
> However, the driver clears this BCP bit for all of them which results cli=
ck
> noise when working with SGTL5000 and big noise with WM8962.
>=20
> Thus this patch corrects the BCP settings for all the formats here to fix
> the nosie issue.
>=20
> Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
> ---
Good catch.
Acked-by: Xiubo Li <Li.Xiubo@freescale.com>
Thanks,
--
BRs,
Xiubo
> sound/soc/fsl/fsl_sai.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>=20
> diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> index 99051c7..9bbebea 100644
> --- a/sound/soc/fsl/fsl_sai.c
> +++ b/sound/soc/fsl/fsl_sai.c
> @@ -180,7 +180,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai
> *cpu_dai,
> * that is, together with the last bit of the previous
> * data word.
> */
> - val_cr2 &=3D ~FSL_SAI_CR2_BCP;
> + val_cr2 |=3D FSL_SAI_CR2_BCP;
> val_cr4 |=3D FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP;
> break;
> case SND_SOC_DAIFMT_LEFT_J:
> @@ -188,7 +188,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai
> *cpu_dai,
> * Frame high, one word length for frame sync,
> * frame sync asserts with the first bit of the frame.
> */
> - val_cr2 &=3D ~FSL_SAI_CR2_BCP;
> + val_cr2 |=3D FSL_SAI_CR2_BCP;
> val_cr4 &=3D ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP);
> break;
> case SND_SOC_DAIFMT_DSP_A:
> @@ -198,7 +198,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai
> *cpu_dai,
> * that is, together with the last bit of the previous
> * data word.
> */
> - val_cr2 &=3D ~FSL_SAI_CR2_BCP;
> + val_cr2 |=3D FSL_SAI_CR2_BCP;
> val_cr4 &=3D ~FSL_SAI_CR4_FSP;
> val_cr4 |=3D FSL_SAI_CR4_FSE;
> sai->is_dsp_mode =3D true;
> @@ -208,7 +208,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai
> *cpu_dai,
> * Frame high, one bit for frame sync,
> * frame sync asserts with the first bit of the frame.
> */
> - val_cr2 &=3D ~FSL_SAI_CR2_BCP;
> + val_cr2 |=3D FSL_SAI_CR2_BCP;
> val_cr4 &=3D ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP);
> sai->is_dsp_mode =3D true;
> break;
> --
> 1.8.4
>=20
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox