[PATCH 1/1] nds32: Power management for nds32

2018-10-23 Thread Nickhu
will be break and resume the system. Signed-off-by: Nickhu --- arch/nds32/Kconfig | 10 +++ arch/nds32/include/asm/suspend.h | 11 +++ arch/nds32/kernel/Makefile | 2 +- arch/nds32/kernel/pm.c | 91 ++ arch/nds32/kernel/sleep.S| 129

[PATCH 0/1] nds32: Power management

2018-10-23 Thread Nickhu
This commit is power management porting for nds32. Nickhu (1): nds32: Power management for nds32 arch/nds32/Kconfig | 10 +++ arch/nds32/include/asm/suspend.h | 11 +++ arch/nds32/kernel/Makefile | 2 +- arch/nds32/kernel/pm.c | 91

[PATCH 1/1] nds32: Power management for nds32

2018-10-23 Thread Nickhu
will be break and resume the system. Signed-off-by: Nickhu --- arch/nds32/Kconfig | 10 +++ arch/nds32/include/asm/suspend.h | 11 +++ arch/nds32/kernel/Makefile | 2 +- arch/nds32/kernel/pm.c | 91 ++ arch/nds32/kernel/sleep.S| 129

[PATCH 0/1] nds32: Power management

2018-10-23 Thread Nickhu
This commit is power management porting for nds32. Nickhu (1): nds32: Power management for nds32 arch/nds32/Kconfig | 10 +++ arch/nds32/include/asm/suspend.h | 11 +++ arch/nds32/kernel/Makefile | 2 +- arch/nds32/kernel/pm.c | 91

[PATCH v3 2/4] nds32: Perf porting

2018-10-23 Thread Nickhu
would be failed when the program hang in loop. 2. Don't print the error message, the ltp would pass. But the user need to have the knowledge that don't count the events which map to the same counter, or the user will get the inaccurate results. We choose method

[PATCH v3 2/4] nds32: Perf porting

2018-10-23 Thread Nickhu
would be failed when the program hang in loop. 2. Don't print the error message, the ltp would pass. But the user need to have the knowledge that don't count the events which map to the same counter, or the user will get the inaccurate results. We choose method

[PATCH v3 4/4] nds32: Add document for NDS32 PMU.

2018-10-23 Thread Nickhu
The document for how to add NDS32 PMU in devicetree. Signed-off-by: Nickhu --- Documentation/devicetree/bindings/nds32/pmu.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/nds32/pmu.txt diff --git a/Documentation/devicetree

[PATCH v3 3/4] nds32: Add perf call-graph support.

2018-10-23 Thread Nickhu
: - | lp | - | fp | 2. leaf function: - | fp | Signed-off-by: Nickhu --- arch/nds32/kernel/perf_event_cpu.c | 299

[PATCH v3 1/4] nds32: Fix bug in bitfield.h

2018-10-23 Thread Nickhu
There two bitfield bug for perfomance counter in bitfield.h: PFM_CTL_offSEL1 21 --> 16 PFM_CTL_offSEL2 27 --> 22 This commit fix it. Signed-off-by: Nickhu --- arch/nds32/include/asm/bitfield.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v3 4/4] nds32: Add document for NDS32 PMU.

2018-10-23 Thread Nickhu
The document for how to add NDS32 PMU in devicetree. Signed-off-by: Nickhu --- Documentation/devicetree/bindings/nds32/pmu.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/nds32/pmu.txt diff --git a/Documentation/devicetree

[PATCH v3 3/4] nds32: Add perf call-graph support.

2018-10-23 Thread Nickhu
: - | lp | - | fp | 2. leaf function: - | fp | Signed-off-by: Nickhu --- arch/nds32/kernel/perf_event_cpu.c | 299

[PATCH v3 1/4] nds32: Fix bug in bitfield.h

2018-10-23 Thread Nickhu
There two bitfield bug for perfomance counter in bitfield.h: PFM_CTL_offSEL1 21 --> 16 PFM_CTL_offSEL2 27 --> 22 This commit fix it. Signed-off-by: Nickhu --- arch/nds32/include/asm/bitfield.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v3 0/4] nds32: Perf Support

2018-10-23 Thread Nickhu
the typo in Documentation/devicetree/ bindings/nds32/pmu.txt. Nickhu (4): nds32: Fix bug in bitfield.h nds32: Perf porting nds32: Add perf call-graph support. nds32: Add document for NDS32 PMU. .../devicetree/bindings/nds32/pmu.txt | 17 + arch/nds32/Kconfig

[PATCH v3 0/4] nds32: Perf Support

2018-10-23 Thread Nickhu
the typo in Documentation/devicetree/ bindings/nds32/pmu.txt. Nickhu (4): nds32: Fix bug in bitfield.h nds32: Perf porting nds32: Add perf call-graph support. nds32: Add document for NDS32 PMU. .../devicetree/bindings/nds32/pmu.txt | 17 + arch/nds32/Kconfig

[PATCH 1/4] nds32: Fix bug in bitfield.h

2018-10-23 Thread Nickhu
There two bitfield bug for perfomance counter in bitfield.h: PFM_CTL_offSEL1 21 --> 16 PFM_CTL_offSEL2 27 --> 22 This commit fix it. Signed-off-by: Nickhu --- arch/nds32/include/asm/bitfield.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH 1/4] nds32: Fix bug in bitfield.h

2018-10-23 Thread Nickhu
There two bitfield bug for perfomance counter in bitfield.h: PFM_CTL_offSEL1 21 --> 16 PFM_CTL_offSEL2 27 --> 22 This commit fix it. Signed-off-by: Nickhu --- arch/nds32/include/asm/bitfield.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH 0/4] nds32: Perf Support

2018-10-23 Thread Nickhu
These four commits are perf supporting for nds32. There are three perfomance counters in nds32, and each of them can counts different events. You can use 'perf list' to show the available events that can be used. Nickhu (4): nds32: Fix bug in bitfield.h nds32: Perf porting nds32: Add perf

[PATCH 2/4] nds32: Perf porting

2018-10-23 Thread Nickhu
would be failed when the program hang in loop. 2. Don't print the error message, the ltp would pass. But the user need to have the knowledge that don't count the events which map to the same counter, or the user will get the inaccurate results. We choose method

[PATCH 0/4] nds32: Perf Support

2018-10-23 Thread Nickhu
These four commits are perf supporting for nds32. There are three perfomance counters in nds32, and each of them can counts different events. You can use 'perf list' to show the available events that can be used. Nickhu (4): nds32: Fix bug in bitfield.h nds32: Perf porting nds32: Add perf

[PATCH 2/4] nds32: Perf porting

2018-10-23 Thread Nickhu
would be failed when the program hang in loop. 2. Don't print the error message, the ltp would pass. But the user need to have the knowledge that don't count the events which map to the same counter, or the user will get the inaccurate results. We choose method

[PATCH 4/4] nds32: Add document for NDS32 PMU.

2018-10-23 Thread Nickhu
The document for how to add NDS32 PMU in devicetree. Signed-off-by: Nickhu --- Documentation/devicetree/bindings/nds32/pmu.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/nds32/pmu.txt diff --git a/Documentation/devicetree

[PATCH 3/4] nds32: Add perf call-graph support.

2018-10-23 Thread Nickhu
: - | lp | - | fp | 2. leaf function: - | fp | Signed-off-by: Nickhu --- arch/nds32/kernel/perf_event_cpu.c | 299

[PATCH 4/4] nds32: Add document for NDS32 PMU.

2018-10-23 Thread Nickhu
The document for how to add NDS32 PMU in devicetree. Signed-off-by: Nickhu --- Documentation/devicetree/bindings/nds32/pmu.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/nds32/pmu.txt diff --git a/Documentation/devicetree

[PATCH 3/4] nds32: Add perf call-graph support.

2018-10-23 Thread Nickhu
: - | lp | - | fp | 2. leaf function: - | fp | Signed-off-by: Nickhu --- arch/nds32/kernel/perf_event_cpu.c | 299

[PATCH 3/3] nds32: Add unaligned access in kernel space.

2018-10-18 Thread Nickhu
kernel unaligned access. The kernel is hang in the loop. Signed-off-by: Nickhu --- arch/nds32/kernel/traps.c | 4 +++- arch/nds32/mm/alignment.c | 6 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/nds32/kernel/traps.c b/arch/nds32/kernel/traps.c index 1496aab48998

[PATCH 1/1] Perf: Compile failed when compile with libelf.

2018-10-18 Thread Nickhu
/symbol.h:20, from util/symbol-elf.c:9: /local/nickhu/build-system-3/toolchain/nds32le-linux-glibc-v3-upstream/ nds32le-linux/sysroot/usr/include/libelf.h:266:12: note: previous declaration of 'elf_getphdrnum' was here extern int elf_getphdrnum (Elf *__elf, size_t *__dst

[PATCH 0/1] nds32: Fix gcc 8.0 compiler option incompatible.

2018-10-18 Thread Nickhu
Fix gcc 8.0 compiler option incompatible When the kernel configs of ftrace and frame pointer options are choosed. Nickhu (1): nds32: Fix gcc 8.0 compiler option incompatible. arch/nds32/mm/Makefile | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.17.0

[PATCH 0/1] Perf: Compile failed when compile with libelf.

2018-10-18 Thread Nickhu
Fix perf failed when compile with libelf. Nickhu (1): Perf: Compile failed when compile with libelf. tools/perf/util/symbol-elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.0

[PATCH 1/1] Perf: Compile failed when compile with libelf.

2018-10-18 Thread Nickhu
/symbol.h:20, from util/symbol-elf.c:9: /local/nickhu/build-system-3/toolchain/nds32le-linux-glibc-v3-upstream/ nds32le-linux/sysroot/usr/include/libelf.h:266:12: note: previous declaration of 'elf_getphdrnum' was here extern int elf_getphdrnum (Elf *__elf, size_t *__dst

[PATCH 0/1] nds32: Fix gcc 8.0 compiler option incompatible.

2018-10-18 Thread Nickhu
Fix gcc 8.0 compiler option incompatible When the kernel configs of ftrace and frame pointer options are choosed. Nickhu (1): nds32: Fix gcc 8.0 compiler option incompatible. arch/nds32/mm/Makefile | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.17.0

[PATCH 0/1] Perf: Compile failed when compile with libelf.

2018-10-18 Thread Nickhu
Fix perf failed when compile with libelf. Nickhu (1): Perf: Compile failed when compile with libelf. tools/perf/util/symbol-elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.0

[PATCH 3/3] nds32: Add unaligned access in kernel space.

2018-10-18 Thread Nickhu
kernel unaligned access. The kernel is hang in the loop. Signed-off-by: Nickhu --- arch/nds32/kernel/traps.c | 4 +++- arch/nds32/mm/alignment.c | 6 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/nds32/kernel/traps.c b/arch/nds32/kernel/traps.c index 1496aab48998

[PATCH 1/3] nds32: Fix instruction simulator bug for unaligned access handler.

2018-10-18 Thread Nickhu
. But the index of target register should be 16. So the mapping of register in unaligned access handler is wrong. Signed-off-by: Nickhu --- arch/nds32/mm/alignment.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/arch/nds32/mm/alignment.c

[PATCH 2/3] nds32: Add 'HAVE_EFFICIENT_UNALIGNED_ACCESS' config

2018-10-18 Thread Nickhu
. 'HAVE_EFFICIENT_UNALIGNED_ACCESS' and 'HW_SUPPORT_UNALIGNMENT_ACCESS' are default configs in nds32. Signed-off-by: Nickhu --- arch/nds32/Kconfig.cpu | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/nds32/Kconfig.cpu b/arch/nds32/Kconfig.cpu index b8c8984d1456..b8eecd0cde6b 100644

[PATCH 2/3] nds32: Add 'HAVE_EFFICIENT_UNALIGNED_ACCESS' config

2018-10-18 Thread Nickhu
. 'HAVE_EFFICIENT_UNALIGNED_ACCESS' and 'HW_SUPPORT_UNALIGNMENT_ACCESS' are default configs in nds32. Signed-off-by: Nickhu --- arch/nds32/Kconfig.cpu | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/nds32/Kconfig.cpu b/arch/nds32/Kconfig.cpu index b8c8984d1456..b8eecd0cde6b 100644

[PATCH 1/3] nds32: Fix instruction simulator bug for unaligned access handler.

2018-10-18 Thread Nickhu
. But the index of target register should be 16. So the mapping of register in unaligned access handler is wrong. Signed-off-by: Nickhu --- arch/nds32/mm/alignment.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/arch/nds32/mm/alignment.c

[PATCH 1/1] nds32: Fix gcc 8.0 compiler option incompatible.

2018-10-18 Thread Nickhu
When the kernel configs of ftrace and frame pointer options are choosed, the compiler option of kernel will incompatible. Error message: nds32le-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible Signed-off-by: Nickhu Signed-off-by: Zong Li

[PATCH 1/1] nds32: Fix gcc 8.0 compiler option incompatible.

2018-10-18 Thread Nickhu
When the kernel configs of ftrace and frame pointer options are choosed, the compiler option of kernel will incompatible. Error message: nds32le-linux-gcc: error: -pg and -fomit-frame-pointer are incompatible Signed-off-by: Nickhu Signed-off-by: Zong Li

[PATCH 0/3] nds32: Unaligned access handler fix

2018-10-18 Thread Nickhu
The patches are about unaligned access handler. We fix some bugs in unaligned access handler and add some kernel configs for unaligned access handler. Then we add the kernel unaligned access handled by software in handler. Nickhu (3): nds32: Fix instruction simulator bug for unaligned access

[PATCH 0/3] nds32: Unaligned access handler fix

2018-10-18 Thread Nickhu
The patches are about unaligned access handler. We fix some bugs in unaligned access handler and add some kernel configs for unaligned access handler. Then we add the kernel unaligned access handled by software in handler. Nickhu (3): nds32: Fix instruction simulator bug for unaligned access

[PATCH 3/5] nds32: Add perf call-graph support.

2018-10-18 Thread Nickhu
: - | lp | - | fp | 2. leaf function: - | fp | Signed-off-by: Nickhu --- arch/nds32/kernel/perf_event_cpu.c | 299

[PATCH 3/5] nds32: Add perf call-graph support.

2018-10-18 Thread Nickhu
: - | lp | - | fp | 2. leaf function: - | fp | Signed-off-by: Nickhu --- arch/nds32/kernel/perf_event_cpu.c | 299

[PATCH 2/5] nds32: Fix bug in bitfield.h

2018-10-18 Thread Nickhu
There two bitfield bug for perfomance counter in bitfield.h: PFM_CTL_offSEL1 21 --> 16 PFM_CTL_offSEL2 27 --> 22 This commit fix it. Signed-off-by: Nickhu --- arch/nds32/include/asm/bitfield.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH 4/5] nds32: Fix perf multiple events map to same counter.

2018-10-18 Thread Nickhu
count the events which map to the same counter, or the user will get the inaccurate results. We choose method 2 for the solution Signed-off-by: Nickhu --- arch/nds32/include/asm/pmu.h | 1 + arch/nds32/kernel/perf_event_cpu.c | 30 -- 2 files changed, 21

[PATCH 1/5] nds32: Perf porting

2018-10-18 Thread Nickhu
Furthermore, NDS32 SPAv3 is not able to detect it is read or write. It only know either it is instruction fetch or data access. Therefore, by removing the wrong flag assignment(actually, the hardware is not able to show the reason), we can fix this bug. Signed-off-by: Nickhu --- arch/nds

[PATCH 2/5] nds32: Fix bug in bitfield.h

2018-10-18 Thread Nickhu
There two bitfield bug for perfomance counter in bitfield.h: PFM_CTL_offSEL1 21 --> 16 PFM_CTL_offSEL2 27 --> 22 This commit fix it. Signed-off-by: Nickhu --- arch/nds32/include/asm/bitfield.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH 4/5] nds32: Fix perf multiple events map to same counter.

2018-10-18 Thread Nickhu
count the events which map to the same counter, or the user will get the inaccurate results. We choose method 2 for the solution Signed-off-by: Nickhu --- arch/nds32/include/asm/pmu.h | 1 + arch/nds32/kernel/perf_event_cpu.c | 30 -- 2 files changed, 21

[PATCH 1/5] nds32: Perf porting

2018-10-18 Thread Nickhu
Furthermore, NDS32 SPAv3 is not able to detect it is read or write. It only know either it is instruction fetch or data access. Therefore, by removing the wrong flag assignment(actually, the hardware is not able to show the reason), we can fix this bug. Signed-off-by: Nickhu --- arch/nds

[PATCH 5/5] nds32: Add document for NDS32 PMU.

2018-10-18 Thread Nickhu
The document for how to add NDS32 PMU in devicetree. Signed-off-by: Nickhu --- Documentation/devicetree/bindings/nds32/pmu.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/nds32/pmu.txt diff --git a/Documentation/devicetree

[PATCH 0/5] nds32: Perf support

2018-10-18 Thread Nickhu
These two commit are perf supporting for nds32. There are three perfomance counters in nds32, and each of them can counts different events. You can use 'perf list' to show the available events that can be used. Nickhu (5): nds32: Perf porting nds32: Fix bug in bitfield.h nds32: Add perf

[PATCH 5/5] nds32: Add document for NDS32 PMU.

2018-10-18 Thread Nickhu
The document for how to add NDS32 PMU in devicetree. Signed-off-by: Nickhu --- Documentation/devicetree/bindings/nds32/pmu.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/nds32/pmu.txt diff --git a/Documentation/devicetree

[PATCH 0/5] nds32: Perf support

2018-10-18 Thread Nickhu
These two commit are perf supporting for nds32. There are three perfomance counters in nds32, and each of them can counts different events. You can use 'perf list' to show the available events that can be used. Nickhu (5): nds32: Perf porting nds32: Fix bug in bitfield.h nds32: Add perf

[PATCH 2/2] nds32: Fix the unaligned access handler

2018-05-07 Thread Nickhu
If the kernel config 'CONFIG_ALIGNMENT_TRAP' and the file '/proc/sys/nds32/unaligned_access/enable' are set, the kernel unaligned access handler does not handle correctly when the value of immediate field is negative. This commit fixes the unaligned access handler in kernel. Signed-off-by: Nickhu

[PATCH 2/2] nds32: Fix the unaligned access handler

2018-05-07 Thread Nickhu
If the kernel config 'CONFIG_ALIGNMENT_TRAP' and the file '/proc/sys/nds32/unaligned_access/enable' are set, the kernel unaligned access handler does not handle correctly when the value of immediate field is negative. This commit fixes the unaligned access handler in kernel. Signed-off-by: Nickhu

[PATCH 0/2] nds32:Renaming file and fixing the unaligned access handler

2018-05-07 Thread Nickhu
or negative and then change the value of immediate filed to unsigned integer number. Nickhu (2): nds32: Renaming the file for unaligned access nds32: Fix the unaligned access handler arch/nds32/mm/alignment.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.17.0

[PATCH 0/2] nds32:Renaming file and fixing the unaligned access handler

2018-05-07 Thread Nickhu
or negative and then change the value of immediate filed to unsigned integer number. Nickhu (2): nds32: Renaming the file for unaligned access nds32: Fix the unaligned access handler arch/nds32/mm/alignment.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.17.0

[PATCH 1/2] nds32: Renaming the file for unaligned access

2018-05-07 Thread Nickhu
Change the name of the file '/proc/sys/nds32/unaligned_acess' to '/proc/sys/nds32/unaligned_access' Signed-off-by: Nickhu <nic...@andestech.com> --- arch/nds32/mm/alignment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nds32/mm/alignment.c b/arch/nds32/mm/align

[PATCH 1/2] nds32: Renaming the file for unaligned access

2018-05-07 Thread Nickhu
Change the name of the file '/proc/sys/nds32/unaligned_acess' to '/proc/sys/nds32/unaligned_access' Signed-off-by: Nickhu --- arch/nds32/mm/alignment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nds32/mm/alignment.c b/arch/nds32/mm/alignment.c index b96a01b10ca7