Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1450310
| From | hl <hl@rock-chips.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 1/7] firmware: rockchip: sip: Add rockchip SIP runtime service |
| Date | 2016-07-26 03:20 +0200 |
| Message-ID | <rYZcm-3RR-11@gated-at.bofh.it> (permalink) |
| References | <rXED0-3Mr-7@gated-at.bofh.it> <rXED0-3Mr-17@gated-at.bofh.it> <rXPI6-2jT-5@gated-at.bofh.it> <rYS1c-7ph-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Sudeep Holla,
On 2016年07月26日 01:36, Sudeep Holla wrote:
>
>
> On 22/07/16 21:50, Heiko Stübner wrote:
>> Hi again,
>>
>> one bigger thing I noticed only now.
>>
>> Am Freitag, 22. Juli 2016, 17:07:14 schrieben Sie:
>>> diff --git a/drivers/firmware/rockchip_sip.c
>>> b/drivers/firmware/rockchip_sip.c new file mode 100644
>>> index 0000000..7756af9
>>> --- /dev/null
>>> +++ b/drivers/firmware/rockchip_sip.c
>>> @@ -0,0 +1,64 @@
>>> +/*
>>> + * This program is free software; you can redistribute it and/or
>>> modify
>>> + * it under the terms of the GNU General Public License version 2 as
>>> + * published by the Free Software Foundation.
>>> + *
>>> + * 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.
>>> + *
>>> + * Copyright (C) 2016 ARM Limited
>>> + */
>>> +#include <linux/errno.h>
>>> +#include <linux/linkage.h>
>>> +#include <linux/of.h>
>>> +#include <linux/pm.h>
>>> +#include <linux/printk.h>
>>> +#include "rockchip_sip.h"
>>> +
>>> +typedef unsigned long (psci_fn)(unsigned long, unsigned long,
>>> + unsigned long, unsigned long);
>>> +asmlinkage psci_fn __invoke_psci_fn_smc;
>>> +
>>> +#define CONFIG_DRAM_INIT 0x00
>>> +#define CONFIG_DRAM_SET_RATE 0x01
>>> +#define CONFIG_DRAM_ROUND_RATE 0x02
>>> +#define CONFIG_DRAM_SET_AT_SR 0x03
>>> +#define CONFIG_DRAM_GET_BW 0x04
>>> +#define CONFIG_DRAM_GET_RATE 0x05
>>> +#define CONFIG_DRAM_CLR_IRQ 0x06
>>> +#define CONFIG_DRAM_SET_PARAM 0x07
>>> +
>>> +uint64_t sip_smc_ddr_init(void)
>>> +{
>>> + return __invoke_psci_fn_smc(SIP_DDR_FREQ, 0,
>>> + 0, CONFIG_DRAM_INIT);
>>
>> I don't think that is legal to use. For one this function itself is
>> declared
>> static in the psci code - most likely for a specific reason.
>>
>> And also if anything invoke_psci_fn would hold the correct pointer
>> depending
>> on the calling method.
>>
>> But as said above, accessing psci static stuff is most likely wrong.
>> Maybe the
>> two psci people I've included can tell us how this is to be accessed.
>>
>
> Thanks Heiko for looping us in this thread.
>
> The feature being added in this series is completely out of scope of
> PSCI specification and hence PSCI can't be used. Firstly we need to
> audit if these are need in Linux and why they can't be handled within
> the existing PSCI APIs. But yes, this series is misuse of PSCI.
>
> I also see to know that ARM Trusted Firmware community has not accepted
> this PSCI approach, so this patches are useless without that.
>
> If they are still needed they need to make use of SMC Calling Convention
> (arm_smccc_smc). Either make these smc function identifiers standard on
> their platforms and use them directly in the driver. If they tend to
> change too much across their platforms, use the DT approach with
> appropriate bindings.
Thanks for your suggestion, i will update the code in next version.
--
Lin Huang
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 0/7] rk3399 support ddr frequency scaling Lin Huang <hl@rock-chips.com> - 2016-07-22 11:10 +0200
[PATCH v3 4/7] clk: rockchip: rk3399: add ddrc clock support Lin Huang <hl@rock-chips.com> - 2016-07-22 11:10 +0200
[PATCH v3 1/7] firmware: rockchip: sip: Add rockchip SIP runtime service Lin Huang <hl@rock-chips.com> - 2016-07-22 11:10 +0200
Re: [PATCH v3 1/7] firmware: rockchip: sip: Add rockchip SIP runtime service Heiko Stübner <heiko@sntech.de> - 2016-07-22 12:10 +0200
Re: [PATCH v3 1/7] firmware: rockchip: sip: Add rockchip SIP runtime service Heiko Stübner <heiko@sntech.de> - 2016-07-22 23:00 +0200
Re: [PATCH v3 1/7] firmware: rockchip: sip: Add rockchip SIP runtime service hl <hl@rock-chips.com> - 2016-07-24 10:10 +0200
Re: [PATCH v3 1/7] firmware: rockchip: sip: Add rockchip SIP runtime service Sudeep Holla <sudeep.holla@arm.com> - 2016-07-25 19:40 +0200
Re: [PATCH v3 1/7] firmware: rockchip: sip: Add rockchip SIP runtime service hl <hl@rock-chips.com> - 2016-07-26 03:20 +0200
Re: [PATCH v3 1/7] firmware: rockchip: sip: Add rockchip SIP runtime service Mark Rutland <mark.rutland@arm.com> - 2016-07-26 20:30 +0200
[PATCH v3 2/7] clk: rockchip: add new clock-type for the ddrclk Lin Huang <hl@rock-chips.com> - 2016-07-22 11:10 +0200
Re: [PATCH v3 2/7] clk: rockchip: add new clock-type for the ddrclk Heiko Stübner <heiko@sntech.de> - 2016-07-24 11:10 +0200
[PATCH v3 5/7] PM / devfreq: event: support rockchip dfi controller Lin Huang <hl@rock-chips.com> - 2016-07-22 11:10 +0200
Re: [PATCH v3 5/7] PM / devfreq: event: support rockchip dfi controller Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-22 22:30 +0200
[PATCH v3 7/7] drm/rockchip: Add dmc notifier in vop driver Lin Huang <hl@rock-chips.com> - 2016-07-22 11:10 +0200
[PATCH v3 6/7] PM / devfreq: rockchip: add devfreq driver for rk3399 dmc Lin Huang <hl@rock-chips.com> - 2016-07-22 11:10 +0200
Re: [PATCH v3 6/7] PM / devfreq: rockchip: add devfreq driver for rk3399 dmc Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-22 22:30 +0200
Re: [PATCH v3 6/7] PM / devfreq: rockchip: add devfreq driver for rk3399 dmc hl <hl@rock-chips.com> - 2016-07-24 10:00 +0200
Re: [PATCH v3 6/7] PM / devfreq: rockchip: add devfreq driver for rk3399 dmc Chanwoo Choi <cw00.choi@samsung.com> - 2016-07-25 08:10 +0200
Re: [PATCH v3 6/7] PM / devfreq: rockchip: add devfreq driver for rk3399 dmc hl <hl@rock-chips.com> - 2016-07-25 10:50 +0200
Re: [PATCH v3 6/7] PM / devfreq: rockchip: add devfreq driver for rk3399 dmc Chanwoo Choi <cw00.choi@samsung.com> - 2016-07-25 11:50 +0200
Re: [PATCH v3 6/7] PM / devfreq: rockchip: add devfreq driver for rk3399 dmc hl <hl@rock-chips.com> - 2016-07-26 03:20 +0200
csiph-web