Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1713034

Re: [PATCH 3/3] soc: xilinx: zynqmp: Add firmware interface

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] soc: xilinx: zynqmp: Add firmware interface
Date 2017-08-16 17:10 +0200
Message-ID <uf87g-cZ-13@gated-at.bofh.it> (permalink)
References (2 earlier) <uepaa-5HJ-19@gated-at.bofh.it> <uf5VL-76W-3@gated-at.bofh.it> <uf5VL-76W-1@gated-at.bofh.it> <uf87g-cZ-15@gated-at.bofh.it> <uf87g-cZ-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 16, 2017 at 4:34 PM, Michal Simek <michal.simek@xilinx.com> wrote:
> On 16.8.2017 16:00, Michal Simek wrote:
>> On 16.8.2017 14:41, Arnd Bergmann wrote:
>>
>
> What do you think?
>                 ret_payload[0] = lower_32_bits(le64_to_cpu(res.a0));
>                 ret_payload[1] = upper_32_bits(le64_to_cpu(res.a0));
>                 ret_payload[2] = lower_32_bits(le64_to_cpu(res.a1));
>                 ret_payload[3] = upper_32_bits(le64_to_cpu(res.a1));
>                 ret_payload[4] = lower_32_bits(le64_to_cpu(res.a2));
>
> There should be probably also change in invoke_pm_fn to do conversion
> from cpu to le64.
>
> int invoke_pm_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3,
>                  u32 *ret_payload)
> {
>         /*
>          * Added SIP service call Function Identifier
>          * Make sure to stay in x0 register
>          */
>         u64 smc_arg[4];
>
>         smc_arg[0] = cpu_to_le64(PM_SIP_SVC | pm_api_id);
>         smc_arg[1] = cpu_to_le64(((u64)arg1 << 32) | arg0);
>         smc_arg[2] = cpu_to_le64(((u64)arg3 << 32) | arg2);
>
>         return do_fw_call(smc_arg[0], smc_arg[1], smc_arg[2], ret_payload);
> }
>
> This is not tested on BE just on LE.

Looks good, just make sure you also check with sparse (make C=1)
to ensure you have the right __le64/__le32 types everywhere.

       Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 3/3] soc: xilinx: zynqmp: Add firmware interface Arnd Bergmann <arnd@arndb.de> - 2017-08-14 17:10 +0200
  Re: [PATCH 3/3] soc: xilinx: zynqmp: Add firmware interface Arnd Bergmann <arnd@arndb.de> - 2017-08-16 14:50 +0200
    Re: [PATCH 3/3] soc: xilinx: zynqmp: Add firmware interface Arnd Bergmann <arnd@arndb.de> - 2017-08-16 17:10 +0200
      Re: [PATCH 3/3] soc: xilinx: zynqmp: Add firmware interface Arnd Bergmann <arnd@arndb.de> - 2017-08-17 23:20 +0200

csiph-web