From: Ramon Fried Date: Mon, 24 Jun 2019 16:27:56 +0300 Subject: [U-Boot] [PATCH v7 9/9] net: macb: Fix check for little-endian system in gmac_configure_dma() In-Reply-To: References: <20190624040212.3726-1-anup.patel@wdc.com> <20190624040212.3726-10-anup.patel@wdc.com> <52450ee2-95bd-dfd2-f1a8-922a781600f5@gmail.com> Message-ID: <06cebaa2-34f5-cd73-3c0b-f55d472c97d1@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 6/24/19 4:12 PM, Bin Meng wrote: > Hi Ramon, > > On Mon, Jun 24, 2019 at 8:51 PM Ramon Fried wrote: >> >> On 6/24/19 3:32 PM, Bin Meng wrote: >>> Hi Ramon, >>> >>> On Mon, Jun 24, 2019 at 8:22 PM Ramon Fried wrote: >>>> On 6/24/19 8:03 AM, Bin Meng wrote: >>>> >>>> On Mon, Jun 24, 2019 at 12:03 PM Anup Patel wrote: >>>> >>>> We should depend on __LITTLE_ENDIAN pre-defined compiler macro for >>>> little-endian system instead of U-Boot specific CONFIG_SYS_LITTLE_ENDIAN >>>> macro. >>>> >>>> Signed-off-by: Anup Patel >>>> --- >>>> drivers/net/macb.c | 7 ++++--- >>>> 1 file changed, 4 insertions(+), 3 deletions(-) >>>> >>>> Reviewed-by: Bin Meng >>>> >>>> Hi. >>>> I don't like this approach, each platform should configure it's >>>> endianess, this is stated in README in root folder. >>>> relying on a specific GCC preprocessor extension is limiting us only to use GCC. >>>> The RISCV issue with MACB can be easily resolved by defining the >>>> CONFIG_SYS_LITTLE_ENDIAN config. >>> OK, but a system wide CONFIG_SYS_LITTLE_ENDIAN may bring side effects >>> to other drivers, as not all devices are using the same endianness >>> even in the same system. Maybe we can do something by parsing some >>> property in device tree? >>> >>> Regards, >>> Bin >> Hey Bin >> >> I grep'ed for all instances of CONFIG_SYS_LITTLE_ENDIAN and I don't see any place >> where something might brake. can you elaborate ? > I mean this system wide CONFIG_SYS_LITTLE_ENDIAN is easy to break > since it cannot represent all devices, although I did not check all > instances currently in U-Boot. Maybe it's OK for now for the SiFive > board. But this option is not better than the pure compiler flag > either. So I was proposing using some properties in DT. Does that > help? Not all devices work using DT in macb, so it won't work for them. :( Thanks, Ramon. > > Regards, > Bin