Commit 907185a6 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

blackfin: drop architecture support

The blackfin architecture is not supported by the mainline kernel
anymore since 4.17, and no concerned user showed up, willing to help
in maintaining this Xenomai port.
parent dd28d74d
......@@ -131,10 +131,6 @@ case "$build_for" in
target_cpu_arch=powerpc
CONFIG_XENO_DEFAULT_PERIOD=100000
;;
bfin-*|bfinnommu-*|blackfin-*)
target_cpu_arch=blackfin
CONFIG_XENO_DEFAULT_PERIOD=100000
;;
arm*-*)
target_cpu_arch=arm
CONFIG_XENO_DEFAULT_PERIOD=1000000
......@@ -928,10 +924,6 @@ AC_CONFIG_FILES([ \
lib/cobalt/arch/powerpc/include/Makefile \
lib/cobalt/arch/powerpc/include/asm/Makefile \
lib/cobalt/arch/powerpc/include/asm/xenomai/Makefile \
lib/cobalt/arch/blackfin/Makefile \
lib/cobalt/arch/blackfin/include/Makefile \
lib/cobalt/arch/blackfin/include/asm/Makefile \
lib/cobalt/arch/blackfin/include/asm/xenomai/Makefile \
lib/cobalt/arch/x86/Makefile \
lib/cobalt/arch/x86/include/Makefile \
lib/cobalt/arch/x86/include/asm/Makefile \
......
......@@ -119,7 +119,6 @@ In order to cross-compile the Linux kernel, pass an ARCH and
CROSS_COMPILE variable on make command line. See sections
<<cobalt-core-arm,"Building a _Cobalt/arm_ kernel">>,
<<cobalt-core-powerpc,"Building a _Cobalt/powerpc_ kernel">>,
<<cobalt-core-blackfin,"Building a _Cobalt/blackfin_ kernel">>,
<<cobalt-core-x86,"Building a _Cobalt/x86_ kernel">>,
for examples.
......@@ -268,27 +267,6 @@ $ make ARCH=powerpc CROSS_COMPILE=powerpc-linux- uImage modules
------------------------------------------------------------------------------
...manually install the kernel image and modules to the proper location
[[cobalt-core-blackfin]]
Building a _Cobalt/blackfin_ kernel
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The Blackfin is a MMU-less, DSP-type architecture running uClinux.
------------------------------------------------------------------------------
$ cd $linux_tree
$ $xenomai_root/scripts/prepare-kernel.sh --arch=blackfin \
--ipipe=ipipe-core-X.Y.Z-x86-NN.patch
$ make ARCH=blackfin CROSS_COMPILE=bfin-uclinux- xconfig/gconfig/menuconfig
------------------------------------------------------------------------------
...select the kernel and Xenomai options, then compile with:
------------------------------------------------------------------------------
$ make linux image
------------------------------------------------------------------------------
...then install as needed
------------------------------------------------------------------------------
$ cp images/linux /tftpboot/...
------------------------------------------------------------------------------
[[cobalt-core-arm]]
Building _Cobalt/arm_ kernel
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......@@ -794,27 +772,6 @@ $ make DESTDIR=$staging_dir install
------------------------------------------------------------------------------
Building the Blackfin libraries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Another cross-compilation setup, in order to build the _Cobalt_
libraries for the Blackfin architecture. We use
http://blackfin.uclinux.org/doku.php?id=toolchain:installing[ADI's
toolchain] for this purpose:
------------------------------------------------------------------------------
$ mkdir $build_root && cd $build_root
$ $xenomai_root/configure --host=bfin-linux-uclibc --with-core=cobalt
$ make DESTDIR=$staging_dir install
------------------------------------------------------------------------------
[NOTE]
Xenomai uses the FDPIC shared library format on this architecture. In
case of problem running the testsuite, try restarting the last two
build steps, passing the `--disable-shared` option to the "configure"
script.
Building the ARM libraries
~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -45,7 +45,7 @@ pathologically high latencies.
This means that the kernel crashes before the console is enabled. You
should enable the +CONFIG_EARLY_PRINTK+ option. For some architectures
(blackfin, x86, arm), enabling this option also requires passing the
(x86, arm), enabling this option also requires passing the
+earlyprintk+ parameter on the kernel command line. See
'Documentation/kernel-parameters.txt' for possible values.
......
config XENO_ARCH_FPU
def_bool n
config XENO_ARCH_SYS3264
def_bool n
source "kernel/xenomai/Kconfig"
source "drivers/xenomai/Kconfig"
obj-$(CONFIG_XENOMAI) += xenomai.o
xenomai-y := machine.o mayday.o thread.o switch.o syscall.o
ccflags-y := -Iarch/blackfin/xenomai/include -Iinclude/xenomai
Get the interrupt pipeline code for the target kernel from
http://xenomai.org/downloads/ipipe/, or
git://git.xenomai.org/ipipe.git
/*
* Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
*
* Xenomai is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Xenomai is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xenomai; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_CALIBRATION_H
#define _COBALT_BLACKFIN_ASM_CALIBRATION_H
static inline void xnarch_get_latencies(struct xnclock_gravity *p)
{
#if CONFIG_XENO_OPT_TIMING_SCHEDLAT != 0
#define __sched_latency CONFIG_XENO_OPT_TIMING_SCHEDLAT
#elif defined(CONFIG_BF533)
#define __sched_latency 5000
#elif defined(CONFIG_BF537)
#define __sched_latency 4800
#elif defined(CONFIG_BF53x)
#define __sched_latency 5000
#elif defined(CONFIG_BF538)
#define __sched_latency 5000
#elif defined(CONFIG_BF561)
#define __sched_latency 4500
#elif defined(CONFIG_BF609)
#define __sched_latency 5500
#elif defined(CONFIG_BF54x)
#define __sched_latency 5000
#elif defined(CONFIG_BF52x)
#define __sched_latency 7000
#elif defined(CONFIG_BF51x)
#define __sched_latency 6000
#elif defined(CONFIG_BF60x)
#define __sched_latency 5500
#else
#error "unsupported Blackfin processor"
#endif
p->user = __sched_latency;
p->kernel = CONFIG_XENO_OPT_TIMING_KSCHEDLAT;
p->irq = CONFIG_XENO_OPT_TIMING_IRQLAT;
}
#undef __sched_latency
#endif /* !_COBALT_BLACKFIN_ASM_CALIBRATION_H */
/*
* Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
*
* Xenomai is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Xenomai is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xenomai; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_FEATURES_H
#define _COBALT_BLACKFIN_ASM_FEATURES_H
struct cobalt_featinfo;
static inline void collect_arch_features(struct cobalt_featinfo *p) { }
#include <asm/xenomai/uapi/features.h>
#endif /* !_COBALT_BLACKFIN_ASM_FEATURES_H */
/*
* Copyright (C) 2006 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
*
* Xenomai is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* Xenomai is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xenomai; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_FPTEST_H
#define _COBALT_BLACKFIN_ASM_FPTEST_H
#include <linux/errno.h>
#include <asm/xenomai/uapi/fptest.h>
static inline int fp_kernel_supported(void)
{
return 0;
}
static inline int fp_linux_begin(void)
{
return -ENOSYS;
}
static inline void fp_linux_end(void)
{
}
static inline int fp_detect(void)
{
return 0;
}
#endif /* _COBALT_BLACKFIN_ASM_FPTEST_H */
/**
* Copyright &copy; 2005 Philippe Gerum.
*
* Xenomai is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, Inc., 675 Mass Ave,
* Cambridge MA 02139, USA; either version 2 of the License, or (at
* your option) any later version.
*
* Xenomai is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xenomai; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_MACHINE_H
#define _COBALT_BLACKFIN_ASM_MACHINE_H
#include <linux/compiler.h>
#include <linux/linkage.h>
#include <linux/bitops.h>
#define XNARCH_HOST_TICK_IRQ __ipipe_hrtimer_irq
static inline __attribute_const__ unsigned long ffnz(unsigned long ul)
{
return ffs(ul) - 1;
}
#include <asm-generic/xenomai/machine.h>
#endif /* !_COBALT_BLACKFIN_ASM_MACHINE_H */
/*
* Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
*
* Xenomai is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* Xenomai is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xenomai; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_SYSCALL_H
#define _COBALT_BLACKFIN_ASM_SYSCALL_H
#include <linux/errno.h>
#include <asm/ptrace.h>
#include <asm-generic/xenomai/syscall.h>
/*
* Cobalt and Linux syscall numbers can be fetched from P0, masking
* out the __COBALT_SYSCALL_BIT marker.
*/
#define __xn_reg_sys(__regs) ((__regs)->orig_p0)
#define __xn_syscall_p(__regs) (__xn_reg_sys(__regs) & __COBALT_SYSCALL_BIT)
#define __xn_syscall(__regs) (__xn_reg_sys(__regs) & ~__COBALT_SYSCALL_BIT)
#define __xn_reg_rval(__regs) ((__regs)->r0)
#define __xn_reg_arg1(__regs) ((__regs)->r0)
#define __xn_reg_arg2(__regs) ((__regs)->r1)
#define __xn_reg_arg3(__regs) ((__regs)->r2)
#define __xn_reg_arg4(__regs) ((__regs)->r3)
#define __xn_reg_arg5(__regs) ((__regs)->r4)
/*
* Root syscall number with predicate (valid only if
* !__xn_syscall_p(__regs)).
*/
#define __xn_rootcall_p(__regs, __code) \
({ \
*(__code) = __xn_syscall(__regs); \
*(__code) < NR_syscalls; \
})
static inline void __xn_error_return(struct pt_regs *regs, int v)
{
__xn_reg_rval(regs) = v;
}
static inline void __xn_status_return(struct pt_regs *regs, long v)
{
__xn_reg_rval(regs) = v;
}
static inline int __xn_interrupted_p(struct pt_regs *regs)
{
return __xn_reg_rval(regs) == -EINTR;
}
int xnarch_local_syscall(unsigned long a1, unsigned long a2,
unsigned long a3, unsigned long a4,
unsigned long a5);
#endif /* !_COBALT_BLACKFIN_ASM_SYSCALL_H */
/*
* Copyright (C) 2014 Philippe Gerum <rpm@xenomai.org>.
*
* Xenomai is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* Xenomai is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xenomai; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_SYSCALL32_H
#define _COBALT_BLACKFIN_ASM_SYSCALL32_H
#include <asm-generic/xenomai/syscall32.h>
#endif /* !_COBALT_BLACKFIN_ASM_SYSCALL32_H */
/*
* Copyright (C) 2005, 2012 Philippe Gerum <rpm@xenomai.org>.
*
* Xenomai is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Xenomai is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xenomai; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_THREAD_H
#define _COBALT_BLACKFIN_ASM_THREAD_H
#include <asm-generic/xenomai/thread.h>
struct xnarchtcb {
struct xntcb core;
struct {
unsigned long pc;
unsigned long p0;
unsigned long r5;
} mayday;
};
#define xnarch_fpu_ptr(tcb) NULL
#define xnarch_fault_regs(d) ((d)->regs)
#define xnarch_fault_trap(d) ((d)->exception)
#define xnarch_fault_code(d) (0) /* None on this arch. */
#define xnarch_fault_pc(d) ((d)->regs->retx)
#define xnarch_fault_fpu_p(d) (0) /* Can't be. */
#define xnarch_fault_pf_p(d) (0) /* No page faults. */
#define xnarch_fault_bp_p(d) ((current->ptrace & PT_PTRACED) && \
((d)->exception == VEC_STEP || \
(d)->exception == VEC_EXCPT01 || \
(d)->exception == VEC_WATCH))
#define xnarch_fault_notify(d) (!xnarch_fault_bp_p(d))
void xnarch_switch_to(struct xnthread *out, struct xnthread *in);
int xnarch_escalate(void);
static inline void xnarch_init_root_tcb(struct xnthread *thread) { }
static inline void xnarch_init_shadow_tcb(struct xnthread *thread) { }
static inline void xnarch_enter_root(struct xnthread *root) { }
static inline void xnarch_leave_root(struct xnthread *root) { }
static inline void
xnarch_switch_fpu(struct xnthread *from, struct xnthread *thread)
{
}
static inline int
xnarch_handle_fpu_fault(struct xnthread *from,
struct xnthread *to, struct ipipe_trap_data *d)
{
return 0;
}
#endif /* !_COBALT_BLACKFIN_ASM_THREAD_H */
/*
* Copyright (C) 2008 Philippe Gerum <rpm@xenomai.org>.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_UAPI_ARITH_H
#define _COBALT_BLACKFIN_ASM_UAPI_ARITH_H
#include <asm/xenomai/uapi/features.h>
#define xnarch_add96and64(l0, l1, l2, s0, s1) \
do { \
unsigned long cl, ch; \
__asm__ ("%2 = %2 + %6\n\t" \
"CC = AC0\n\t" \
"%3 = CC\n\t" \
"%1 = %1 + %5\n\t" \
"CC = AC0\n\t" \
"%4 = CC\n\t" \
"%1 = %1 + %3\n\t" \
"CC = AC0\n\t" \
"%3 = CC\n\t" \
"%4 = %4 + %3\n\t" \
"%0 = %0 + %4\n\t" \
: "+d"(l0), "+d"(l1), "+d"(l2), "=&d" (cl), "=&d" (ch) \
: "d"(s0), "d"(s1) : "cc"); \
} while (0)
#include <cobalt/uapi/asm-generic/arith.h>
#endif /* _COBALT_BLACKFIN_ASM_UAPI_ARITH_H */
/*
* Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_UAPI_FEATURES_H
#define _COBALT_BLACKFIN_ASM_UAPI_FEATURES_H
/* The ABI revision level we use on this arch. */
#define XENOMAI_ABI_REV 16UL
#define XENOMAI_FEAT_DEP __xn_feat_generic_mask
#define XENOMAI_FEAT_MAN __xn_feat_generic_man_mask
#define XNARCH_HAVE_LLMULSHFT 1
#define XNARCH_HAVE_NODIV_LLIMD 1
struct cobalt_featinfo_archdep { /* no arch-specific feature */ };
#include <cobalt/uapi/asm-generic/features.h>
static inline const char *get_feature_label(unsigned int feature)
{
return get_generic_feature_label(feature);
}
#endif /* !_COBALT_BLACKFIN_ASM_UAPI_FEATURES_H */
/*
* Copyright (C) 2006 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_UAPI_FPTEST_H
#define _COBALT_BLACKFIN_ASM_UAPI_FPTEST_H
static inline void fp_regs_set(int features, unsigned int val)
{
}
static inline unsigned int fp_regs_check(int features, unsigned int val,
int (*report)(const char *fmt, ...))
{
return val;
}
#endif /* !_COBALT_BLACKFIN_ASM_UAPI_FPTEST_H */
/*
* Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#ifndef _COBALT_BLACKFIN_ASM_UAPI_SYSCALL_H
#define _COBALT_BLACKFIN_ASM_UAPI_SYSCALL_H
#define __xn_syscode(__nr) (__COBALT_SYSCALL_BIT | (__nr))
/*
* No atomic xchg available from user-space. We implement this as a
* syscall.
*/
#define __xn_lsys_xchg 0
#endif /* !_COBALT_BLACKFIN_ASM_UAPI_SYSCALL_H */
/*
* Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
*
* Xenomai is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* Xenomai is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xenomai; if not, write to the Free Software