Private
Public Access
2
0
Commit Graph

49 Commits

Author SHA1 Message Date
Daniel Bovensiepen
0df2e0f417 platform: Add RISC-V architecture with VisionFive
Add RISC-V architecture and StarFive JH71x0-based boards
VisionFive and VisionFive 2.

Signed-off-by: Daniel Bovensiepen <oss@bovi.li>
Signed-off-by: Zhu Jia Xing <jiaxing.zhu@siemens.com>
2023-09-21 09:25:08 -07:00
Thomas Ingleby
170bdd104f spdx: add spdx tags to most files
Large change that removes the duplicated MIT notice withe a spdx tag

Signed-off-by: Thomas Ingleby <thomas.ingleby@intel.com>
2019-05-23 10:09:12 -07:00
Noel Eck
fc4b2a554d Platform_extender: FT4222 library refactor
Updates to make the FT4222 platform extender more usable.

Previous implementation opened libft4222.so and loaded symbols as
needed.  This implementation removes dynamic loading of libft4222 in
favor of creating a new shared libary which links against libft4222.so.
The dynamic loading is now done in mraa.c.  One C method is exposed in
libmraa-platform-ft4222.so for finding/initializing an FT4222:

mraa_platform_t mraa_usb_platform_extender(mraa_board_t* board);

Mraa.c attempts to open this platform library and calls the
mraa_usb_platform_extender method.  If an ftdi4222 is connected, the
user gets added IO from the extender.  If no FT4222 device is connected,
continue as normal.

    * Create a new platform library for the FT4222
    * Expose only 1 C method from the library -
      mraa_usb_platform_extender
    * libmraa-platform-ft4222.so contains CXX code (as well as previous
      C code).  All *allocs have been removed in favor of global
      C++ stl containers.
    * Previously, the FT4222 would only initialize correctly if 2 ftdi
      devices existed.  Now, initialize FT4222 devices based on the
      device id.
    * Many fixes for various problems with the FT4222
    * Added unit test for platform extender (minimal functionality w/o hw)
    * Updated to FindFtd4222.cmake module to handle standard arguments
    * Removed CMAKE_C_FLAGS addition of -DFTDID2XX and -DFTDI4222 since
      these are NOT used anywhere in source.
    * Building the FTDI4222 shim requires libft4222.h which requires
      ftd2xx.h.  Updated CMakeLists.txt to require both when building
      the shim.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-26 12:57:13 -07:00
Noel Eck
a2f01bee5f mraa.c: Added pointer to pointer back to find_uart
Went a bit too far with the previous commit.  Added pointer to pointer
back to mraa_find_uart_bus_pci.

Tested leaks against valgrind and verified dev_path gets set with gdb.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-14 21:21:37 -07:00
Noel Eck
17342cbbbb mraa.c: Fixed memleak of device_path for IEI_TANK
Unfortunately the device_path char* is dynamically allocated
and #defined and const char *'ed depending on how each platform provided the
uart device paths which makes cleaning it up more complicated.

Added a check for the IEI_TANK.

Removed the char** (in favor of a char*) for mraa_find_uart_bus_pci.)

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-14 15:18:29 -07:00
Abhishek Malik
cfda9c99d7 UART: Fixing UART issues on UP2
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2018-03-14 16:21:42 -07:00
Serge Vakulenko
6770be911b Add support for MIPS-based boards Omega2 and Linkit Smart 7688
Signed-off-by: Serge Vakulenko <vak@besm6.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-10-05 10:54:57 +02:00
Brendan Le Foll
4c7616fe91 android-things: Prep for peripheralmanager support
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2017-04-24 14:42:54 -07:00
Brendan Le Foll
9d365ce0d6 mraa.c: Find i2c bus by pci id
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-11-02 15:30:56 +00:00
Brendan Le Foll
23e871c5bb mraa_internal.h: Add internal definition for mraa_atoi
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-11-02 15:30:56 +00:00
Houman Brinjcargorabi
8ba8ce3b26 mraa.c: Added init platform from json file
Signed-off-by: Houman Brinjcargorabi <houman.brinjcargorabi@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-07-27 11:33:29 +01:00
Alex Tereschenko
bcb6adc551 mock: added mraa mock platform infra and GPIO implementation
Mock platform allows one to use mraa without having any real HW.

This commit makes necessary foundational changes and implements
GPIO functionality as well as adds respective tests.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-07-05 16:19:05 +01:00
Longwei Su
a52ce5d5bb imraa: add first version of imraa, the mraa initialisation daemon
Imraa allows the automatic flashing and setup of arduino101 subplatforms as
well as the initial setup of GPIO/i2c devices

Signed-off-by: Longwei Su <lsu@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:12:30 +00:00
Henry Bruce
44b2367fdc java: Updated gpio.c to use JNI functions set in mraa_lang_func
This is a re-design of commit 0041801. mraa_lang_func_t structure has been
added (similar in design to mraa_adv_func_t) that points to JNI functions
implemented in src/java/mraajni.c. Functions are set by libmraajava.so,
see wrapper entry in src/java/mraajava.i. As gpio.c now uses these
functions, language specific #ifdef code has been removed as JNI code
is only called if functions are defined (i.e. not NULL)

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2016-03-22 18:04:57 +00:00
Henry Bruce
0049ba1378 mraa_internal.h: Added mraa_iio_detect() function declaration
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
2015-12-15 10:42:06 +00:00
Brendan Le Foll
13086cb2db mraa_internal.h: Add fnmatch.h include
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:06 +00:00
Brendan Le Foll
65614f5f58 iio: Remove iio structures from mraa_platform_t
This means that a valid platform is no longer required for iio operations and
therefore this is now only a req for using USBPLAT

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-12-15 10:42:06 +00:00
Brendan Le Foll
07343e2ee7 mraa: Remove global advance_func struct and place it in platform configuration
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-08 14:42:04 +01:00
Henry Bruce
5740e46ae0 x86: advance_func now stored in mraa_board_t instance
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-08 14:42:03 +01:00
Henry Bruce
8f48df0533 usb: Skeleton platform code for FTDI FT4222 USB to i2c bridge
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-08 14:42:03 +01:00
Brendan Le Foll
df0dbb0c73 mraa: add internal mraa_find_i2c_bus function
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-07-10 11:11:41 +01:00
Michael Ring
bff7b558eb mraa.c: Add _contains helper functions
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-08 22:19:14 +01:00
Brendan Le Foll
68e216ec3f mraa_internal.h: clean header style
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-08 22:19:14 +01:00
Michael Ring
d2fcadc8d5 mraa.c: change helper functions to use const char*
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-08 22:19:14 +01:00
Michael Ring
8e305a1032 mraa.c added internal helper functions to support globbing and link analysis
Signed-off-by: Michael Ring <mail@michael-ring.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-15 22:38:36 +00:00
Thomas Ingleby
ed4c68eba1 uart: cleanup and bring inline with standard
Removed mraa_setup_uart from core mraa.c moved logic within init
function
Add more syslog output for easier debugging.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2015-01-20 14:44:28 +00:00
Thomas Ingleby
f9d466bb84 arm: add initial skeleton for arm platform support
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-12-08 15:32:42 +00:00
Thomas Ingleby
b0a21e2c30 arch: initial framework for supporting other architectures added.
x86: all platforms moved into x86 directory

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-12-08 15:32:42 +00:00
Thomas Ingleby
3865bebe8d mmap: remove implementation of mmap gpio
Instead of trying to have an implementation that covers most platforms
Leave all mmap up to platform definition. Through function pointers.

gpio_mmap_setup sets up the mmap

Within the internal gpio context struct two more function pointers now
exist mmap_read & mmap_write. They exist there so each context can its
own function for handling a write and read.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-11-17 17:41:47 +00:00
Thomas Ingleby
d1f9e98060 internal: remove un-implmented function prototype
Left over from earlier version of mraa.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-11-17 17:41:47 +00:00
Thomas Ingleby
5d7c85c7a1 pwm: move pwm setup to module
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-11-17 17:41:47 +00:00
Thomas Ingleby
e39268899c spi: move spi setup from core into module
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-11-17 17:41:47 +00:00
Thomas Ingleby
ffd38bb68c i2c: move i2c setup from core into module
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-11-17 17:40:48 +00:00
Thomas Ingleby
66c5011cfb aio: move aio setup from core into module
Added additional syslog messages for debugging

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-11-17 17:40:48 +00:00
Thomas Ingleby
401f0cfe65 gpio: move gpio setup from core into module
Added syslog lines for easier fault investigation

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-11-17 17:40:48 +00:00
Thomas Ingleby
1cbdef1ab3 internal: add function protype for mux setup.
Now accesible from all mraa modules

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-11-17 17:40:48 +00:00
Brendan Le Foll
535d92ab79 i2c: use default i2c bus in board config if invalid
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-10-23 18:05:07 +01:00
Brendan Le Foll
68de395fea mraa_internal.h: fix styling issues
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-09-25 14:30:23 +01:00
Thomas Ingleby
3d5512c15e mraa: make platform info more available internally
* available with mraa_internal header

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-14 16:56:12 +01:00
Thomas Ingleby
fb030b5e9f hook: change structure to pointer
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-14 15:37:55 +01:00
Thomas Ingleby
b74759e973 mraa: rename internal adv func mraa_adv_func_t
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-14 15:12:08 +01:00
Thomas Ingleby
4d6a3be3db hook: items lost in merge, missing adv items.
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-11 12:02:40 +01:00
Thomas Ingleby
9bacfcff5f Merge branch 'hook'
Conflicts:
	include/intel_galileo_rev_d.h
	include/intel_galileo_rev_g.h
	include/mraa_adv_func.h
	include/mraa_internal.h
	src/gpio/gpio.c
	src/mraa.c
2014-07-11 11:56:45 +01:00
Thomas Ingleby
1fafd97f5e hook: rename from declared struct to adance_func
* Removed bitfield, now checks if pointer NULL.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-11 09:14:49 +01:00
Brendan Le Foll
b5b7dec441 mraa_internal: add extern "C" to internal headers
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-10 22:08:05 +01:00
Thomas Ingleby
23304fb6c4 uart: barebones uart module added.
* Only defined call is the init. Will then expose the uart from
* the multiplexors.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-10 01:09:46 +01:00
Thomas Ingleby
0e46b94793 hook: remove hooks, move into branch.
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-07-01 18:32:38 +01:00
Thomas Ingleby
d0ea43f8d1 mraa: initial implementation of "hooks"
* Should allow for more platform quirks to be handled by mraa without
* massive conditional areas per platform.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-06-27 15:37:48 +01:00
Thomas Ingleby
6853997a92 mraa: rename from maa to mraa
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-06-24 17:24:54 +01:00