Skip to content

Commit

Permalink
Merge tag 'sculpt-19.07' into submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmry committed Jul 10, 2019
2 parents aff422d + d33bef2 commit acbbb3e
Show file tree
Hide file tree
Showing 113 changed files with 2,345 additions and 3,843 deletions.
67 changes: 23 additions & 44 deletions repos/base-hw/src/bootstrap/spec/arm_64/crt0.s
Original file line number Diff line number Diff line change
Expand Up @@ -16,70 +16,49 @@
.global _start
_start:

/****************
** Enable FPU **
****************/

mov x0, #0b11
lsl x0, x0, #20
msr cpacr_el1, x0


/***********************
** Detect CPU number **
***********************/

mrs x0, mpidr_el1
and x0, x0, #0b11111111
cmp x0, #0
bne __endless_sleep
cbz x0, _crt0_fill_bss_zero
wfe
b _start


/***************************
** Zero-fill BSS segment **
***************************/

ldr x0, =_bss_local_start
ldr x1, =_bss_local_end
_crt0_fill_bss_zero:
ldr x0, =_bss_start
ldr x1, =_bss_end
1:
cmp x1, x0
ble 2f
str xzr, [x0]
add x0, x0, #8
b 1b
2:
b.eq _crt0_enable_fpu
str xzr, [x0], #8
b 1b


/************************************
** Jump to high-level entry point **
************************************/
/****************
** Enable FPU **
****************/

ldr x0, =_start_stack /* load stack address into x0 */
msr vbar_el1, x0
mov sp, x0
bl init
_crt0_enable_fpu:
mov x0, #0b11
lsl x0, x0, #20
msr cpacr_el1, x0

__endless_sleep:
wfe
1: b 1b

_bss_local_start:
.quad _bss_start
/**********************
** Initialize stack **
**********************/

_bss_local_end:
.quad _bss_end
ldr x0, =_crt0_start_stack
mov sp, x0
bl init

.p2align 4
.space 0x4000
_start_stack:

.rept 512
nop
.endr
mrs x24, far_el1
mrs x25, ttbr0_el1
mrs x26, ttbr1_el1
mrs x27, elr_el1
mrs x28, esr_el1
1: b 1b

_crt0_start_stack:
1 change: 1 addition & 0 deletions repos/base-hw/src/bootstrap/spec/rpi3/platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ unsigned Bootstrap::Platform::enable_mmu()

Cpu::Sctlr_el1::access_t sctlr = Cpu::Sctlr_el1::read();
Cpu::Sctlr_el1::C::set(sctlr, 1);
Cpu::Sctlr_el1::I::set(sctlr, 1);
Cpu::Sctlr_el1::A::set(sctlr, 0);
Cpu::Sctlr_el1::M::set(sctlr, 1);
Cpu::Sctlr_el1::Sa0::set(sctlr, 1);
Expand Down
11 changes: 6 additions & 5 deletions repos/base-hw/src/include/hw/spec/arm_64/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ struct Hw::Arm_64_cpu
);

SYSTEM_REGISTER(64, Sctlr_el1, sctlr_el1,
struct M : Bitfield<0, 1> { };
struct A : Bitfield<1, 1> { };
struct C : Bitfield<2, 1> { };
struct Sa : Bitfield<3, 1> { };
struct Sa0 : Bitfield<4, 1> { };
struct M : Bitfield<0, 1> { };
struct A : Bitfield<1, 1> { };
struct C : Bitfield<2, 1> { };
struct Sa : Bitfield<3, 1> { };
struct Sa0 : Bitfield<4, 1> { };
struct I : Bitfield<12, 1> { };
);

struct Spsr : Genode::Register<64>
Expand Down
39 changes: 21 additions & 18 deletions repos/base/include/util/print_lines.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,33 @@ void Genode::print_lines(char const *string, size_t len, FUNC const &func)
if (Genode::strcmp(first_line, string, num_indent_chars) == 0)
string += num_indent_chars;

size_t const line_len =
({
size_t i = 0;
for (; i < len; i++) {
if (string[i] == '\0' || string[i] == '\n') {

/* the line length is the offset of the last real character + 1 */
i++;
break;
}
}
i;
});
size_t line_len = 0;
size_t skip_char = 1;

for (; line_len < len; line_len++) {
if (string[line_len] == '\0' || string[line_len] == '\n') {
line_len++;
break;
}
if (line_len == MAX_LINE_LEN) {
skip_char = 0;
break;
}
}

if (!line_len)
break;

/*
* Copy line from (untrusted) caller to local line buffer
*/
char line_buf[MAX_LINE_LEN];
Genode::strncpy(line_buf, string, Genode::min(line_len, sizeof(line_buf)));
/* buffer for sub-string of the input string plus null-termination */
char line_buf[MAX_LINE_LEN + 1];

/* give strncpy one more as it will add the null termination */
Genode::strncpy(line_buf, string, line_len - skip_char + 1);

/* process null-terminated string in buffer */
func(line_buf);

/* move forward to the next sub-string to process */
string += line_len;
len -= line_len;
}
Expand Down
6 changes: 1 addition & 5 deletions repos/base/src/lib/ldso/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ struct Linker::Binary : private Root_object, public Elf_object
{
Init::list()->exec_static_constructors();

/* call static construtors and register destructors */
/* call static constructors and register destructors */
Func * const ctors_start = (Func *)lookup_symbol("_ctors_start");
Func * const ctors_end = (Func *)lookup_symbol("_ctors_end");
for (Func * ctor = ctors_end; ctor != ctors_start; (*--ctor)());
Expand Down Expand Up @@ -677,10 +677,6 @@ void Genode::init_ldso_phdr(Env &env)

void Genode::exec_static_constructors()
{
if (!binary_ptr->static_construction_pending())
warning("Don't call Genode::Env::exec_static_constructors() "
"in components without static globals");

binary_ptr->finish_static_construction();
}

Expand Down
10 changes: 10 additions & 0 deletions repos/dde_linux/fec.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ linux-x.x.x/drivers/net/ethernet/freescale/fec.h
linux-x.x.x/drivers/net/ethernet/freescale/fec_main.c
linux-x.x.x/drivers/net/ethernet/freescale/fec_ptp.c
linux-x.x.x/drivers/net/phy/mdio_bus.c
linux-x.x.x/drivers/net/phy/mdio_device.c
linux-x.x.x/drivers/net/phy/mdio-boardinfo.c
linux-x.x.x/drivers/net/phy/mdio-boardinfo.h
linux-x.x.x/drivers/net/phy/phy_device.c
linux-x.x.x/drivers/net/phy/phy.c
linux-x.x.x/drivers/net/phy/phy-c45.c
linux-x.x.x/drivers/net/phy/phy-core.c
linux-x.x.x/drivers/net/phy/at803x.c
linux-x.x.x/net/core/skbuff.c
linux-x.x.x/net/ethernet/eth.c
Expand All @@ -14,21 +19,26 @@ linux-x.x.x/include/asm-generic/bitops/__fls.h
linux-x.x.x/include/asm-generic/bitops/ffs.h
linux-x.x.x/include/asm-generic/bitops/fls.h
linux-x.x.x/include/asm-generic/bitops/fls64.h
linux-x.x.x/include/linux/cgroup-defs.h
linux-x.x.x/include/linux/errqueue.h
linux-x.x.x/include/linux/ethtool.h
linux-x.x.x/include/linux/fec.h
linux-x.x.x/include/linux/gpio/consumer.h
linux-x.x.x/include/linux/if_ether.h
linux-x.x.x/include/linux/list.h
linux-x.x.x/include/linux/list_nulls.h
linux-x.x.x/include/linux/log2.h
linux-x.x.x/include/linux/mdio.h
linux-x.x.x/include/linux/mii.h
linux-x.x.x/include/linux/mod_devicetable.h
linux-x.x.x/include/linux/net.h
linux-x.x.x/include/linux/netdev_features.h
linux-x.x.x/include/linux/phy.h
linux-x.x.x/include/linux/ptp_clock_kernel.h
linux-x.x.x/include/linux/rbtree.h
linux-x.x.x/include/linux/rculist.h
linux-x.x.x/include/linux/rculist_nulls.h
linux-x.x.x/include/linux/refcount.h
linux-x.x.x/include/linux/skbuff.h
linux-x.x.x/include/linux/socket.h
linux-x.x.x/include/linux/timecounter.h
Expand Down
34 changes: 34 additions & 0 deletions repos/dde_linux/patches/fec_ndev_owner.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 74664a6..38cc18a 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -944,7 +944,10 @@ EXPORT_SYMBOL(phy_attached_print);
int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
u32 flags, phy_interface_t interface)
{
+#if 0
+ /* 'driver' has not been set yet on Genode */
struct module *ndev_owner = dev->dev.parent->driver->owner;
+#endif
struct mii_bus *bus = phydev->mdio.bus;
struct device *d = &phydev->mdio.dev;
bool using_genphy = false;
@@ -955,7 +958,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
* our own module->refcnt here, otherwise we would not be able to
* unload later on.
*/
- if (ndev_owner != bus->owner && !try_module_get(bus->owner)) {
+ if (/*ndev_owner != bus->owner &&*/ !try_module_get(bus->owner)) {
dev_err(&dev->dev, "failed to get the bus module\n");
return -EIO;
}
@@ -1060,7 +1063,9 @@ error_module_put:
module_put(d->driver->owner);
error_put_device:
put_device(d);
+#if 0
if (ndev_owner != bus->owner)
+#endif
module_put(bus->owner);
return err;
}
28 changes: 0 additions & 28 deletions repos/dde_linux/patches/fec_tv64.patch

This file was deleted.

8 changes: 4 additions & 4 deletions repos/dde_linux/patches/fec_tx_bounce_dma.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index b2a3220..18629c6 100644
index d4604bc..3f72629 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2825,7 +2825,7 @@ fec_enet_alloc_txq_buffers(struct net_device *ndev, unsigned int queue)
@@ -2798,7 +2798,7 @@ fec_enet_alloc_txq_buffers(struct net_device *ndev, unsigned int queue)
txq = fep->tx_queue[queue];
bdp = txq->tx_bd_base;
for (i = 0; i < txq->tx_ring_size; i++) {
bdp = txq->bd.base;
for (i = 0; i < txq->bd.ring_size; i++) {
- txq->tx_bounce[i] = kmalloc(FEC_ENET_TX_FRSIZE, GFP_KERNEL);
+ txq->tx_bounce[i] = kmalloc(FEC_ENET_TX_FRSIZE, GFP_KERNEL | GFP_LX_DMA);
if (!txq->tx_bounce[i])
Expand Down
3 changes: 3 additions & 0 deletions repos/dde_linux/recipes/pkg/drivers_nic-imx7d_sabre/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

Device drivers needed for scenarios
using one network interface
2 changes: 2 additions & 0 deletions repos/dde_linux/recipes/pkg/drivers_nic-imx7d_sabre/archives
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_/src/fec_nic_drv
_/raw/drivers_nic-imx7d_sabre
1 change: 1 addition & 0 deletions repos/dde_linux/recipes/pkg/drivers_nic-imx7d_sabre/hash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2019-07-08 22eb1f5c9d136d343223df400af544eff2bad931
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
content: drivers.config

drivers.config:
cp $(REP_DIR)/recipes/raw/drivers_nic-imx7d_sabre/$@ $@
31 changes: 31 additions & 0 deletions repos/dde_linux/recipes/raw/drivers_nic-imx7d_sabre/drivers.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<config>
<parent-provides>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="Timer"/>
<service name="Gpio"/>
</parent-provides>

<default caps="100"/>

<service name="Nic">
<default-policy> <child name="nic_drv"/> </default-policy> </service>

<start name="nic_drv" caps="130">
<binary name="fec_nic_drv"/>
<resource name="RAM" quantum="20M"/>
<provides> <service name="Nic"/> </provides>
<config>
<!-- ENET1: IRQ 120 + 32 = 152 -->
<card type="fsl,imx6sx-fec" mii="rgmii" irq="152" mmio="0x30be0000"/>
<!-- ENET2: IRQ 102 + 32 = 134 -->
<card type="fsl,imx6sx-fec" mii="rgmii" irq="134" mmio="0x30bf0000"/>
</config>
<route> <any-service> <parent/> </any-service> </route>
</start>
</config>
1 change: 1 addition & 0 deletions repos/dde_linux/recipes/raw/drivers_nic-imx7d_sabre/hash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2019-06-27 583a26eccfd3241f727170f5d9451c9f2d55d3b4

0 comments on commit acbbb3e

Please sign in to comment.