Re: [PATCH v3 20/22] net: phy: Add basic driver for MV88E6XXX switches from Marvell

2018-10-15 Thread Sam Ravnborg
Hi Andrey.

> > > +
> > > + chip->miibus.read = mv88e6xxx_mdio_read;
> > > + chip->miibus.write = mv88e6xxx_mdio_write;
> >
> > The function pointers are hardcoded here.
> > But we have them in chip->info->ops - where we can
> > have chip specific variants.
> > I assume it would be more correct to copy them from the ops structure?
> >
> 
> I am not sure I see why that would be. Mv88e6xxx_mdio_read() and
> mv88e6xxx_mdio_write() are both wrappers around
> chip->info->ops->phy_read/phy_write that also have code to handle the
> case when either phy_read/phy_write are not specified.
I should stop reading patches late.
I read the above as function pointers to the functions used to read the
phy, and not the general mdio_read/write functions.
So as you points outs this is fine.

Sorry for the noise.

I also browsed through the other patches in this set, and everything else 
looked good.
But then some parts I was not familiar with.

Sam

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] miitool: Fix inconsistent spacing

2018-10-15 Thread Andrey Smirnov
Make sure that there's a space between device name and it's status
string regardless if if device is using "id" field or not.

Before:

barebox@ZII RDU2 Board:/ miitool
mdio0-phy00: mdio:no link
mdio1-phy15: 2188000.ethernet@2188000:10 Mbit, half duplex, no link
mdio1-phy16: 2188000.ethernet@2188000:10 Mbit, half duplex, no link
mdio2-phy00: 2188000.ethernet@2188000:mdio:switch@0:no link
mdio2-phy01: 2188000.ethernet@2188000:mdio:switch@0:no link
mdio2-phy02: 2188000.ethernet@2188000:mdio:switch@0:negotiated 100baseTx-FD, 
link ok
mdio2-phy03: 2188000.ethernet@2188000:mdio:switch@0:no link
mdio2-phy04: 2188000.ethernet@2188000:mdio:switch@0:no link
mdio3-phy01: eth1: negotiated 1000baseT-FD flow-control, link ok

After:

barebox@ZII RDU2 Board:/ miitool
mdio0-phy00: mdio: no link
mdio1-phy15: 2188000.ethernet@2188000: 10 Mbit, half duplex, no link
mdio1-phy16: 2188000.ethernet@2188000: 10 Mbit, half duplex, no link
mdio2-phy00: 2188000.ethernet@2188000:mdio:switch@0: no link
mdio2-phy01: 2188000.ethernet@2188000:mdio:switch@0: no link
mdio2-phy02: 2188000.ethernet@2188000:mdio:switch@0: no link
mdio2-phy03: 2188000.ethernet@2188000:mdio:switch@0: no link
mdio2-phy04: 2188000.ethernet@2188000:mdio:switch@0: no link
mdio3-phy01: eth1: no link

Signed-off-by: Andrey Smirnov 
---
 commands/miitool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/miitool.c b/commands/miitool.c
index dea4f853c..acf61421b 100644
--- a/commands/miitool.c
+++ b/commands/miitool.c
@@ -115,7 +115,7 @@ static int show_basic_mii(struct mii_bus *mii, struct 
phy_device *phydev,
for (i = 0; i < 32; i++)
mii_val[i] = mii->read(mii, phydev->addr, i);
 
-   printf((mii->parent->id) < 0 ? "%s: %s:" : "%s: %s%d: ",
+   printf((mii->parent->id) < 0 ? "%s: %s: " : "%s: %s%d: ",
   phydev->cdev.name, mii->parent->name, mii->parent->id);
 
 
-- 
2.17.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH v3 20/22] net: phy: Add basic driver for MV88E6XXX switches from Marvell

2018-10-15 Thread Andrey Smirnov
On Mon, Oct 15, 2018 at 2:19 PM Sam Ravnborg  wrote:
>
> Hi Andrey.
>
> Some random nits while browsing the code.
>
> On Sun, Oct 14, 2018 at 07:21:23PM -0700, Andrey Smirnov wrote:
> > Port a very abridged version of MV88E6XXX DSA driver from Linux
> > kernel. Currently only internal MDIO bus connected to switch PHYs is
> > exposed.
> >
> > Signed-off-by: Andrey Smirnov 
> >
> > net: phy: mv88e6xxx: Expose internal MDIO bus
> > ---
> >  drivers/net/phy/Kconfig |   6 +
> >  drivers/net/phy/Makefile|   1 +
> >  drivers/net/phy/mv88e6xxx/Makefile  |   5 +
> >  drivers/net/phy/mv88e6xxx/chip.c| 723 
> >  drivers/net/phy/mv88e6xxx/chip.h|  61 +++
> >  drivers/net/phy/mv88e6xxx/global2.c | 124 +
> >  drivers/net/phy/mv88e6xxx/global2.h |  41 ++
> >  drivers/net/phy/mv88e6xxx/port.c|  20 +
> >  drivers/net/phy/mv88e6xxx/port.h|  89 
> >  9 files changed, 1070 insertions(+)
> >  create mode 100644 drivers/net/phy/mv88e6xxx/Makefile
> >  create mode 100644 drivers/net/phy/mv88e6xxx/chip.c
> >  create mode 100644 drivers/net/phy/mv88e6xxx/chip.h
> >  create mode 100644 drivers/net/phy/mv88e6xxx/global2.c
> >  create mode 100644 drivers/net/phy/mv88e6xxx/global2.h
> >  create mode 100644 drivers/net/phy/mv88e6xxx/port.c
> >  create mode 100644 drivers/net/phy/mv88e6xxx/port.h
> >
> > diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
> > index 79fb917ee..3b1a6ea7e 100644
> > --- a/drivers/net/phy/Kconfig
> > +++ b/drivers/net/phy/Kconfig
> > @@ -48,6 +48,12 @@ config SMSC_PHY
> >   ---help---
> > Currently supports the LAN83C185, LAN8187 and LAN8700 PHYs
> >
> > +config NET_DSA_MV88E6XXX
> > + tristate "Marvell 88E6xxx Ethernet switch fabric support"
> > + help
> > +   This driver adds support for most of the Marvell 88E6xxx models of
> > +   Ethernet switch chips, except 88E6060.
> > +
> >  comment "MII bus device drivers"
> >
> >  config MDIO_MVEBU
> > diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
> > index 4424054d9..e4d9ec65a 100644
> > --- a/drivers/net/phy/Makefile
> > +++ b/drivers/net/phy/Makefile
> > @@ -7,6 +7,7 @@ obj-$(CONFIG_MARVELL_PHY) += marvell.o
> >  obj-$(CONFIG_MICREL_PHY) += micrel.o
> >  obj-$(CONFIG_NATIONAL_PHY)   += national.o
> >  obj-$(CONFIG_SMSC_PHY)   += smsc.o
> > +obj-$(CONFIG_NET_DSA_MV88E6XXX)  += mv88e6xxx/
> >
> >  obj-$(CONFIG_MDIO_MVEBU) += mdio-mvebu.o
> >  obj-$(CONFIG_MDIO_BITBANG)   += mdio-bitbang.o
> > diff --git a/drivers/net/phy/mv88e6xxx/Makefile 
> > b/drivers/net/phy/mv88e6xxx/Makefile
> > new file mode 100644
> > index 0..8c8ba78cd
> > --- /dev/null
> > +++ b/drivers/net/phy/mv88e6xxx/Makefile
> > @@ -0,0 +1,5 @@
> > +obj-y += mv88e6xxx.o
> > +
> > +mv88e6xxx-objs := chip.o
> > +mv88e6xxx-objs += global2.o
> > +mv88e6xxx-objs += port.o
> > \ No newline at end of file
>
> Another way to write the above would be:
> mv88e6xxx-y := chip.o
> mv88e6xxx-y += global2.o
> mv88e6xxx-y += port.o
>
> And if you change this then you can alos add the missing newline
>
> As the kernel uses -objs you will likely keep current syntax,
> just wanted to point in the direction of the new way to express this.
>

I'll fix the lack of newline in v4. As you mentioned this is a
straight copy of what's in kernel and I tried to keep as much original
code intact as possible. Thanks for the pointer, though.

>
> > +static int mv88e6xxx_probe(struct device_d *dev)
> > +{
> > + struct device_node *np = dev->device_node;
> > + struct device_node *mdio_node;
> > + struct mv88e6xxx_chip *chip;
> > + enum of_gpio_flags of_flags;
> > + int err;
> > + u32 reg;
> > +
> > + err = of_property_read_u32(np, "reg", );
> > + if (err) {
> > + dev_err(dev, "Couldn't determine switch MIDO address\n");
> > + return err;
> > + }
> > +
> > + if (reg) {
> > + dev_err(dev, "Only single-chip address mode is supported\n");
> > + return -ENOTSUPP;
> > + }
> > +
> > + chip = xzalloc(sizeof(struct mv88e6xxx_chip));
> > + chip->dev = dev;
> > + chip->info = of_device_get_match_data(dev);
> > +
> > + chip->parent_miibus = of_mdio_find_bus(np->parent);
> > + if (!chip->parent_miibus)
> > + return -EPROBE_DEFER;
> > +
> > + chip->reset = of_get_named_gpio_flags(np, "reset-gpios", 0, 
> > _flags);
> > + if (gpio_is_valid(chip->reset)) {
> > + unsigned long flags = GPIOF_OUT_INIT_INACTIVE;
> > + char *name;
> > +
> > + if (of_flags & OF_GPIO_ACTIVE_LOW)
> > + flags |= GPIOF_ACTIVE_LOW;
> > +
> > + name = basprintf("%s reset", dev_name(dev));
> > + err = gpio_request_one(chip->reset, flags, name);
> > + if (err < 0)
> > + return err;
> > + /*
> > +  * We assume that reset line was previously held 

Re: [PATCH v3 02/22] clocksource: Add ARM global timer support

2018-10-15 Thread Andrey Smirnov
On Mon, Oct 15, 2018 at 1:46 PM Sam Ravnborg  wrote:
>
> Hi Andrey.
>
> On Sun, Oct 14, 2018 at 07:21:05PM -0700, Andrey Smirnov wrote:
> > Port corresponding Linux kernel driver. Currently VFxxx SoC is the
> > intended consumer because it doesn't include common i.MX GPT block
> > used as clocksource by other i.MX SoCs.
> >
> > Signed-off-by: Andrey Smirnov 
> > ---
> >  drivers/clocksource/Kconfig|   4 +
> >  drivers/clocksource/Makefile   |   1 +
> >  drivers/clocksource/arm_global_timer.c | 113 +
> >  3 files changed, 118 insertions(+)
> >  create mode 100644 drivers/clocksource/arm_global_timer.c
> >
> > diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
> > index 3d63f7ff1..6a6c9362a 100644
> > --- a/drivers/clocksource/Kconfig
> > +++ b/drivers/clocksource/Kconfig
> > @@ -70,3 +70,7 @@ config CLOCKSOURCE_ARMV8_TIMER
> >   bool
> >   default y
> >   depends on ARM && CPU_64v8
> > +
> > +config CLOCKSOURCE_ARM_GLOBAL_TIMER
> > +bool
> > + depends on ARM && CPU_V7
>
> Mix of space and tab in the above.
>

Will fix in v4.

Thanks,
Andrey Smirnov

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 4/5] tlsf_malloc: Set errno to ENOMEM on failure

2018-10-15 Thread Andrey Smirnov
Set errno to ENOMEM on failure so that correct error message can be
displayed by users who rely on errno.

Signed-off-by: Andrey Smirnov 
---
 common/tlsf_malloc.c | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/common/tlsf_malloc.c b/common/tlsf_malloc.c
index aa3ab2397..c8900fc6b 100644
--- a/common/tlsf_malloc.c
+++ b/common/tlsf_malloc.c
@@ -28,6 +28,7 @@ extern tlsf_pool tlsf_mem_pool;
 
 void *malloc(size_t bytes)
 {
+   void *mem;
/*
 * tlsf_malloc returns NULL for zero bytes, we instead want
 * to have a valid pointer.
@@ -35,7 +36,11 @@ void *malloc(size_t bytes)
if (!bytes)
bytes = 1;
 
-   return tlsf_malloc(tlsf_mem_pool, bytes);
+   mem = tlsf_malloc(tlsf_mem_pool, bytes);
+   if (!mem)
+   errno = ENOMEM;
+
+   return mem;
 }
 EXPORT_SYMBOL(malloc);
 
@@ -47,13 +52,21 @@ EXPORT_SYMBOL(free);
 
 void *realloc(void *oldmem, size_t bytes)
 {
-   return tlsf_realloc(tlsf_mem_pool, oldmem, bytes);
+   void *mem = tlsf_realloc(tlsf_mem_pool, oldmem, bytes);
+   if (!mem)
+   errno = ENOMEM;
+
+   return mem;
 }
 EXPORT_SYMBOL(realloc);
 
 void *memalign(size_t alignment, size_t bytes)
 {
-   return tlsf_memalign(tlsf_mem_pool, alignment, bytes);
+   void *mem = tlsf_memalign(tlsf_mem_pool, alignment, bytes);
+   if (!mem)
+   errno = ENOMEM;
+
+   return mem;
 }
 EXPORT_SYMBOL(memalign);
 
-- 
2.17.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 2/5] dummy_malloc: Make use of PTR_ALIGN

2018-10-15 Thread Andrey Smirnov
Drop explicit type cast and alignement code in favor of PTR_ALIGN

Signed-off-by: Andrey Smirnov 
---
 common/dummy_malloc.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/common/dummy_malloc.c b/common/dummy_malloc.c
index fa4f5d126..ab6712018 100644
--- a/common/dummy_malloc.c
+++ b/common/dummy_malloc.c
@@ -30,11 +30,9 @@ void malloc_stats(void)
 
 void *memalign(size_t alignment, size_t bytes)
 {
-   unsigned long mem = (unsigned long)sbrk(bytes + alignment);
+   void *mem = sbrk(bytes + alignment);
 
-   mem = (mem + alignment) & ~(alignment - 1);
-
-   return (void *)mem;
+   return PTR_ALIGN(mem, alignment);
 }
 
 void *malloc(size_t size)
-- 
2.17.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 3/5] dummy_malloc: Check if sbrk() fails

2018-10-15 Thread Andrey Smirnov
Add code to check if sbrk() fails as well as setting appropriate
'errno' for users that may rely on it for error reporting.

Signed-off-by: Andrey Smirnov 
---
 common/dummy_malloc.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/common/dummy_malloc.c b/common/dummy_malloc.c
index ab6712018..0120d9be2 100644
--- a/common/dummy_malloc.c
+++ b/common/dummy_malloc.c
@@ -32,6 +32,11 @@ void *memalign(size_t alignment, size_t bytes)
 {
void *mem = sbrk(bytes + alignment);
 
+   if (!mem) {
+   errno = ENOMEM;
+   return NULL;
+   }
+
return PTR_ALIGN(mem, alignment);
 }
 
-- 
2.17.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 1/5] tlsf_malloc: dummy_malloc: Share code for calloc()

2018-10-15 Thread Andrey Smirnov
Calloc() implementation for TLSF does not correctly check for malloc()
failure which can result in a NULL pointer exception when trying to
calloc() extra large buffers.

Since both TLSF and dummy malloc implementations of calloc() are
exactly the same, pick implementation for the latter (which does
aforementioned check) and share it between the two.

Signed-off-by: Andrey Smirnov 
---
 common/Makefile   |  4 ++--
 common/calloc.c   | 19 +++
 common/dummy_malloc.c | 13 -
 common/tlsf_malloc.c  | 16 
 4 files changed, 21 insertions(+), 31 deletions(-)
 create mode 100644 common/calloc.c

diff --git a/common/Makefile b/common/Makefile
index 13920cc5a..861365bd5 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -34,8 +34,8 @@ obj-$(CONFIG_GLOBALVAR)   += globalvar.o
 obj-$(CONFIG_GREGORIAN_CALENDER) += date.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_MALLOC_DLMALLOC)  += dlmalloc.o
-obj-$(CONFIG_MALLOC_TLSF)  += tlsf_malloc.o tlsf.o
-obj-$(CONFIG_MALLOC_DUMMY) += dummy_malloc.o
+obj-$(CONFIG_MALLOC_TLSF)  += tlsf_malloc.o tlsf.o calloc.o
+obj-$(CONFIG_MALLOC_DUMMY) += dummy_malloc.o calloc.o
 obj-$(CONFIG_MEMINFO)  += meminfo.o
 obj-$(CONFIG_MENU) += menu.o
 obj-$(CONFIG_MODULES)  += module.o
diff --git a/common/calloc.c b/common/calloc.c
new file mode 100644
index 0..2b933ec27
--- /dev/null
+++ b/common/calloc.c
@@ -0,0 +1,19 @@
+#include 
+#include 
+
+/*
+ * calloc calls malloc, then zeroes out the allocated chunk.
+ */
+void *calloc(size_t n, size_t elem_size)
+{
+   size_t size = elem_size * n;
+   void *r = malloc(size);
+
+   if (!r)
+   return r;
+
+   memset(r, 0x0, size);
+
+   return r;
+}
+EXPORT_SYMBOL(calloc);
diff --git a/common/dummy_malloc.c b/common/dummy_malloc.c
index 641baa125..fa4f5d126 100644
--- a/common/dummy_malloc.c
+++ b/common/dummy_malloc.c
@@ -50,16 +50,3 @@ void *realloc(void *ptr, size_t size)
 {
BUG();
 }
-
-void *calloc(size_t n, size_t elem_size)
-{
-   size_t size = elem_size * n;
-   void *r = malloc(size);
-
-   if (!r)
-   return r;
-
-   memset(r, 0x0, size);
-
-   return r;
-}
diff --git a/common/tlsf_malloc.c b/common/tlsf_malloc.c
index a3541d825..aa3ab2397 100644
--- a/common/tlsf_malloc.c
+++ b/common/tlsf_malloc.c
@@ -39,22 +39,6 @@ void *malloc(size_t bytes)
 }
 EXPORT_SYMBOL(malloc);
 
-/*
- * calloc calls malloc, then zeroes out the allocated chunk.
- */
-void *calloc(size_t n, size_t elem_size)
-{
-   void *mem;
-   size_t sz;
-
-   sz = n * elem_size;
-   mem = malloc(sz);
-   memset(mem, 0, sz);
-
-   return mem;
-}
-EXPORT_SYMBOL(calloc);
-
 void free(void *mem)
 {
tlsf_free(tlsf_mem_pool, mem);
-- 
2.17.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] rave-sp: backlight: Specify parent device correctly

2018-10-15 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov 
---
 drivers/video/rave-sp-backlight.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/rave-sp-backlight.c 
b/drivers/video/rave-sp-backlight.c
index 88ec86e73..3a20def66 100644
--- a/drivers/video/rave-sp-backlight.c
+++ b/drivers/video/rave-sp-backlight.c
@@ -46,6 +46,7 @@ static int rave_sp_backlight_probe(struct device_d *dev)
 
bd = xzalloc(sizeof(*bd));
bd->dev.priv = dev->parent->priv;
+   bd->dev.parent = dev;
bd->brightness_default = 50;
bd->brightness_max = 100;
bd->brightness_set = rave_sp_backlight_set;
-- 
2.17.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] phy: call adjust_link in attach if using fixed-link

2018-10-15 Thread Clément Leger
Normally, phy_update_status is in charge of reporting a change in link
status when phy is updated. When using fixed-link, speed and duplex are
initialized directly after registering the phy and there is no driver.
Hence when phy_update_status is called, the check for new values fails
and returns directly. Since update_link call is mandatory for some
network devices to work, call it directly when using fixed link in
phy_device_attach to force update of link.

Signed-off-by: Clement Leger 
---
 drivers/net/phy/phy.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 42dcad906..63f249fcf 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -398,6 +398,10 @@ static int phy_device_attach(struct phy_device *phy, 
struct eth_device *edev,
 
phy->adjust_link = adjust_link;
 
+   /* If the phy is a fixed-link, then call adjust_link directly */
+   if (!phy->bus && adjust_link)
+   adjust_link(edev);
+
return 0;
 }
 
-- 
2.15.0.276.g89ea799

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] net: make routing work after dhcp command

2018-10-15 Thread Andrey Smirnov
On Mon, Oct 15, 2018 at 2:26 AM Antony Pavlov  wrote:
>
> At the moment only ifup stuff turns netif up.
> After the commit f0624a701513 ('net: Do not route traffic
> to interfaces that are not up') the dhcp command
> keeps netif->ifup == false and network subsystem
> can't route packets.
>

I am not really trying to make any objections to this patch, however I
can't seem to find any documented mention that just calling "dhcp" is
sufficient to bring network up in barebox.
Documentation/user/networking.rst explicitly tells one to use "ifup"
for both static and dynamic IP configurations. That being said just
calling "dhcp" used to work, so this is definitely a regression and it
might make sense to apply this fix.

Thanks,
Andrey Smirnov

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] net: make routing work after dhcp command

2018-10-15 Thread Antony Pavlov
At the moment only ifup stuff turns netif up.
After the commit f0624a701513 ('net: Do not route traffic
to interfaces that are not up') the dhcp command
keeps netif->ifup == false and network subsystem
can't route packets.

How to repropduce the problem on qemu-malta_defconfig:

qemu-system-mips -nodefaults -M malta -m 256 \
 -nographic -serial stdio -monitor null \
 -bios barebox-flash-image \
 -net user -net nic,model=rtl8139

...

barebox:/ dhcp
eth0: 100Mbps full duplex link detected
eth0: DHCP client bound to address 10.0.2.15
barebox:/ ping 10.0.2.2
ping failed: No route to host

However if ifup command is used for network interface
configuration then there is no network problem, e.g.

barebox:/ ifup eth0
eth0: 100Mbps full duplex link detected
eth0: DHCP client bound to address 10.0.2.15
barebox:/ ping 10.0.2.2
host 10.0.2.2 is alive

Signed-off-by: Antony Pavlov 
CC: Andrey Smirnov 
---
 net/dhcp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/dhcp.c b/net/dhcp.c
index 984d32a93e..427d80a5a8 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -615,6 +615,9 @@ int dhcp(struct eth_device *edev, const struct 
dhcp_req_param *param)
 
dhcp_result_free(res);
 
+   if (!ret)
+   edev->ifup = true;
+
return ret;
 }
 
-- 
2.19.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH v2] hab: Print events on info command.

2018-10-15 Thread Marc Kleine-Budde
On 10/15/2018 10:41 AM, Denis OSTERLAND wrote:
>> The faulting zero page problem doesn't occur on mx25 and mx28 as the HAB
>> ROM doesn't live at 0x0:
>>
>> #define HABV4_RVT_IMX28 0x8af8
>>
>> int imx25_hab_get_status(void)
>> {
>> return imx_habv3_get_status(readl(IOMEM(0x780018d4)));
>> }
>>  
>> Marc
>>
> 
> Thanks for the info.
> This becomes a problem when MMU is enabled again.

I think we have a 1-to-1 mapping by default, modulo the zero page.

> I think this will require explicit mapping.
> I am not sure if it is possible to access the ABI through mapped addresses.

Probably not, I assume the code is not position independent.

> Is it possible to force mapping at exact this addresses?

Marc

-- 
Pengutronix e.K.  | Marc Kleine-Budde   |
Industrial Linux Solutions| Phone: +49-231-2826-924 |
Vertretung West/Dortmund  | Fax:   +49-5121-206917- |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |



signature.asc
Description: OpenPGP digital signature
___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH v2] hab: Print events on info command.

2018-10-15 Thread Denis OSTERLAND
Hi,

Am Freitag, den 12.10.2018, 08:23 +0200 schrieb Marc Kleine-Budde:
> 
> The faulting zero page problem doesn't occur on mx25 and mx28 as the HAB
> ROM doesn't live at 0x0:
> 
> #define HABV4_RVT_IMX28 0x8af8
> 
> int imx25_hab_get_status(void)
> {
> return imx_habv3_get_status(readl(IOMEM(0x780018d4)));
> }
> 
> Marc
> 

Thanks for the info.
This becomes a problem when MMU is enabled again.
I think this will require explicit mapping.
I am not sure if it is possible to access the ABI through mapped addresses.
Is it possible to force mapping at exact this addresses?

Regards Denis


Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail 
enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten 
haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung 
und/oder Publikation dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail 
contains confidential and/or legally protected information. Please inform us if 
you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, 
disclosure, alteration, distribution and/or publication of this e-mail is 
strictly prohibited. 
___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox