mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-23 03:13:58 +08:00
Fix general PowerPC build
This commit is contained in:
parent
936b597a57
commit
45149ec24e
@ -51,7 +51,6 @@
|
|||||||
#include <linux/libfdt_env.h>
|
#include <linux/libfdt_env.h>
|
||||||
#ifdef __rtems__
|
#ifdef __rtems__
|
||||||
#include <bsp/fdt.h>
|
#include <bsp/fdt.h>
|
||||||
#include <bsp/qoriq.h>
|
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
/* General defines */
|
/* General defines */
|
||||||
@ -3118,7 +3117,9 @@ fman_dev_probe_fdt(struct fman_softc *sc, int unit)
|
|||||||
sc->dn.offset = node;
|
sc->dn.offset = node;
|
||||||
sc->dn.full_name = name;
|
sc->dn.full_name = name;
|
||||||
sc->of_dev.dev.of_node = &sc->dn;
|
sc->of_dev.dev.of_node = &sc->dn;
|
||||||
|
#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
|
||||||
sc->of_dev.dev.base = (uintptr_t)&qoriq.fman[unit];
|
sc->of_dev.dev.base = (uintptr_t)&qoriq.fman[unit];
|
||||||
|
#endif
|
||||||
return (BUS_PROBE_DEFAULT);
|
return (BUS_PROBE_DEFAULT);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -285,7 +285,6 @@ builtin_platform_driver(fsl_bman_driver);
|
|||||||
#include <sys/kernel.h>
|
#include <sys/kernel.h>
|
||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
#include <bsp/fdt.h>
|
#include <bsp/fdt.h>
|
||||||
#include <bsp/qoriq.h>
|
|
||||||
#include <linux/of_address.h>
|
#include <linux/of_address.h>
|
||||||
#include <linux/of_irq.h>
|
#include <linux/of_irq.h>
|
||||||
|
|
||||||
@ -303,7 +302,9 @@ bman_sysinit(void)
|
|||||||
struct platform_device ofdev = {
|
struct platform_device ofdev = {
|
||||||
.dev = {
|
.dev = {
|
||||||
.of_node = &dn,
|
.of_node = &dn,
|
||||||
|
#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
|
||||||
.base = (uintptr_t)&qoriq
|
.base = (uintptr_t)&qoriq
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const char *name;
|
const char *name;
|
||||||
@ -313,11 +314,13 @@ bman_sysinit(void)
|
|||||||
int node;
|
int node;
|
||||||
int parent;
|
int parent;
|
||||||
|
|
||||||
|
#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
|
||||||
qoriq_reset_qman_and_bman();
|
qoriq_reset_qman_and_bman();
|
||||||
qoriq_clear_ce_portal(&qoriq_bman_portal[0][0],
|
qoriq_clear_ce_portal(&qoriq_bman_portal[0][0],
|
||||||
sizeof(qoriq_bman_portal[0]));
|
sizeof(qoriq_bman_portal[0]));
|
||||||
qoriq_clear_ci_portal(&qoriq_bman_portal[1][0],
|
qoriq_clear_ci_portal(&qoriq_bman_portal[1][0],
|
||||||
sizeof(qoriq_bman_portal[1]));
|
sizeof(qoriq_bman_portal[1]));
|
||||||
|
#endif
|
||||||
|
|
||||||
memset(&dn, 0, sizeof(dn));
|
memset(&dn, 0, sizeof(dn));
|
||||||
|
|
||||||
@ -355,22 +358,26 @@ bman_sysinit(void)
|
|||||||
ret = of_address_to_resource(&dn, 0, &res);
|
ret = of_address_to_resource(&dn, 0, &res);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
panic("bman: no portal CE address");
|
panic("bman: no portal CE address");
|
||||||
|
#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
|
||||||
pcfg->addr_virt[0] = (__iomem void *)
|
pcfg->addr_virt[0] = (__iomem void *)
|
||||||
((uintptr_t)&qoriq_bman_portal[0][0] + (uintptr_t)res.start);
|
((uintptr_t)&qoriq_bman_portal[0][0] + (uintptr_t)res.start);
|
||||||
BSD_ASSERT((uintptr_t)pcfg->addr_virt[0] >=
|
BSD_ASSERT((uintptr_t)pcfg->addr_virt[0] >=
|
||||||
(uintptr_t)&qoriq_bman_portal[0][0]);
|
(uintptr_t)&qoriq_bman_portal[0][0]);
|
||||||
BSD_ASSERT((uintptr_t)pcfg->addr_virt[0] <
|
BSD_ASSERT((uintptr_t)pcfg->addr_virt[0] <
|
||||||
(uintptr_t)&qoriq_bman_portal[1][0]);
|
(uintptr_t)&qoriq_bman_portal[1][0]);
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = of_address_to_resource(&dn, 1, &res);
|
ret = of_address_to_resource(&dn, 1, &res);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
panic("bman: no portal CI address");
|
panic("bman: no portal CI address");
|
||||||
|
#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
|
||||||
pcfg->addr_virt[1] = (__iomem void *)
|
pcfg->addr_virt[1] = (__iomem void *)
|
||||||
((uintptr_t)&qoriq_bman_portal[0][0] + (uintptr_t)res.start);
|
((uintptr_t)&qoriq_bman_portal[0][0] + (uintptr_t)res.start);
|
||||||
BSD_ASSERT((uintptr_t)pcfg->addr_virt[1] >=
|
BSD_ASSERT((uintptr_t)pcfg->addr_virt[1] >=
|
||||||
(uintptr_t)&qoriq_bman_portal[1][0]);
|
(uintptr_t)&qoriq_bman_portal[1][0]);
|
||||||
BSD_ASSERT((uintptr_t)pcfg->addr_virt[1] <
|
BSD_ASSERT((uintptr_t)pcfg->addr_virt[1] <
|
||||||
(uintptr_t)&qoriq_bman_portal[2][0]);
|
(uintptr_t)&qoriq_bman_portal[2][0]);
|
||||||
|
#endif
|
||||||
|
|
||||||
pcfg->irq = of_irq_to_resource(&dn, 0, NULL);
|
pcfg->irq = of_irq_to_resource(&dn, 0, NULL);
|
||||||
if (pcfg->irq == NO_IRQ)
|
if (pcfg->irq == NO_IRQ)
|
||||||
|
@ -84,8 +84,11 @@ static inline void dpaa_flush(void *p)
|
|||||||
__flush_dcache_area(p, 64);
|
__flush_dcache_area(p, 64);
|
||||||
#endif
|
#endif
|
||||||
#else /* __rtems__ */
|
#else /* __rtems__ */
|
||||||
#ifdef __PPC_CPU_E6500__
|
#if PPC_DEFAULT_CACHE_LINE_SIZE == 64
|
||||||
ppc_data_cache_block_flush(p);
|
ppc_data_cache_block_flush(p);
|
||||||
|
#elif PPC_DEFAULT_CACHE_LINE_SIZE == 32
|
||||||
|
ppc_data_cache_block_flush(p);
|
||||||
|
ppc_data_cache_block_flush((char *)p + 32);
|
||||||
#else
|
#else
|
||||||
#error "Unsupported platform"
|
#error "Unsupported platform"
|
||||||
#endif
|
#endif
|
||||||
|
@ -850,7 +850,6 @@ static struct platform_driver fsl_qman_driver = {
|
|||||||
builtin_platform_driver(fsl_qman_driver);
|
builtin_platform_driver(fsl_qman_driver);
|
||||||
#else /* __rtems__ */
|
#else /* __rtems__ */
|
||||||
#include <bsp/fdt.h>
|
#include <bsp/fdt.h>
|
||||||
#include <bsp/qoriq.h>
|
|
||||||
|
|
||||||
SYSINIT_REFERENCE(bman);
|
SYSINIT_REFERENCE(bman);
|
||||||
|
|
||||||
@ -873,7 +872,9 @@ qman_sysinit(void)
|
|||||||
|
|
||||||
memset(&dev, 0, sizeof(dev));
|
memset(&dev, 0, sizeof(dev));
|
||||||
dev.pdev.dev.of_node = &dev.of_node;
|
dev.pdev.dev.of_node = &dev.of_node;
|
||||||
|
#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
|
||||||
dev.pdev.dev.base = (uintptr_t)&qoriq;
|
dev.pdev.dev.base = (uintptr_t)&qoriq;
|
||||||
|
#endif
|
||||||
dev.of_node.offset = node;
|
dev.of_node.offset = node;
|
||||||
dev.of_node.full_name = name;
|
dev.of_node.full_name = name;
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#include "qman_priv.h"
|
#include "qman_priv.h"
|
||||||
#ifdef __rtems__
|
#ifdef __rtems__
|
||||||
#include <bsp/qoriq.h>
|
|
||||||
#undef dev_crit
|
#undef dev_crit
|
||||||
#undef dev_info
|
#undef dev_info
|
||||||
#define dev_crit(dev, fmt, ...) printf(fmt, ##__VA_ARGS__)
|
#define dev_crit(dev, fmt, ...) printf(fmt, ##__VA_ARGS__)
|
||||||
@ -434,22 +433,26 @@ do_init_pcfg(struct device_node *dn, struct qm_portal_config *pcfg,
|
|||||||
ret = of_address_to_resource(dn, 0, &res);
|
ret = of_address_to_resource(dn, 0, &res);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
panic("qman: no portal CE address");
|
panic("qman: no portal CE address");
|
||||||
|
#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
|
||||||
pcfg->addr_virt[0] = (__iomem void *)
|
pcfg->addr_virt[0] = (__iomem void *)
|
||||||
((uintptr_t)&qoriq_qman_portal[0][0] + (uintptr_t)res.start);
|
((uintptr_t)&qoriq_qman_portal[0][0] + (uintptr_t)res.start);
|
||||||
BSD_ASSERT((uintptr_t)pcfg->addr_virt[0] >=
|
BSD_ASSERT((uintptr_t)pcfg->addr_virt[0] >=
|
||||||
(uintptr_t)&qoriq_qman_portal[0][0]);
|
(uintptr_t)&qoriq_qman_portal[0][0]);
|
||||||
BSD_ASSERT((uintptr_t)pcfg->addr_virt[0] <
|
BSD_ASSERT((uintptr_t)pcfg->addr_virt[0] <
|
||||||
(uintptr_t)&qoriq_qman_portal[1][0]);
|
(uintptr_t)&qoriq_qman_portal[1][0]);
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = of_address_to_resource(dn, 1, &res);
|
ret = of_address_to_resource(dn, 1, &res);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
panic("qman: no portal CI address");
|
panic("qman: no portal CI address");
|
||||||
|
#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
|
||||||
pcfg->addr_virt[1] = (__iomem void *)
|
pcfg->addr_virt[1] = (__iomem void *)
|
||||||
((uintptr_t)&qoriq_qman_portal[0][0] + (uintptr_t)res.start);
|
((uintptr_t)&qoriq_qman_portal[0][0] + (uintptr_t)res.start);
|
||||||
BSD_ASSERT((uintptr_t)pcfg->addr_virt[1] >=
|
BSD_ASSERT((uintptr_t)pcfg->addr_virt[1] >=
|
||||||
(uintptr_t)&qoriq_qman_portal[1][0]);
|
(uintptr_t)&qoriq_qman_portal[1][0]);
|
||||||
BSD_ASSERT((uintptr_t)pcfg->addr_virt[1] <
|
BSD_ASSERT((uintptr_t)pcfg->addr_virt[1] <
|
||||||
(uintptr_t)&qoriq_qman_portal[2][0]);
|
(uintptr_t)&qoriq_qman_portal[2][0]);
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = of_property_read_u32(dn, "cell-index", &val);
|
ret = of_property_read_u32(dn, "cell-index", &val);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
@ -503,10 +506,12 @@ qman_sysinit_portals(void)
|
|||||||
dn.full_name = name;
|
dn.full_name = name;
|
||||||
dn.offset = node;
|
dn.offset = node;
|
||||||
|
|
||||||
|
#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
|
||||||
qoriq_clear_ce_portal(&qoriq_qman_portal[0][0],
|
qoriq_clear_ce_portal(&qoriq_qman_portal[0][0],
|
||||||
sizeof(qoriq_qman_portal[0]));
|
sizeof(qoriq_qman_portal[0]));
|
||||||
qoriq_clear_ci_portal(&qoriq_qman_portal[1][0],
|
qoriq_clear_ci_portal(&qoriq_qman_portal[1][0],
|
||||||
sizeof(qoriq_qman_portal[1]));
|
sizeof(qoriq_qman_portal[1]));
|
||||||
|
#endif
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (node >= 0 && i < MAX_QMAN_PORTALS) {
|
while (node >= 0 && i < MAX_QMAN_PORTALS) {
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
#include <bsp.h>
|
||||||
|
#ifdef LIBBSP_POWERPC_QORIQ_BSP_H
|
||||||
|
#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
|
||||||
|
#include <bsp/qoriq.h>
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define QORIQ_CHIP_IS_T_VARIANT(x) 0
|
||||||
|
#endif
|
||||||
#undef __ppc_generic
|
#undef __ppc_generic
|
||||||
#define __ppc_generic
|
#define __ppc_generic
|
||||||
#define KBUILD_MODNAME "dpaa"
|
#define KBUILD_MODNAME "dpaa"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user