Re: [linux-yocto] [PATCH 47/57] Basic perf support for axxia plaform block provided by LSI.

2014-03-24 Thread Svennebring, Jonas
Hi,

The basic support includes:
* Generic AXXIA SMON (Statistic Monitor) functionality.

* Support for Memory Controllers:
  - DDRC, DDR Controllers.
  - ELM, Encryption Memory Controllers .

*Preparation for support of:
  - PCX, integrated Ethernet switch.
  - VP, virtual pipeline packet processing engines.

Documentation, VP/PCX support as well as patch alignment with coming ARM L3$ 
and interconnect is in the workings.

Best Regards,

//Jonas

-Original Message-
From: Bruce Ashfield [mailto:bruce.ashfi...@windriver.com] 
Sent: den 20 mars 2014 09:44
To: Charlie Paul; linux-yocto@yoctoproject.org
Cc: charlie.p...@windriver.com; Svennebring, Jonas
Subject: Re: [PATCH 47/57] Basic perf support for axxia plaform block provided 
by LSI.

Can we get a short feature listing of what is included in the basic support ?

A summary here is fine, and perhaps a README or other perf documentation update 
as well.

Bruce

On 14-03-18 12:56 AM, Charlie Paul wrote:
 From: Jonas Svennebring jonas.svennebr...@lsi.com

 Signed-off-by: Jonas Svennebring jonas.svennebr...@lsi.com
 ---
   arch/arm/mach-axxia/perf_event_memc.c |  130 ++
   arch/arm/mach-axxia/perf_event_memc.h |   62 +++
   arch/arm/mach-axxia/perf_event_pcx.c  |   46 +
   arch/arm/mach-axxia/perf_event_platform.c |  270 
 +
   arch/arm/mach-axxia/perf_event_platform.h |   10 ++
   arch/arm/mach-axxia/perf_event_vp.c   |   51 ++
   arch/arm/mach-axxia/smon.c|  200 +
   arch/arm/mach-axxia/smon.h|   71 
   8 files changed, 840 insertions(+)
   create mode 100644 arch/arm/mach-axxia/perf_event_memc.c
   create mode 100644 arch/arm/mach-axxia/perf_event_memc.h
   create mode 100644 arch/arm/mach-axxia/perf_event_pcx.c
   create mode 100644 arch/arm/mach-axxia/perf_event_platform.c
   create mode 100644 arch/arm/mach-axxia/perf_event_platform.h
   create mode 100644 arch/arm/mach-axxia/perf_event_vp.c
   create mode 100644 arch/arm/mach-axxia/smon.c
   create mode 100644 arch/arm/mach-axxia/smon.h

 diff --git a/arch/arm/mach-axxia/perf_event_memc.c 
 b/arch/arm/mach-axxia/perf_event_memc.c
 new file mode 100644
 index 000..a20fc8a
 --- /dev/null
 +++ b/arch/arm/mach-axxia/perf_event_memc.c
 @@ -0,0 +1,130 @@
 +/*
 + * arch/arm/mach-axxia/perf_event_memc.c
 + * included from arch/arm/mach-axxia/perf_event_platform.c
 + *
 + * Support for the LSI Axxia boards based on ARM cores.
 + *
 + * Copyright (C) 2014 LSI
 + *
 + * This program is free software; you can redistribute it and/or 
 +modify
 + * it under the terms of the GNU General Public License as published 
 +by
 + * the Free Software Foundation; either version 2 of the License, or
 + * (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  
 +02111-1307  USA  */
 +
 +#include perf_event_memc.h
 +
 +static void memc_startup_init(void)
 +{
 + smon_init_ncp(ddrc0_smon, DDRC0, DDRC_PERF, DDRC_SMON);
 + smon_init_ncp(ddrc1_smon, DDRC1, DDRC_PERF, DDRC_SMON);
 + smon_init_mem(elm0_smon, ELM0, ELM_SMON);
 + smon_init_mem(elm1_smon, ELM1, ELM_SMON); }
 +
 +static uint32_t memc_pmu_event_init(uint32_t event, struct perf_event 
 +*pevent) {
 + return 0;
 +}
 +
 +static void memc_pmu_event_destroy(uint32_t event, struct perf_event 
 +*pevent) {
 + smon_stop_if_unassigned(ddrc0_smon);
 + smon_stop_if_unassigned(ddrc1_smon);
 + smon_stop_if_unassigned(elm0_smon);
 + smon_stop_if_unassigned(elm1_smon);
 +}
 +
 +static uint32_t memc_pmu_event_add(uint32_t ev, struct perf_event 
 +*pevent) {
 + uint32_t ret;
 +
 + if (ev = DDRC0_OFFSET  ev = DDRC0_SMON_MAX) {
 +
 + ret = smon_allocate(ddrc0_smon, ev - DDRC0_OFFSET);
 + if (ret != 0)
 + return ret;
 +
 + ret = smon_start(ddrc0_smon, ev - DDRC0_OFFSET);
 + if (ret != 0)
 + return ret;
 + } else if (ev = DDRC1_OFFSET  ev = DDRC1_SMON_MAX) {
 +
 + ret = smon_allocate(ddrc1_smon, ev - DDRC1_OFFSET);
 + if (ret != 0)
 + return ret;
 +
 + ret = smon_start(ddrc1_smon, ev - DDRC1_OFFSET);
 + if (ret != 0)
 + return ret;
 + } else if (ev = ELM0_OFFSET  ev = ELM0_SMON_MAX) {
 +
 + ret = smon_allocate(elm0_smon, ev - ELM0_OFFSET);
 + if (ret != 0)
 + return ret;
 +
 + ret = smon_start(elm0_smon, ev - ELM0_OFFSET);
 + if 

Re: [linux-yocto] [PATCH 47/57] Basic perf support for axxia plaform block provided by LSI.

2014-03-24 Thread Paul, Charlie
Yes

Working on getting comments updated for other patches as well before I resubmit

-Original Message-
From: Bruce Ashfield [mailto:bruce.ashfi...@windriver.com] 
Sent: Monday, March 24, 2014 6:09 AM
To: Svennebring, Jonas; Charlie Paul; linux-yocto@yoctoproject.org
Cc: Paul, Charlie
Subject: Re: [PATCH 47/57] Basic perf support for axxia plaform block provided 
by LSI.

On 14-03-24 07:24 AM, Svennebring, Jonas wrote:
 Hi,

 The basic support includes:
 * Generic AXXIA SMON (Statistic Monitor) functionality.

 * Support for Memory Controllers:
- DDRC, DDR Controllers.
- ELM, Encryption Memory Controllers .

 *Preparation for support of:
- PCX, integrated Ethernet switch.
- VP, virtual pipeline packet processing engines.

 Documentation, VP/PCX support as well as patch alignment with coming ARM L3$ 
 and interconnect is in the workings.


Looks good. Thanks for the summary.

Charlie: can we capture this in the log ?

Bruce

 Best Regards,

 //Jonas

 -Original Message-
 From: Bruce Ashfield [mailto:bruce.ashfi...@windriver.com]
 Sent: den 20 mars 2014 09:44
 To: Charlie Paul; linux-yocto@yoctoproject.org
 Cc: charlie.p...@windriver.com; Svennebring, Jonas
 Subject: Re: [PATCH 47/57] Basic perf support for axxia plaform block 
 provided by LSI.

 Can we get a short feature listing of what is included in the basic support ?

 A summary here is fine, and perhaps a README or other perf documentation 
 update as well.

 Bruce

 On 14-03-18 12:56 AM, Charlie Paul wrote:
 From: Jonas Svennebring jonas.svennebr...@lsi.com

 Signed-off-by: Jonas Svennebring jonas.svennebr...@lsi.com
 ---
arch/arm/mach-axxia/perf_event_memc.c |  130 ++
arch/arm/mach-axxia/perf_event_memc.h |   62 +++
arch/arm/mach-axxia/perf_event_pcx.c  |   46 +
arch/arm/mach-axxia/perf_event_platform.c |  270 
 +
arch/arm/mach-axxia/perf_event_platform.h |   10 ++
arch/arm/mach-axxia/perf_event_vp.c   |   51 ++
arch/arm/mach-axxia/smon.c|  200 +
arch/arm/mach-axxia/smon.h|   71 
8 files changed, 840 insertions(+)
create mode 100644 arch/arm/mach-axxia/perf_event_memc.c
create mode 100644 arch/arm/mach-axxia/perf_event_memc.h
create mode 100644 arch/arm/mach-axxia/perf_event_pcx.c
create mode 100644 arch/arm/mach-axxia/perf_event_platform.c
create mode 100644 arch/arm/mach-axxia/perf_event_platform.h
create mode 100644 arch/arm/mach-axxia/perf_event_vp.c
create mode 100644 arch/arm/mach-axxia/smon.c
create mode 100644 arch/arm/mach-axxia/smon.h

 diff --git a/arch/arm/mach-axxia/perf_event_memc.c
 b/arch/arm/mach-axxia/perf_event_memc.c
 new file mode 100644
 index 000..a20fc8a
 --- /dev/null
 +++ b/arch/arm/mach-axxia/perf_event_memc.c
 @@ -0,0 +1,130 @@
 +/*
 + * arch/arm/mach-axxia/perf_event_memc.c
 + * included from arch/arm/mach-axxia/perf_event_platform.c
 + *
 + * Support for the LSI Axxia boards based on ARM cores.
 + *
 + * Copyright (C) 2014 LSI
 + *
 + * This program is free software; you can redistribute it and/or 
 +modify
 + * it under the terms of the GNU General Public License as published 
 +by
 + * the Free Software Foundation; either version 2 of the License, or
 + * (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 +02111-1307  USA  */
 +
 +#include perf_event_memc.h
 +
 +static void memc_startup_init(void)
 +{
 +smon_init_ncp(ddrc0_smon, DDRC0, DDRC_PERF, DDRC_SMON);
 +smon_init_ncp(ddrc1_smon, DDRC1, DDRC_PERF, DDRC_SMON);
 +smon_init_mem(elm0_smon, ELM0, ELM_SMON);
 +smon_init_mem(elm1_smon, ELM1, ELM_SMON); }
 +
 +static uint32_t memc_pmu_event_init(uint32_t event, struct 
 +perf_event
 +*pevent) {
 +return 0;
 +}
 +
 +static void memc_pmu_event_destroy(uint32_t event, struct perf_event
 +*pevent) {
 +smon_stop_if_unassigned(ddrc0_smon);
 +smon_stop_if_unassigned(ddrc1_smon);
 +smon_stop_if_unassigned(elm0_smon);
 +smon_stop_if_unassigned(elm1_smon);
 +}
 +
 +static uint32_t memc_pmu_event_add(uint32_t ev, struct perf_event
 +*pevent) {
 +uint32_t ret;
 +
 +if (ev = DDRC0_OFFSET  ev = DDRC0_SMON_MAX) {
 +
 +ret = smon_allocate(ddrc0_smon, ev - DDRC0_OFFSET);
 +if (ret != 0)
 +return ret;
 +
 +ret = smon_start(ddrc0_smon, ev - DDRC0_OFFSET);
 +if (ret != 0)
 +return ret;
 +} else if (ev = DDRC1_OFFSET  ev =