From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ley Foon Tan Date: Fri, 7 Apr 2017 08:33:40 +0800 Subject: [U-Boot] [PATCH v4 10/19] arm: socfpga: Add misc support for Arria 10 In-Reply-To: References: <1491384774-49629-1-git-send-email-ley.foon.tan@intel.com> <1491384774-49629-11-git-send-email-ley.foon.tan@intel.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Apr 6, 2017 at 6:17 PM, Marek Vasut wrote: > On 04/06/2017 05:20 AM, Ley Foon Tan wrote: >> On Wed, Apr 5, 2017 at 6:40 PM, Marek Vasut wrote: >>> On 04/05/2017 11:32 AM, Ley Foon Tan wrote: >>>> Add misc support for Arria 10. >>>> >>>> Signed-off-by: Tien Fong Chee >>>> Signed-off-by: Ley Foon Tan >>> >>> [...] >>> >>>> +static int find_peripheral_uart(const void *blob, >>>> + int child, const char *node_name) >>>> +{ >>>> + int len; >>>> + fdt_addr_t base_addr = 0; >>>> + fdt_size_t size; >>>> + const u32 *cell; >>>> + u32 value, offset = 0; >>>> + >>>> + base_addr = fdtdec_get_addr_size(blob, child, "reg", &size); >>>> + if (base_addr != FDT_ADDR_T_NONE) { >>>> + cell = fdt_getprop(blob, child, "pinctrl-single,pins", >>>> + &len); >>>> + if (cell != NULL) { >>>> + for (; len > 0; len -= (2 * sizeof(u32))) { >>>> + offset = fdt32_to_cpu(*cell++); >>>> + value = fdt32_to_cpu(*cell++); >>>> + /* Found UART peripheral */ >>>> + if (value == 0x0D) >>> >>> What does 0x0d mean ? >> 0x0D is dedicated pin mux number for UART. I can update the comment here. > > Even better, use a macro instead of an ad-hoc constant. Okay, will use macro instead. > >>>> + return offset; >>>> + } >>>> + } >>>> + } >>>> + return -EINVAL; >>>> +} >>> >>> [...] >>> >> Regards >> LeyFoon Thanks. Regards Ley Foon