Skip to content

Commit

Permalink
Merge pull request #172 from sifive/sifive-i2c
Browse files Browse the repository at this point in the history
Sifive i2c
  • Loading branch information
nategraff-sifive committed Oct 16, 2019
2 parents 7efd985 + 2f0ceb6 commit a6d6577
Show file tree
Hide file tree
Showing 6 changed files with 364 additions and 29 deletions.
2 changes: 2 additions & 0 deletions Makefile.am
Expand Up @@ -133,6 +133,8 @@ freedom_metal_header_generator_SOURCES = \
metal_header/sifive_gpio_led.h \
metal_header/sifive_gpio_switch.c++ \
metal_header/sifive_gpio_switch.h \
metal_header/sifive_i2c0.c++ \
metal_header/sifive_i2c0.h \
metal_header/sifive_local_external_interrupts0.c++ \
metal_header/sifive_local_external_interrupts0.h \
metal_header/sifive_rtc0.c++ \
Expand Down
33 changes: 27 additions & 6 deletions Makefile.in
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -185,6 +185,7 @@ am_freedom_metal_header_generator_OBJECTS = \
metal_header/freedom_metal_header_generator-sifive_gpio_button.$(OBJEXT) \
metal_header/freedom_metal_header_generator-sifive_gpio_led.$(OBJEXT) \
metal_header/freedom_metal_header_generator-sifive_gpio_switch.$(OBJEXT) \
metal_header/freedom_metal_header_generator-sifive_i2c0.$(OBJEXT) \
metal_header/freedom_metal_header_generator-sifive_local_external_interrupts0.$(OBJEXT) \
metal_header/freedom_metal_header_generator-sifive_rtc0.$(OBJEXT) \
metal_header/freedom_metal_header_generator-sifive_spi0.$(OBJEXT) \
Expand Down Expand Up @@ -729,6 +730,8 @@ freedom_metal_header_generator_SOURCES = \
metal_header/sifive_gpio_led.h \
metal_header/sifive_gpio_switch.c++ \
metal_header/sifive_gpio_switch.h \
metal_header/sifive_i2c0.c++ \
metal_header/sifive_i2c0.h \
metal_header/sifive_local_external_interrupts0.c++ \
metal_header/sifive_local_external_interrupts0.h \
metal_header/sifive_rtc0.c++ \
Expand Down Expand Up @@ -1124,6 +1127,9 @@ metal_header/freedom_metal_header_generator-sifive_gpio_led.$(OBJEXT): \
metal_header/freedom_metal_header_generator-sifive_gpio_switch.$(OBJEXT): \
metal_header/$(am__dirstamp) \
metal_header/$(DEPDIR)/$(am__dirstamp)
metal_header/freedom_metal_header_generator-sifive_i2c0.$(OBJEXT): \
metal_header/$(am__dirstamp) \
metal_header/$(DEPDIR)/$(am__dirstamp)
metal_header/freedom_metal_header_generator-sifive_local_external_interrupts0.$(OBJEXT): \
metal_header/$(am__dirstamp) \
metal_header/$(DEPDIR)/$(am__dirstamp)
Expand Down Expand Up @@ -1242,6 +1248,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_gpio_button.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_gpio_led.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_gpio_switch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_i2c0.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_local_external_interrupts0.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_rtc0.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_spi0.Po@am__quote@
Expand Down Expand Up @@ -2095,6 +2102,20 @@ metal_header/freedom_metal_header_generator-sifive_gpio_switch.obj: metal_header
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_metal_header_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o metal_header/freedom_metal_header_generator-sifive_gpio_switch.obj `if test -f 'metal_header/sifive_gpio_switch.c++'; then $(CYGPATH_W) 'metal_header/sifive_gpio_switch.c++'; else $(CYGPATH_W) '$(srcdir)/metal_header/sifive_gpio_switch.c++'; fi`

metal_header/freedom_metal_header_generator-sifive_i2c0.o: metal_header/sifive_i2c0.c++
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_metal_header_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT metal_header/freedom_metal_header_generator-sifive_i2c0.o -MD -MP -MF metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_i2c0.Tpo -c -o metal_header/freedom_metal_header_generator-sifive_i2c0.o `test -f 'metal_header/sifive_i2c0.c++' || echo '$(srcdir)/'`metal_header/sifive_i2c0.c++
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_i2c0.Tpo metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_i2c0.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='metal_header/sifive_i2c0.c++' object='metal_header/freedom_metal_header_generator-sifive_i2c0.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_metal_header_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o metal_header/freedom_metal_header_generator-sifive_i2c0.o `test -f 'metal_header/sifive_i2c0.c++' || echo '$(srcdir)/'`metal_header/sifive_i2c0.c++

metal_header/freedom_metal_header_generator-sifive_i2c0.obj: metal_header/sifive_i2c0.c++
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_metal_header_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT metal_header/freedom_metal_header_generator-sifive_i2c0.obj -MD -MP -MF metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_i2c0.Tpo -c -o metal_header/freedom_metal_header_generator-sifive_i2c0.obj `if test -f 'metal_header/sifive_i2c0.c++'; then $(CYGPATH_W) 'metal_header/sifive_i2c0.c++'; else $(CYGPATH_W) '$(srcdir)/metal_header/sifive_i2c0.c++'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_i2c0.Tpo metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_i2c0.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='metal_header/sifive_i2c0.c++' object='metal_header/freedom_metal_header_generator-sifive_i2c0.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_metal_header_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o metal_header/freedom_metal_header_generator-sifive_i2c0.obj `if test -f 'metal_header/sifive_i2c0.c++'; then $(CYGPATH_W) 'metal_header/sifive_i2c0.c++'; else $(CYGPATH_W) '$(srcdir)/metal_header/sifive_i2c0.c++'; fi`

metal_header/freedom_metal_header_generator-sifive_local_external_interrupts0.o: metal_header/sifive_local_external_interrupts0.c++
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(freedom_metal_header_generator_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT metal_header/freedom_metal_header_generator-sifive_local_external_interrupts0.o -MD -MP -MF metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_local_external_interrupts0.Tpo -c -o metal_header/freedom_metal_header_generator-sifive_local_external_interrupts0.o `test -f 'metal_header/sifive_local_external_interrupts0.c++' || echo '$(srcdir)/'`metal_header/sifive_local_external_interrupts0.c++
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_local_external_interrupts0.Tpo metal_header/$(DEPDIR)/freedom_metal_header_generator-sifive_local_external_interrupts0.Po
Expand Down Expand Up @@ -2742,7 +2763,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)

dist-bzip2: distdir
Expand All @@ -2768,7 +2789,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)

dist-zip: distdir
Expand All @@ -2786,7 +2807,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
Expand All @@ -2796,7 +2817,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
Expand Down
46 changes: 23 additions & 23 deletions aclocal.m4
@@ -1,6 +1,6 @@
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-

# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.

# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand All @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])

# Copyright (C) 2002-2014 Free Software Foundation, Inc.
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand All @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.15], [],
m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])

Expand All @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.15])dnl
[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])

# AM_AUX_DIR_EXPAND -*- Autoconf -*-

# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`

# AM_CONDITIONAL -*- Autoconf -*-

# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])

# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl

# Generate code to set up dependency tracking. -*- Autoconf -*-

# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -408,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],

# Do all the work for Automake. -*- Autoconf -*-

# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -605,7 +605,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])

# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand All @@ -626,7 +626,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])

# Copyright (C) 2003-2014 Free Software Foundation, Inc.
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand All @@ -648,7 +648,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering

# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -683,7 +683,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])

# Check to see how 'make' treats includes. -*- Autoconf -*-

# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -733,7 +733,7 @@ rm -f confinc confmf

# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-

# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -772,7 +772,7 @@ fi

# Helper functions for option handling. -*- Autoconf -*-

# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -801,7 +801,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])

# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -848,7 +848,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])

# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand All @@ -867,7 +867,7 @@ AC_DEFUN([AM_RUN_LOG],

# Check to make sure that the build environment is sane. -*- Autoconf -*-

# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -948,7 +948,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])

# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -1008,7 +1008,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])

# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down Expand Up @@ -1036,7 +1036,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])

# Copyright (C) 2006-2014 Free Software Foundation, Inc.
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand All @@ -1055,7 +1055,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])

# Check how to create a tarball. -*- Autoconf -*-

# Copyright (C) 2004-2014 Free Software Foundation, Inc.
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down
2 changes: 2 additions & 0 deletions metal_header/freedom-metal_header-generator.c++
Expand Up @@ -27,6 +27,7 @@
#include <sifive_gpio_button.h>
#include <sifive_gpio_led.h>
#include <sifive_gpio_switch.h>
#include <sifive_i2c0.h>
#include <sifive_local_external_interrupts0.h>
#include <sifive_rtc0.h>
#include <sifive_spi0.h>
Expand Down Expand Up @@ -154,6 +155,7 @@ static void prepare_devices(const fdt &dtb, fstream &os,
devices.push_back(new sifive_gpio_button(os, dtb));
devices.push_back(new sifive_gpio_led(os, dtb));
devices.push_back(new sifive_gpio_switch(os, dtb));
devices.push_back(new sifive_i2c0(os, dtb));
devices.push_back(new sifive_rtc0(os, dtb));
devices.push_back(new sifive_spi0(os, dtb));
devices.push_back(new sifive_test0(os, dtb));
Expand Down

0 comments on commit a6d6577

Please sign in to comment.