diff --git a/patch.sh b/patch.sh index a790febb5141e2e729e7d18d801da1cc633e5a31..df6930f1ca154617eb3e30a3a3b4059ed0e09031 100644 --- a/patch.sh +++ b/patch.sh @@ -284,6 +284,19 @@ ti () { fi fi unset is_mainline + + echo "dir: ti/dtbs" + #regenerate="enable" + if [ "x${regenerate}" = "xenable" ] ; then + start_cleanup + fi + + ${git} "${DIR}/patches/ti/dtbs/0001-sync-with-ti-4.4.patch" + + if [ "x${regenerate}" = "xenable" ] ; then + number=1 + cleanup + fi } exynos () { @@ -620,9 +633,9 @@ beaglebone () { ${git} "${DIR}/patches/beaglebone/abbbi/0001-gpu-drm-i2c-add-alternative-adv7511-driver-with-audi.patch" ${git} "${DIR}/patches/beaglebone/abbbi/0002-gpu-drm-i2c-adihdmi-componentize-driver-and-huge-ref.patch" - ${git} "${DIR}/patches/beaglebone/abbbi/0003-drm-adihdmi-Drop-dummy-save-restore-hooks.patch" - ${git} "${DIR}/patches/beaglebone/abbbi/0004-drm-adihdmi-Pass-name-to-drm_encoder_init.patch" - ${git} "${DIR}/patches/beaglebone/abbbi/0005-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch" + ${git} "${DIR}/patches/beaglebone/abbbi/0003-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch" + ${git} "${DIR}/patches/beaglebone/abbbi/0004-drm-adihdmi-Drop-dummy-save-restore-hooks.patch" + ${git} "${DIR}/patches/beaglebone/abbbi/0005-drm-adihdmi-Pass-name-to-drm_encoder_init.patch" ${git} "${DIR}/patches/beaglebone/abbbi/0006-adihdmi_drv-reg_default-reg_sequence.patch" if [ "x${regenerate}" = "xenable" ] ; then @@ -662,7 +675,7 @@ beaglebone () { start_cleanup fi - ${git} "${DIR}/patches/beaglebone/sancloud/0001-add-sancloud-beaglebone-enhanced.patch" + ${git} "${DIR}/patches/beaglebone/sancloud/0001-add-am335x-sancloud-bbe.patch" ${git} "${DIR}/patches/beaglebone/sancloud/0002-am335x-sancloud-bbe-update-lps331ap-mpu6050-irq-pins.patch" if [ "x${regenerate}" = "xenable" ] ; then @@ -683,6 +696,24 @@ beaglebone () { cleanup fi + #echo "dir: beaglebone/CTAG" + #regenerate="enable" + #if [ "x${regenerate}" = "xenable" ] ; then + # start_cleanup + #fi + + #${git} "${DIR}/patches/beaglebone/CTAG/0001-Added-driver-and-device-tree-for-CTAG-face2-4-Audio-.patch" + #${git} "${DIR}/patches/beaglebone/CTAG/0002-Added-support-for-higher-sampling-rates-in-AD193X-dr.patch" + #${git} "${DIR}/patches/beaglebone/CTAG/0003-Added-support-for-AD193X-and-CTAG-face2-4-Audio-Card.patch" + #${git} "${DIR}/patches/beaglebone/CTAG/0004-Modified-ASOC-platform-driver-for-McASP-to-use-async.patch" + #${git} "${DIR}/patches/beaglebone/CTAG/0005-Changed-descriptions-in-files-belonging-to-CTAG-face.patch" + #${git} "${DIR}/patches/beaglebone/CTAG/0006-add-black-version-of-ctag-face-pass-uboot-cape-ctag-.patch" + + #if [ "x${regenerate}" = "xenable" ] ; then + # number=6 + # cleanup + #fi + echo "dir: beaglebone/capes" #regenerate="enable" if [ "x${regenerate}" = "xenable" ] ; then @@ -693,36 +724,15 @@ beaglebone () { ${git} "${DIR}/patches/beaglebone/capes/0002-ARM-dts-am335x-boneblack-enable-wl1835mod-cape-suppo.patch" ${git} "${DIR}/patches/beaglebone/capes/0003-add-am335x-boneblack-bbbmini.dts.patch" ${git} "${DIR}/patches/beaglebone/capes/0004-add-lcd-am335x-boneblack-bbb-exp-c.dtb-am335x-bonebl.patch" + ${git} "${DIR}/patches/beaglebone/capes/0005-bb-audio-cape.patch" #Replicape use am335x-boneblack-overlay.dtb??? if [ "x${regenerate}" = "xenable" ] ; then - number=4 + number=5 cleanup fi - echo "dir: beaglebone/rs485" - #regenerate="enable" - if [ "x${regenerate}" = "xenable" ] ; then - cherrypick_dir="beaglebone/rs485" - #merged in 4.6.0-rc0 - SHA="a07a70bcb72e4a766c8d3173986a773cef842d30" ; num="1" ; cherrypick - SHA="e490c9144cfaa8e2242c1e5d5187230928f27417" ; cherrypick - SHA="344cee2470ff70801c95c62ab2762da0834c8c6c" ; cherrypick - SHA="bf2a0be45ffc5ab706f9be71a2cdc3f4600cb444" ; cherrypick - SHA="b18a183eaac25bd8dc51eab85437c7253f5c31d1" ; cherrypick - exit 2 - fi - - if [ "x${merged_in_4_6}" = "xenable" ] ; then - #merged in 4.6.0-rc0 - ${git} "${DIR}/patches/beaglebone/rs485/0001-tty-Move-serial8250_stop_rx-in-front-of-serial8250_s.patch" - ${git} "${DIR}/patches/beaglebone/rs485/0002-tty-Add-software-emulated-RS485-support-for-8250.patch" - ${git} "${DIR}/patches/beaglebone/rs485/0003-tty-8250_omap-Use-software-emulated-RS485-direction-.patch" - ${git} "${DIR}/patches/beaglebone/rs485/0004-tty-serial-8250-Cleanup-p-em485-in-serial8250_unregi.patch" - ${git} "${DIR}/patches/beaglebone/rs485/0005-tty-serial-Use-GFP_ATOMIC-instead-of-GFP_KERNEL-in-s.patch" - fi - echo "dir: beaglebone/mctrl_gpio" #regenerate="enable" if [ "x${regenerate}" = "xenable" ] ; then @@ -740,6 +750,19 @@ beaglebone () { cleanup fi + echo "dir: beaglebone/jtag" + #regenerate="enable" + if [ "x${regenerate}" = "xenable" ] ; then + start_cleanup + fi + + ${git} "${DIR}/patches/beaglebone/jtag/0001-add-jtag-clock-pinmux.patch" + + if [ "x${regenerate}" = "xenable" ] ; then + number=1 + cleanup + fi + #regenerate="enable" if [ "x${regenerate}" = "xenable" ] ; then cherrypick_dir="beaglebone/tilcdc" @@ -843,6 +866,11 @@ beaglebone () { ${git} "${DIR}/patches/beaglebone/tilcdc/0022-drm-tilcdc-Use-devm_kzalloc-and-devm_kcalloc-for-pri.patch" fi + #[PATCH v2 0/3] Recover from sync lost error flood by resetting the LCDC + ${git} "${DIR}/patches/beaglebone/tilcdc/0023-drm-tilcdc-Write-to-LCDC_END_OF_INT_IND_REG-at-the-e.patch" + ${git} "${DIR}/patches/beaglebone/tilcdc/0024-drm-tilcdc-Move-waiting-of-LCDC_FRAME_DONE-IRQ-into-.patch" + ${git} "${DIR}/patches/beaglebone/tilcdc/0025-drm-tilcdc-Recover-from-sync-lost-error-flood-by-res.patch" + #This has to be last... echo "dir: beaglebone/dtbs" #regenerate="enable" @@ -889,9 +917,13 @@ beaglebone () { device="am335x-boneblack-bbbmini.dtb" ; dtb_makefile_append device="am335x-boneblack-bbb-exp-c.dtb" ; dtb_makefile_append device="am335x-boneblack-bbb-exp-r.dtb" ; dtb_makefile_append + device="am335x-boneblack-audio.dtb" ; dtb_makefile_append device="am335x-sancloud-bbe.dtb" ; dtb_makefile_append + #device="am335x-boneblack-ctag-face.dtb" ; dtb_makefile_append + #device="am335x-bonegreen-ctag-face.dtb" ; dtb_makefile_append + git commit -a -m 'auto generated: capes: add dtbs to makefile' -s git format-patch -1 -o ../patches/beaglebone/generated/ exit 2 diff --git a/patches/bbb_overlays/0021-arm-dts-Enable-beaglebone-cape-manager.patch b/patches/bbb_overlays/0021-arm-dts-Enable-beaglebone-cape-manager.patch index fcdb49520612cdf9945278efbcabbd1e16e18ccd..f44b8f7a01ea017283e6b423e8dd24a9e66ce9ed 100644 --- a/patches/bbb_overlays/0021-arm-dts-Enable-beaglebone-cape-manager.patch +++ b/patches/bbb_overlays/0021-arm-dts-Enable-beaglebone-cape-manager.patch @@ -1,6 +1,6 @@ -From 69cb01e555e94d83435db390fd3a53b3bafab930 Mon Sep 17 00:00:00 2001 -From: Pantelis Antoniou <pantelis.antoniou@konsulko.com> -Date: Tue, 12 May 2015 14:35:13 +0300 +From 5859d4047099a0a79844bb0b7b562c7bed19a97f Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Tue, 15 Mar 2016 16:15:47 -0500 Subject: [PATCH 21/37] arm: dts: Enable beaglebone cape-manager Enable the cape manager on the beaglebone family of boards. @@ -11,12 +11,12 @@ Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> 1 file changed, 25 insertions(+) diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi -index f3db13d..0d41adc 100644 +index 44a3cb2..de4cd9a 100644 --- a/arch/arm/boot/dts/am335x-bone-common.dtsi +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi @@ -401,3 +401,28 @@ - &sham { - status = "okay"; + &rtc { + system-power-controller; }; + +/* the cape manager */ diff --git a/patches/beaglebone/CTAG/0001-Added-driver-and-device-tree-for-CTAG-face2-4-Audio-.patch b/patches/beaglebone/CTAG/0001-Added-driver-and-device-tree-for-CTAG-face2-4-Audio-.patch new file mode 100644 index 0000000000000000000000000000000000000000..73891b1ae78d143d87e0e02f6184977a4fd380b3 --- /dev/null +++ b/patches/beaglebone/CTAG/0001-Added-driver-and-device-tree-for-CTAG-face2-4-Audio-.patch @@ -0,0 +1,462 @@ +From 0bf52bf7ac7f9e5dd452b4fd4d825e9740f7a65b Mon Sep 17 00:00:00 2001 +From: Henrik Langer <henni19790@googlemail.com> +Date: Sat, 27 Feb 2016 19:26:11 +0100 +Subject: [PATCH 1/6] Added driver and device tree for CTAG face2|4 Audio Card + +--- + arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts | 99 +++++++ + sound/soc/davinci/davinci-ctag-face-2-4.c | 336 +++++++++++++++++++++++ + 2 files changed, 435 insertions(+) + create mode 100644 arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts + create mode 100644 sound/soc/davinci/davinci-ctag-face-2-4.c + +diff --git a/arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts b/arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts +new file mode 100644 +index 0000000..aa4bbf1 +--- /dev/null ++++ b/arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts +@@ -0,0 +1,99 @@ ++/* ++ * Base device tree of BeagleBone Green with AD1938 AudioCard ++ * ++ * Author: Henrik Langer <henrik.langer@student.fh-kiel.de> ++ * based on ++ BeagleBone Black and BeagleBone Green device tree ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++/dts-v1/; ++ ++#include "am33xx.dtsi" ++#include "am335x-bone-common.dtsi" ++ ++/ { ++ model = "TI AM335x BeagleBone Green AudioCard"; ++ compatible = "ti,am335x-bone-green", "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; ++}; ++ ++&ldo3_reg { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++}; ++ ++&mmc1 { ++ vmmc-supply = <&vmmcsd_fixed>; ++}; ++ ++&mmc2 { ++ vmmc-supply = <&vmmcsd_fixed>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emmc_pins>; ++ bus-width = <8>; ++ status = "okay"; ++}; ++ ++&sgx { ++ status = "okay"; ++}; ++ ++&am33xx_pinmux { ++ mcasp0_pins: mcasp0_pins { ++ pinctrl-single,pins = < ++ 0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_ahclkx */ ++ 0x19c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_axr2 */ ++ 0x194 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_fsx */ ++ 0x190 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx */ ++ 0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_fsr */ ++ 0x078 (PIN_INPUT_PULLDOWN | MUX_MODE6) /* mcasp0_aclkr */ ++ 0x198 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_axr0 */ ++ 0x06c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpio1[27] (enable oscillator) */ ++ >; ++ }; ++ ++ mcasp0_pins_sleep: mcasp0_pins_sleep { ++ pinctrl-single,pins = < ++ 0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_ahclkx */ ++ 0x19c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_axr2 */ ++ 0x194 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_fsx */ ++ 0x190 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_aclkx */ ++ 0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_fsr */ ++ 0x078 (PIN_INPUT_PULLDOWN | MUX_MODE6) /* mcasp0_aclkr */ ++ 0x198 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_axr0 */ ++ 0x06c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpio1[27] */ ++ >; ++ }; ++}; ++ ++&mcasp0 { ++ pinctrl-names = "default", "sleep"; ++ pinctrl-0 = <&mcasp0_pins>; ++ pinctrl-1 = <&mcasp0_pins_sleep>; ++ status = "okay"; ++ op-mode = <0>; /* MCASP_IIS_MODE */ ++ tdm-slots = <2>; ++ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ ++ 2 0 1 0 ++ >; ++ tx-num-evt = <1>; ++ rx-num-evt = <1>; ++}; ++ ++/ { ++ clk_mcasp0_fixed: clk_mcasp0_fixed { ++ #clock-cells = <0>; ++ compatible = "fixed-clock"; ++ clock-frequency = <24576000>; ++ }; ++ ++ clk_mcasp0: clk_mcasp0 { ++ #clock-cells = <0>; ++ compatible = "gpio-gate-clock"; ++ clocks = <&clk_mcasp0_fixed>; ++ enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */ ++ }; ++}; +diff --git a/sound/soc/davinci/davinci-ctag-face-2-4.c b/sound/soc/davinci/davinci-ctag-face-2-4.c +new file mode 100644 +index 0000000..2551774 +--- /dev/null ++++ b/sound/soc/davinci/davinci-ctag-face-2-4.c +@@ -0,0 +1,336 @@ ++/* ++ * ASoC machine driver for Davinci platform (BBG) and ad1938 audio codec. ++ * ++ * Author: Henrik Langer <henrik.langer@student.fh-kiel.de> ++ * based on ++ * ASoC driver for TI DAVINCI EVM platform by ++ * Vladimir Barinov <vbarinov@embeddedalley.com> ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program 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. ++ */ ++ ++#include <linux/module.h> ++#include <linux/moduleparam.h> ++#include <linux/timer.h> ++#include <linux/interrupt.h> ++#include <linux/platform_device.h> ++#include <linux/of_platform.h> ++#include <linux/clk.h> ++#include <sound/core.h> ++#include <sound/pcm.h> ++#include <sound/pcm_params.h> ++#include <sound/soc.h> ++#include <asm/dma.h> ++#include <asm/mach-types.h> ++ ++#include "../codecs/ad193x.h" ++ ++struct snd_soc_card_drvdata_davinci { ++ struct clk *mclk; ++ unsigned sysclk; ++ unsigned codec_clock; ++}; ++ ++/* ++ Define Dynamic Audio Power Management (DAPM) widgets ++*/ ++static const struct snd_soc_dapm_widget ad193x_dapm_widgets[] = { ++ SND_SOC_DAPM_LINE("Line Out", NULL), ++ SND_SOC_DAPM_LINE("Line In", NULL), ++}; ++ ++static const struct snd_soc_dapm_route audio_map[] = { ++ {"Line Out", NULL, "DAC1OUT"}, ++ {"Line Out", NULL, "DAC2OUT"}, ++ {"Line Out", NULL, "DAC3OUT"}, ++ {"Line Out", NULL, "DAC4OUT"}, ++ {"ADC1IN", NULL, "Line In"}, ++ {"ADC2IN", NULL, "Line In"}, ++}; ++ ++/* ++ Sound card init ++*/ ++static int snd_davinci_audiocard_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_card *card = rtd->card; ++ struct device_node *np = card->dev->of_node; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ int ret; ++ unsigned int tdm_mask = 0x00; ++ u32 tdm_slots; ++ ++ /* ++ Add davinci-evm specific DAPM widgets ++ */ ++ snd_soc_dapm_new_controls(&card->dapm, ad193x_dapm_widgets, ++ ARRAY_SIZE(ad193x_dapm_widgets)); ++ ++ /* ++ Get audio routing from device tree or use built-in routing ++ */ ++ if (np) { ++ dev_dbg(card->dev, "Using configuration from dt overlay.\n"); ++ ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); ++ if (ret) ++ return ret; ++ ret = of_property_read_u32(np, "audiocard-tdm-slots", &tdm_slots); ++ if (tdm_slots > 8 || tdm_slots < 2 || ret){ ++ dev_dbg(card->dev, "Couldn't get device tree property for tdm slots. Using default (=2).\n"); ++ tdm_slots = 2; ++ tdm_mask = 0x03; // lsb for slot 0, ... ++ } else { ++ tdm_mask = 0xFF; ++ tdm_mask = tdm_mask >> (8 - tdm_slots); ++ } ++ } else { ++ dev_dbg(card->dev, "Use builtin audio routing.\n"); ++ /* Set up davinci specific audio path audio_map */ ++ snd_soc_dapm_add_routes(&card->dapm, audio_map, ++ ARRAY_SIZE(audio_map)); ++ } ++ ++ /* ++ Configure TDM mode of CPU and audio codec interface ++ (ad193x codec driver ignores TX / RX mask and width) ++ */ ++ ret = snd_soc_dai_set_tdm_slot(codec_dai, tdm_mask, tdm_mask, tdm_slots, 32); ++ if (ret < 0){ ++ dev_err(codec_dai->dev, "Unable to set AD193x TDM slots.\n"); ++ return ret; ++ } ++ ret = snd_soc_dai_set_tdm_slot(cpu_dai, tdm_mask, tdm_mask, tdm_slots, 32); ++ if (ret < 0){ ++ dev_err(codec_dai->dev, "Unable to set McASP TDM slots.\n"); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++/* ++ Set hw parameters ++*/ ++static int snd_davinci_audiocard_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ int ret = 0; ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_card *soc_card = rtd->card; ++ unsigned cpu_clock = ((struct snd_soc_card_drvdata_davinci *) ++ snd_soc_card_get_drvdata(soc_card))->sysclk; ++ unsigned codec_clock = ((struct snd_soc_card_drvdata_davinci *) ++ snd_soc_card_get_drvdata(soc_card))->codec_clock; ++ ++ /* ++ Set master clock of CPU and audio codec interface ++ (ad193x codec driver ignores clock ID and direction) ++ */ ++ ret = snd_soc_dai_set_sysclk(codec_dai, 0, codec_clock, SND_SOC_CLOCK_IN); ++ if (ret < 0){ ++ dev_err(codec->dev, "Unable to set AD193x system clock: %d.\n", ret); ++ return ret; ++ } ++ dev_dbg(cpu_dai->dev, "Set codec DAI clock rate to %d.\n", codec_clock); ++ ++ ret = snd_soc_dai_set_sysclk(cpu_dai, 0, cpu_clock, SND_SOC_CLOCK_OUT); ++ if (ret < 0){ ++ dev_err(cpu_dai->dev, "Unable to set cpu dai sysclk: %d.\n", ret); ++ return ret; ++ } ++ dev_dbg(cpu_dai->dev, "Set CPU DAI clock rate to %d.\n", cpu_clock); ++ ++ return 0; ++} ++ ++/* ++ Startup ++*/ ++static int snd_davinci_audiocard_startup(struct snd_pcm_substream *substream) { ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *soc_card = rtd->card; ++ struct snd_soc_card_drvdata_davinci *drvdata = snd_soc_card_get_drvdata(soc_card); ++ ++ if (drvdata->mclk) ++ return clk_prepare_enable(drvdata->mclk); ++ ++ return 0; ++} ++ ++/* ++ Shutdown ++*/ ++static void snd_davinci_audiocard_shutdown(struct snd_pcm_substream *substream) { ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *soc_card = rtd->card; ++ struct snd_soc_card_drvdata_davinci *drvdata = snd_soc_card_get_drvdata(soc_card); ++ ++ if (drvdata->mclk) ++ clk_disable_unprepare(drvdata->mclk); ++} ++ ++/* ++ Machine stream operations ++*/ ++static struct snd_soc_ops snd_davinci_audiocard_ops = { ++ .hw_params = snd_davinci_audiocard_hw_params, ++ .startup = snd_davinci_audiocard_startup, ++ .shutdown = snd_davinci_audiocard_shutdown, ++}; ++ ++/* ++ Interface setup ++ (rxclk and txclk are configured asynchronous in i2s mode (see mcasp platform driver)) ++*/ ++#define AUDIOCARD_AD193X_DAIFMT ( SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | SND_SOC_DAIFMT_CBM_CFM ) ++/* ++ Struct ist just a placeholder. Device tree will add cpu and codec nodes here ++*/ ++static struct snd_soc_dai_link snd_davinci_audiocard_dai = { ++ .name = "CTAG face-2-4", ++ .stream_name = "TDM", ++ .codec_dai_name ="ad193x-hifi", ++ .dai_fmt = AUDIOCARD_AD193X_DAIFMT, ++ .ops = &snd_davinci_audiocard_ops, ++ .init = snd_davinci_audiocard_init, ++}; ++ ++/* ++ Export device tree identifiers ++*/ ++static const struct of_device_id snd_davinci_audiocard_dt_ids[] = { ++ { ++ .compatible = "ctag,face-2-4", ++ .data = &snd_davinci_audiocard_dai, ++ }, ++ { /* sentinel */ } ++}; ++MODULE_DEVICE_TABLE(of, snd_davinci_audiocard_dt_ids); ++ ++/* ++ Audio machine driver ++*/ ++static struct snd_soc_card snd_davinci_audiocard = { ++ .owner = THIS_MODULE, ++ .num_links = 1, ++}; ++ ++/* ++ Sound card probe ++*/ ++static int snd_davinci_audiocard_probe(struct platform_device *pdev) ++{ ++ struct device_node *np = pdev->dev.of_node; ++ const struct of_device_id *match = ++ of_match_device(of_match_ptr(snd_davinci_audiocard_dt_ids), &pdev->dev); ++ struct snd_soc_dai_link *dai = (struct snd_soc_dai_link *) match->data; ++ struct snd_soc_card_drvdata_davinci *drvdata = NULL; ++ struct clk *mclk; ++ int ret = 0; ++ ++ snd_davinci_audiocard.dai_link = dai; ++ ++ /* ++ Parse device tree properties and nodes of Bone Cape for AD1938 AudioCard ++ */ ++ dai->codec_of_node = of_parse_phandle(np, "audio-codec", 0); ++ if (!dai->codec_of_node) ++ return -EINVAL; ++ ++ dai->cpu_of_node = of_parse_phandle(np, "mcasp-controller", 0); ++ if (!dai->cpu_of_node) ++ return -EINVAL; ++ ++ dai->platform_of_node = dai->cpu_of_node; ++ ++ snd_davinci_audiocard.dev = &pdev->dev; ++ ret = snd_soc_of_parse_card_name(&snd_davinci_audiocard, "model"); ++ if (ret) ++ return ret; ++ ++ mclk = devm_clk_get(&pdev->dev, "mclk"); ++ if (PTR_ERR(mclk) == -EPROBE_DEFER) { ++ return -EPROBE_DEFER; ++ } else if (IS_ERR(mclk)) { ++ dev_dbg(&pdev->dev, "mclk not found.\n"); ++ mclk = NULL; ++ } ++ ++ drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL); ++ if (!drvdata) ++ return -ENOMEM; ++ ++ drvdata->mclk = mclk; ++ ++ ret = of_property_read_u32(np, "codec-clock-rate", &drvdata->codec_clock); ++ if (ret < 0){ ++ dev_err(&pdev->dev, "No codec clock rate defined.\n"); ++ return -EINVAL; ++ } ++ ++ /* ++ Configure internal 24,576 MHz oscillator as master clock for McASP ++ */ ++ ret = of_property_read_u32(np, "cpu-clock-rate", &drvdata->sysclk); ++ if (ret < 0) { ++ if (!drvdata->mclk) { ++ dev_err(&pdev->dev, ++ "No clock or clock rate defined.\n"); ++ return -EINVAL; ++ } ++ drvdata->sysclk = clk_get_rate(drvdata->mclk); ++ } else if (drvdata->mclk) { ++ unsigned int requestd_rate = drvdata->sysclk; ++ clk_set_rate(drvdata->mclk, drvdata->sysclk); ++ drvdata->sysclk = clk_get_rate(drvdata->mclk); ++ if (drvdata->sysclk != requestd_rate) ++ dev_warn(&pdev->dev, ++ "Could not get requested rate %u using %u.\n", ++ requestd_rate, drvdata->sysclk); ++ } ++ ++ /* ++ Register AD1938 AudioCard ++ */ ++ snd_soc_card_set_drvdata(&snd_davinci_audiocard, drvdata); ++ ret = devm_snd_soc_register_card(&pdev->dev, &snd_davinci_audiocard); ++ if (ret) ++ dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); ++ ++ return ret; ++} ++ ++/* Sound card disconnect */ ++static int snd_davinci_audiocard_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_davinci_audiocard); ++} ++ ++/* Sound card platform driver */ ++static struct platform_driver snd_davinci_audiocard_driver = { ++ .probe = snd_davinci_audiocard_probe, ++ .driver = { ++ .name = "snd_ctag_face_2_4", ++ .pm = &snd_soc_pm_ops, ++ .of_match_table = of_match_ptr(snd_davinci_audiocard_dt_ids), ++ }, ++ .remove = snd_davinci_audiocard_remove, ++}; ++ ++module_platform_driver(snd_davinci_audiocard_driver); ++ ++/* Module information */ ++MODULE_AUTHOR("Henrik Langer"); ++MODULE_DESCRIPTION("ALSA SoC AD193X AudioCard driver"); ++MODULE_LICENSE("GPL"); +-- +2.7.0 + diff --git a/patches/beaglebone/CTAG/0002-Added-support-for-higher-sampling-rates-in-AD193X-dr.patch b/patches/beaglebone/CTAG/0002-Added-support-for-higher-sampling-rates-in-AD193X-dr.patch new file mode 100644 index 0000000000000000000000000000000000000000..e383c276015ab1638cba8f280ac23cc410a3d933 --- /dev/null +++ b/patches/beaglebone/CTAG/0002-Added-support-for-higher-sampling-rates-in-AD193X-dr.patch @@ -0,0 +1,156 @@ +From af90dc62f67a4450f170f6959a0831f939913b4d Mon Sep 17 00:00:00 2001 +From: Henrik Langer <henni19790@googlemail.com> +Date: Sat, 27 Feb 2016 19:27:36 +0100 +Subject: [PATCH 2/6] Added support for higher sampling rates in AD193X driver. + Added Device Tree IDs for AD193X SPI + +--- + sound/soc/codecs/ad193x-spi.c | 16 ++++++++++++ + sound/soc/codecs/ad193x.c | 61 +++++++++++++++++++++++++++++++------------ + 2 files changed, 60 insertions(+), 17 deletions(-) + +diff --git a/sound/soc/codecs/ad193x-spi.c b/sound/soc/codecs/ad193x-spi.c +index 390cef9..f60d09c 100644 +--- a/sound/soc/codecs/ad193x-spi.c ++++ b/sound/soc/codecs/ad193x-spi.c +@@ -33,13 +33,29 @@ static int ad193x_spi_remove(struct spi_device *spi) + return 0; + } + ++static const struct spi_device_id ad193x_spi_id[] = { ++ { "ad1938", }, ++ { "ad1939", }, ++ { }, ++}; ++MODULE_DEVICE_TABLE(spi, ad193x_spi_id); ++ ++static const struct of_device_id ad193x_of_match[] = { ++ { .compatible = "analog,ad1938", }, ++ { .compatible = "analog,ad1939", }, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, ad193x_of_match); ++ + static struct spi_driver ad193x_spi_driver = { + .driver = { + .name = "ad193x", + .owner = THIS_MODULE, ++ .of_match_table = ad193x_of_match, + }, + .probe = ad193x_spi_probe, + .remove = ad193x_spi_remove, ++ .id_table = ad193x_spi_id + }; + module_spi_driver(ad193x_spi_driver); + +diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c +index 17c9535..7fbadc4 100644 +--- a/sound/soc/codecs/ad193x.c ++++ b/sound/soc/codecs/ad193x.c +@@ -247,7 +247,7 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params, + struct snd_soc_dai *dai) + { +- int word_len = 0, master_rate = 0; ++ int word_len = 0, master_rate = 0, sample_rate = 0; + struct snd_soc_codec *codec = dai->codec; + struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec); + +@@ -265,6 +265,22 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream, + break; + } + ++ /* sample rate */ ++ switch(params_rate(params)){ ++ case 48000: ++ sample_rate = 0; ++ break; ++ case 96000: ++ sample_rate = 1; ++ break; ++ case 192000: ++ sample_rate = 2; ++ break; ++ default: ++ sample_rate = 0; //48 kHz ++ break; ++ } ++ + switch (ad193x->sysclk) { + case 12288000: + master_rate = AD193X_PLL_INPUT_256; +@@ -280,6 +296,12 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream, + break; + } + ++ regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL0, ++ 0x06, sample_rate << 1); ++ ++ regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL0, ++ 0xC0, sample_rate << 6); ++ + regmap_update_bits(ad193x->regmap, AD193X_PLL_CLK_CTRL0, + AD193X_PLL_INPUT_MASK, master_rate); + +@@ -308,7 +330,7 @@ static struct snd_soc_dai_driver ad193x_dai = { + .stream_name = "Playback", + .channels_min = 2, + .channels_max = 8, +- .rates = SNDRV_PCM_RATE_48000, ++ .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000, + .formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE, + }, +@@ -316,7 +338,7 @@ static struct snd_soc_dai_driver ad193x_dai = { + .stream_name = "Capture", + .channels_min = 2, + .channels_max = 4, +- .rates = SNDRV_PCM_RATE_48000, ++ .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000, + .formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE, + }, +@@ -327,21 +349,26 @@ static int ad193x_codec_probe(struct snd_soc_codec *codec) + { + struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec); + +- /* default setting for ad193x */ +- +- /* unmute dac channels */ +- regmap_write(ad193x->regmap, AD193X_DAC_CHNL_MUTE, 0x0); +- /* de-emphasis: 48kHz, powedown dac */ ++ /* modified settings for ad193x */ ++ ++ // pll input 256: mclki/xi, xtal oscillator enabled ++ regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL0, 0x80); ++ // adc / dac clock source: mclk ++ regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL1, 0x00); ++ // dac in tdm mode, sdata delay: 1, 48kHz sample rate ++ regmap_write(ad193x->regmap, AD193X_DAC_CTRL0, AD193X_DAC_SERFMT_TDM); ++ // DAC bclk and lcr slave, 256 bclk per frame ++ regmap_write(ad193x->regmap, AD193X_DAC_CTRL1, 0x04); ++ // word width: 16, de-emphasis: 48kHz, powedown dac + regmap_write(ad193x->regmap, AD193X_DAC_CTRL2, 0x1A); +- /* dac in tdm mode */ +- regmap_write(ad193x->regmap, AD193X_DAC_CTRL0, 0x40); +- /* high-pass filter enable */ +- regmap_write(ad193x->regmap, AD193X_ADC_CTRL0, 0x3); +- /* sata delay=1, adc aux mode */ +- regmap_write(ad193x->regmap, AD193X_ADC_CTRL1, 0x43); +- /* pll input: mclki/xi */ +- regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL0, 0x99); /* mclk=24.576Mhz: 0x9D; mclk=12.288Mhz: 0x99 */ +- regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL1, 0x04); ++ // unmute dac channels ++ regmap_write(ad193x->regmap, AD193X_DAC_CHNL_MUTE, 0x0); ++ // high-pass filter enable ++ regmap_write(ad193x->regmap, AD193X_ADC_CTRL0, 0x02); ++ // sdata delay=1, adc tdm mode, word width: 16 ++ regmap_write(ad193x->regmap, AD193X_ADC_CTRL1, AD193X_ADC_SERFMT_TDM | 0x03); ++ // 256 bclks per frame ++ regmap_write(ad193x->regmap, AD193X_ADC_CTRL2, 0x20); //0x02 + + return 0; + } +-- +2.7.0 + diff --git a/patches/beaglebone/CTAG/0003-Added-support-for-AD193X-and-CTAG-face2-4-Audio-Card.patch b/patches/beaglebone/CTAG/0003-Added-support-for-AD193X-and-CTAG-face2-4-Audio-Card.patch new file mode 100644 index 0000000000000000000000000000000000000000..c147c0b3176850572ebbb687f7a24b0ca77a85f6 --- /dev/null +++ b/patches/beaglebone/CTAG/0003-Added-support-for-AD193X-and-CTAG-face2-4-Audio-Card.patch @@ -0,0 +1,70 @@ +From 2ce3323aed1868b1145c686ee6d69b1d18f69e0a Mon Sep 17 00:00:00 2001 +From: Henrik Langer <henni19790@googlemail.com> +Date: Sat, 27 Feb 2016 19:32:39 +0100 +Subject: [PATCH 3/6] Added support for AD193X and CTAG face2|4 Audio Card in + configuration files + +--- + sound/soc/codecs/Kconfig | 8 ++++++-- + sound/soc/davinci/Kconfig | 6 ++++++ + sound/soc/davinci/Makefile | 2 ++ + 3 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig +index 061c465..578fe8d 100644 +--- a/sound/soc/codecs/Kconfig ++++ b/sound/soc/codecs/Kconfig +@@ -221,12 +221,16 @@ config SND_SOC_AD193X + tristate + + config SND_SOC_AD193X_SPI +- tristate ++ tristate "Analog Devices AD193x CODEC (SPI)" ++ depends on SPI_MASTER + select SND_SOC_AD193X ++ select REGMAP_SPI + + config SND_SOC_AD193X_I2C +- tristate ++ tristate "Analog Devices AD193x CODEC (I2C)" ++ depends on I2C + select SND_SOC_AD193X ++ select REGMAP_I2C + + config SND_SOC_AD1980 + select REGMAP_AC97 +diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig +index 50ca291..8e60456 100644 +--- a/sound/soc/davinci/Kconfig ++++ b/sound/soc/davinci/Kconfig +@@ -100,3 +100,9 @@ config SND_DA850_SOC_EVM + Say Y if you want to add support for SoC audio on TI + DA850/OMAP-L138 EVM + ++config SND_DAVINCI_SOC_CTAG_FACE_2_4 ++ tristate "SoC Audio Support for CTAG face-2-4 (AD1938)" ++ depends on SND_DAVINCI_SOC_MCASP ++ select SND_SOC_AD193X_SPI ++ help ++ Say Y if you want to add support for SoC audio on CTAG face-2-4. +diff --git a/sound/soc/davinci/Makefile b/sound/soc/davinci/Makefile +index f883933..75e218e 100644 +--- a/sound/soc/davinci/Makefile ++++ b/sound/soc/davinci/Makefile +@@ -3,11 +3,13 @@ snd-soc-edma-objs := edma-pcm.o + snd-soc-davinci-i2s-objs := davinci-i2s.o + snd-soc-davinci-mcasp-objs:= davinci-mcasp.o + snd-soc-davinci-vcif-objs:= davinci-vcif.o ++snd-soc-davinci-ctag-face-2-4-objs := davinci-ctag-face-2-4.o + + obj-$(CONFIG_SND_EDMA_SOC) += snd-soc-edma.o + obj-$(CONFIG_SND_DAVINCI_SOC_I2S) += snd-soc-davinci-i2s.o + obj-$(CONFIG_SND_DAVINCI_SOC_MCASP) += snd-soc-davinci-mcasp.o + obj-$(CONFIG_SND_DAVINCI_SOC_VCIF) += snd-soc-davinci-vcif.o ++obj-$(CONFIG_SND_DAVINCI_SOC_CTAG_FACE_2_4) += snd-soc-davinci-ctag-face-2-4.o + + # Generic DAVINCI/AM33xx Machine Support + snd-soc-evm-objs := davinci-evm.o +-- +2.7.0 + diff --git a/patches/beaglebone/CTAG/0004-Modified-ASOC-platform-driver-for-McASP-to-use-async.patch b/patches/beaglebone/CTAG/0004-Modified-ASOC-platform-driver-for-McASP-to-use-async.patch new file mode 100644 index 0000000000000000000000000000000000000000..94cb85439fd9861b0d1b819b8f7a7b921596ce7b --- /dev/null +++ b/patches/beaglebone/CTAG/0004-Modified-ASOC-platform-driver-for-McASP-to-use-async.patch @@ -0,0 +1,26 @@ +From 1ad4f0c08aaa2a3cd232b09de91695f4a13eed07 Mon Sep 17 00:00:00 2001 +From: Henrik Langer <henni19790@googlemail.com> +Date: Sat, 27 Feb 2016 19:34:41 +0100 +Subject: [PATCH 4/6] Modified ASOC platform driver for McASP to use + asynchronous sampling rates in i2s mode. + +--- + sound/soc/davinci/davinci-mcasp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c +index 2bec747..eb1c948 100644 +--- a/sound/soc/davinci/davinci-mcasp.c ++++ b/sound/soc/davinci/davinci-mcasp.c +@@ -918,7 +918,7 @@ static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream, + for (i = 0; i < active_slots; i++) + mask |= (1 << i); + } +- mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC); ++ mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC); + + if (!mcasp->dat_port) + busel = TXSEL; +-- +2.7.0 + diff --git a/patches/beaglebone/CTAG/0005-Changed-descriptions-in-files-belonging-to-CTAG-face.patch b/patches/beaglebone/CTAG/0005-Changed-descriptions-in-files-belonging-to-CTAG-face.patch new file mode 100644 index 0000000000000000000000000000000000000000..9c5a5894cdf53810074641137f93839c1f9b8c3f --- /dev/null +++ b/patches/beaglebone/CTAG/0005-Changed-descriptions-in-files-belonging-to-CTAG-face.patch @@ -0,0 +1,56 @@ +From 260b6c072428f4fe5dd9bee3409cbdc0e3cdc47c Mon Sep 17 00:00:00 2001 +From: Henrik Langer <henni19790@googlemail.com> +Date: Sat, 27 Feb 2016 19:40:38 +0100 +Subject: [PATCH 5/6] Changed descriptions in files belonging to CTAG face2|4 + Audio Card + +--- + arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts | 4 ++-- + sound/soc/davinci/Kconfig | 2 +- + sound/soc/davinci/davinci-ctag-face-2-4.c | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts b/arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts +index aa4bbf1..ae06b45 100644 +--- a/arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts ++++ b/arch/arm/boot/dts/am335x-bonegreen-ctag-face.dts +@@ -1,7 +1,7 @@ + /* +- * Base device tree of BeagleBone Green with AD1938 AudioCard ++ * Base device tree for BeagleBone Green with CTAG face2|4 Audio Card + * +- * Author: Henrik Langer <henrik.langer@student.fh-kiel.de> ++ * Author: Henrik Langer <henni19790@googlemail.com> + * based on + BeagleBone Black and BeagleBone Green device tree + * +diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig +index 8e60456..ba4ea9d 100644 +--- a/sound/soc/davinci/Kconfig ++++ b/sound/soc/davinci/Kconfig +@@ -101,7 +101,7 @@ config SND_DA850_SOC_EVM + DA850/OMAP-L138 EVM + + config SND_DAVINCI_SOC_CTAG_FACE_2_4 +- tristate "SoC Audio Support for CTAG face-2-4 (AD1938)" ++ tristate "SoC Audio Support for CTAG face-2-4 Audio Card (AD1938)" + depends on SND_DAVINCI_SOC_MCASP + select SND_SOC_AD193X_SPI + help +diff --git a/sound/soc/davinci/davinci-ctag-face-2-4.c b/sound/soc/davinci/davinci-ctag-face-2-4.c +index 2551774..b55977c 100644 +--- a/sound/soc/davinci/davinci-ctag-face-2-4.c ++++ b/sound/soc/davinci/davinci-ctag-face-2-4.c +@@ -1,7 +1,7 @@ + /* +- * ASoC machine driver for Davinci platform (BBG) and ad1938 audio codec. ++ * ASoC machine driver for CTAG face2|4 Audio Card + * +- * Author: Henrik Langer <henrik.langer@student.fh-kiel.de> ++ * Author: Henrik Langer <henni19790@googlemail.com> + * based on + * ASoC driver for TI DAVINCI EVM platform by + * Vladimir Barinov <vbarinov@embeddedalley.com> +-- +2.7.0 + diff --git a/patches/beaglebone/CTAG/0006-add-black-version-of-ctag-face-pass-uboot-cape-ctag-.patch b/patches/beaglebone/CTAG/0006-add-black-version-of-ctag-face-pass-uboot-cape-ctag-.patch new file mode 100644 index 0000000000000000000000000000000000000000..7a4979d35123579988ce1ccb0ffa3f4eb27aa1b1 --- /dev/null +++ b/patches/beaglebone/CTAG/0006-add-black-version-of-ctag-face-pass-uboot-cape-ctag-.patch @@ -0,0 +1,120 @@ +From 78f603cb0c2d5c0cb147e3eec60898b8359275d2 Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Thu, 3 Mar 2016 09:39:29 -0600 +Subject: [PATCH 6/6] add: black version of ctag-face, (pass uboot: + cape=ctag-face) + +Signed-off-by: Robert Nelson <robertcnelson@gmail.com> +--- + arch/arm/boot/dts/am335x-boneblack-ctag-face.dts | 99 ++++++++++++++++++++++++ + 1 file changed, 99 insertions(+) + create mode 100644 arch/arm/boot/dts/am335x-boneblack-ctag-face.dts + +diff --git a/arch/arm/boot/dts/am335x-boneblack-ctag-face.dts b/arch/arm/boot/dts/am335x-boneblack-ctag-face.dts +new file mode 100644 +index 0000000..88510e4 +--- /dev/null ++++ b/arch/arm/boot/dts/am335x-boneblack-ctag-face.dts +@@ -0,0 +1,99 @@ ++/* ++ * Base device tree for BeagleBone Green with CTAG face2|4 Audio Card ++ * ++ * Author: Henrik Langer <henni19790@googlemail.com> ++ * based on ++ BeagleBone Black and BeagleBone Green device tree ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++/dts-v1/; ++ ++#include "am33xx.dtsi" ++#include "am335x-bone-common.dtsi" ++ ++/ { ++ model = "TI AM335x BeagleBone Black AudioCard"; ++ compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; ++}; ++ ++&ldo3_reg { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++}; ++ ++&mmc1 { ++ vmmc-supply = <&vmmcsd_fixed>; ++}; ++ ++&mmc2 { ++ vmmc-supply = <&vmmcsd_fixed>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emmc_pins>; ++ bus-width = <8>; ++ status = "okay"; ++}; ++ ++&sgx { ++ status = "okay"; ++}; ++ ++&am33xx_pinmux { ++ mcasp0_pins: mcasp0_pins { ++ pinctrl-single,pins = < ++ 0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_ahclkx */ ++ 0x19c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_axr2 */ ++ 0x194 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_fsx */ ++ 0x190 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx */ ++ 0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_fsr */ ++ 0x078 (PIN_INPUT_PULLDOWN | MUX_MODE6) /* mcasp0_aclkr */ ++ 0x198 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_axr0 */ ++ 0x06c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpio1[27] (enable oscillator) */ ++ >; ++ }; ++ ++ mcasp0_pins_sleep: mcasp0_pins_sleep { ++ pinctrl-single,pins = < ++ 0x1ac (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_ahclkx */ ++ 0x19c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_axr2 */ ++ 0x194 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_fsx */ ++ 0x190 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_aclkx */ ++ 0x1a4 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp0_fsr */ ++ 0x078 (PIN_INPUT_PULLDOWN | MUX_MODE6) /* mcasp0_aclkr */ ++ 0x198 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_axr0 */ ++ 0x06c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpio1[27] */ ++ >; ++ }; ++}; ++ ++&mcasp0 { ++ pinctrl-names = "default", "sleep"; ++ pinctrl-0 = <&mcasp0_pins>; ++ pinctrl-1 = <&mcasp0_pins_sleep>; ++ status = "okay"; ++ op-mode = <0>; /* MCASP_IIS_MODE */ ++ tdm-slots = <2>; ++ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ ++ 2 0 1 0 ++ >; ++ tx-num-evt = <1>; ++ rx-num-evt = <1>; ++}; ++ ++/ { ++ clk_mcasp0_fixed: clk_mcasp0_fixed { ++ #clock-cells = <0>; ++ compatible = "fixed-clock"; ++ clock-frequency = <24576000>; ++ }; ++ ++ clk_mcasp0: clk_mcasp0 { ++ #clock-cells = <0>; ++ compatible = "gpio-gate-clock"; ++ clocks = <&clk_mcasp0_fixed>; ++ enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */ ++ }; ++}; +-- +2.7.0 + diff --git a/patches/beaglebone/abbbi/0001-gpu-drm-i2c-add-alternative-adv7511-driver-with-audi.patch b/patches/beaglebone/abbbi/0001-gpu-drm-i2c-add-alternative-adv7511-driver-with-audi.patch index 8106c563492841a6e5fabd7ce941abd0cd9c0364..30453c5cf9981b1c86494529b5a2d96d5bf54c92 100644 --- a/patches/beaglebone/abbbi/0001-gpu-drm-i2c-add-alternative-adv7511-driver-with-audi.patch +++ b/patches/beaglebone/abbbi/0001-gpu-drm-i2c-add-alternative-adv7511-driver-with-audi.patch @@ -1,4 +1,4 @@ -From 7cedc08184396d2e466534a118f08f762a72126e Mon Sep 17 00:00:00 2001 +From d0a8974579747b7df2578e7d0065460b401caa38 Mon Sep 17 00:00:00 2001 From: Jason Kridner <jdk@ti.com> Date: Thu, 10 Sep 2015 23:39:40 +0000 Subject: [PATCH 1/5] gpu: drm: i2c: add alternative adv7511 driver with audio @@ -1437,5 +1437,5 @@ index 0000000..8ffef6c +MODULE_DESCRIPTION("ADIHDMI HDMI transmitter driver"); +MODULE_LICENSE("GPL"); -- -2.7.0.rc3 +2.8.0.rc3 diff --git a/patches/beaglebone/abbbi/0002-gpu-drm-i2c-adihdmi-componentize-driver-and-huge-ref.patch b/patches/beaglebone/abbbi/0002-gpu-drm-i2c-adihdmi-componentize-driver-and-huge-ref.patch index 8a93427ee19f729acdf42b700a0f6adc331afe00..726d34b290a32dafa16a03f2b9e1c88c2c508bda 100644 --- a/patches/beaglebone/abbbi/0002-gpu-drm-i2c-adihdmi-componentize-driver-and-huge-ref.patch +++ b/patches/beaglebone/abbbi/0002-gpu-drm-i2c-adihdmi-componentize-driver-and-huge-ref.patch @@ -1,4 +1,4 @@ -From 130743e86aa5c33440a5dae8c4bed6568faed54d Mon Sep 17 00:00:00 2001 +From 7d0feaf770e78e2179f1dd152bc9f714ccb0ea16 Mon Sep 17 00:00:00 2001 From: Matt Porter <mporter@konsulko.com> Date: Fri, 6 Nov 2015 09:00:09 -0500 Subject: [PATCH 2/5] gpu: drm: i2c: adihdmi: componentize driver and huge @@ -2123,5 +2123,5 @@ index 8ffef6c..907bdf9 100644 module_exit(adihdmi_exit); -- -2.7.0.rc3 +2.8.0.rc3 diff --git a/patches/beaglebone/abbbi/0005-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch b/patches/beaglebone/abbbi/0003-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch similarity index 97% rename from patches/beaglebone/abbbi/0005-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch rename to patches/beaglebone/abbbi/0003-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch index ea482767c16996204173a387b09f8a73d537bc7f..c05ce2719ad643b82d510868bd1f64fe42cca39c 100644 --- a/patches/beaglebone/abbbi/0005-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch +++ b/patches/beaglebone/abbbi/0003-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch @@ -1,7 +1,7 @@ -From f6ca1227979fe75e91d45ff3b55f98ac94af8450 Mon Sep 17 00:00:00 2001 +From 6552929440f2b2578d7359152796166996284324 Mon Sep 17 00:00:00 2001 From: Matt Porter <mporter@konsulko.com> Date: Tue, 3 Nov 2015 15:37:54 -0500 -Subject: [PATCH 5/5] ARM: dts: add Arrow BeagleBone Black Industrial dts +Subject: [PATCH 3/5] ARM: dts: add Arrow BeagleBone Black Industrial dts Adds a dts file for the Arrow BeagleBone Black Industrial board. This BBB variant differs in that it uses an industrial temp rated @@ -184,5 +184,5 @@ index 0000000..cc9b1f4 + system-power-controller; +}; -- -2.7.0.rc3 +2.8.0.rc3 diff --git a/patches/beaglebone/abbbi/0003-drm-adihdmi-Drop-dummy-save-restore-hooks.patch b/patches/beaglebone/abbbi/0004-drm-adihdmi-Drop-dummy-save-restore-hooks.patch similarity index 92% rename from patches/beaglebone/abbbi/0003-drm-adihdmi-Drop-dummy-save-restore-hooks.patch rename to patches/beaglebone/abbbi/0004-drm-adihdmi-Drop-dummy-save-restore-hooks.patch index 35c0f1769916f63ca20bddf2c73a37c4419c56d3..e734293f45107253357e60cac4ce5c0d2b49a565 100644 --- a/patches/beaglebone/abbbi/0003-drm-adihdmi-Drop-dummy-save-restore-hooks.patch +++ b/patches/beaglebone/abbbi/0004-drm-adihdmi-Drop-dummy-save-restore-hooks.patch @@ -1,7 +1,7 @@ -From 1efd5dfd6e3d930a49cefdd06ab551cc1a9f81b9 Mon Sep 17 00:00:00 2001 +From 3cbf130a3a6cd479ae00e6996d971402e22106f8 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Tue, 26 Jan 2016 10:39:31 -0600 -Subject: [PATCH 3/5] drm/adihdmi: Drop dummy save/restore hooks +Subject: [PATCH 4/5] drm/adihdmi: Drop dummy save/restore hooks Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -48,5 +48,5 @@ index 907bdf9..dd25f7d 100644 .set_property = adihdmi_encoder_set_property, }; -- -2.7.0.rc3 +2.8.0.rc3 diff --git a/patches/beaglebone/abbbi/0004-drm-adihdmi-Pass-name-to-drm_encoder_init.patch b/patches/beaglebone/abbbi/0005-drm-adihdmi-Pass-name-to-drm_encoder_init.patch similarity index 85% rename from patches/beaglebone/abbbi/0004-drm-adihdmi-Pass-name-to-drm_encoder_init.patch rename to patches/beaglebone/abbbi/0005-drm-adihdmi-Pass-name-to-drm_encoder_init.patch index 5fa60d6423025d75102e72b7d5fb312d1ff45262..d9c707799a5697ffc29211429ec986500d331167 100644 --- a/patches/beaglebone/abbbi/0004-drm-adihdmi-Pass-name-to-drm_encoder_init.patch +++ b/patches/beaglebone/abbbi/0005-drm-adihdmi-Pass-name-to-drm_encoder_init.patch @@ -1,7 +1,7 @@ -From d4fcbece96edc567cd1e6b23400350a3638752d1 Mon Sep 17 00:00:00 2001 +From f6d8de96b48881da9766ee7b34fb7e69c420d3c2 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Tue, 26 Jan 2016 10:44:46 -0600 -Subject: [PATCH 4/5] drm/adihdmi: Pass 'name' to drm_encoder_init() +Subject: [PATCH 5/5] drm/adihdmi: Pass 'name' to drm_encoder_init() Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -22,5 +22,5 @@ index dd25f7d..3d38626 100644 goto err_encoder; -- -2.7.0.rc3 +2.8.0.rc3 diff --git a/patches/beaglebone/abbbi/0006-adihdmi_drv-reg_default-reg_sequence.patch b/patches/beaglebone/abbbi/0006-adihdmi_drv-reg_default-reg_sequence.patch index e41ff77e56543d601e0b27598b9b0fb61fc8f99d..5769859e9b8d444a19017b25995ea881a30872ce 100644 --- a/patches/beaglebone/abbbi/0006-adihdmi_drv-reg_default-reg_sequence.patch +++ b/patches/beaglebone/abbbi/0006-adihdmi_drv-reg_default-reg_sequence.patch @@ -1,4 +1,4 @@ -From 9925712e7c37b5e557dd01d8a30446d777d84d60 Mon Sep 17 00:00:00 2001 +From 176e4ccdd6d9e1be62d7400c49c4203d195bb788 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Mon, 28 Mar 2016 09:16:04 -0500 Subject: [PATCH 6/6] adihdmi_drv: reg_default -> reg_sequence diff --git a/patches/beaglebone/capes/0005-bb-audio-cape.patch b/patches/beaglebone/capes/0005-bb-audio-cape.patch new file mode 100644 index 0000000000000000000000000000000000000000..07c42534bda7649df1bf5980b905d710ba9906eb --- /dev/null +++ b/patches/beaglebone/capes/0005-bb-audio-cape.patch @@ -0,0 +1,59 @@ +From 533c4e4b6674211c5365dd0cd2ad869d60b639bd Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Wed, 9 Mar 2016 14:11:17 -0600 +Subject: [PATCH 5/5] bb: audio cape + +Signed-off-by: Robert Nelson <robertcnelson@gmail.com> +--- + arch/arm/boot/dts/am335x-boneblack-audio.dts | 39 ++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + create mode 100644 arch/arm/boot/dts/am335x-boneblack-audio.dts + +diff --git a/arch/arm/boot/dts/am335x-boneblack-audio.dts b/arch/arm/boot/dts/am335x-boneblack-audio.dts +new file mode 100644 +index 0000000..cac3626 +--- /dev/null ++++ b/arch/arm/boot/dts/am335x-boneblack-audio.dts +@@ -0,0 +1,39 @@ ++/* ++ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++/dts-v1/; ++ ++#include "am33xx.dtsi" ++#include "am335x-bone-common.dtsi" ++ ++/ { ++ model = "TI AM335x BeagleBone Black"; ++ compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; ++ ++ clk_mcasp0_fixed: clk_mcasp0_fixed { ++ #clock-cells = <0>; ++ compatible = "fixed-clock"; ++ clock-frequency = <24576000>; ++ }; ++ ++ clk_mcasp0: clk_mcasp0 { ++ #clock-cells = <0>; ++ compatible = "gpio-gate-clock"; ++ clocks = <&clk_mcasp0_fixed>; ++ enable-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>; /* BeagleBone Black Clk enable on GPIO1_27 */ ++ }; ++}; ++ ++&ldo3_reg { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++}; ++ ++&mmc1 { ++ vmmc-supply = <&vmmcsd_fixed>; ++}; +-- +2.7.0 + diff --git a/patches/beaglebone/dtbs/0001-sync-am335x-peripheral-pinmux.patch b/patches/beaglebone/dtbs/0001-sync-am335x-peripheral-pinmux.patch index f8ea56fa38fa791b58889db915bf5d7dba9e57cd..0586879d6cc13624b4d672a4502f6b66866f4060 100644 --- a/patches/beaglebone/dtbs/0001-sync-am335x-peripheral-pinmux.patch +++ b/patches/beaglebone/dtbs/0001-sync-am335x-peripheral-pinmux.patch @@ -1,10 +1,14 @@ -From 90214addc224f34968377f6579acc9351a20d023 Mon Sep 17 00:00:00 2001 +From b077a58b83f3564fcecd97872ed8fd5c527db368 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> -Date: Fri, 22 Jan 2016 11:53:31 -0600 +Date: Fri, 8 Apr 2016 18:18:07 -0500 Subject: [PATCH] sync: am335x-peripheral/pinmux Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- + arch/arm/boot/dts/am335x-abbbi.dts | 19 ++-- + arch/arm/boot/dts/am335x-arduino-tre.dts | 1 + + .../boot/dts/am335x-bone-common-no-capemgr.dtsi | 10 +- + arch/arm/boot/dts/am335x-bone-common.dtsi | 6 +- arch/arm/boot/dts/am335x-bone-emmc-in-reset.dtsi | 18 ++++ arch/arm/boot/dts/am335x-bone-pinmux-can1.dtsi | 45 ++++++++ arch/arm/boot/dts/am335x-bone-pinmux-emmc.dtsi | 88 +++++++++++++++ @@ -14,6 +18,20 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> arch/arm/boot/dts/am335x-bone-pinmux-spi1.dtsi | 27 +++++ arch/arm/boot/dts/am335x-bone-pinmux-spi1a.dtsi | 28 +++++ arch/arm/boot/dts/am335x-bone-pinmux-ttyS5.dtsi | 48 +++++++++ + arch/arm/boot/dts/am335x-boneblack-audio.dts | 15 +-- + arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts | 5 +- + arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts | 5 +- + arch/arm/boot/dts/am335x-boneblack-bbbmini.dts | 5 +- + .../boot/dts/am335x-boneblack-cape-bone-argus.dts | 5 +- + .../arm/boot/dts/am335x-boneblack-emmc-overlay.dts | 5 +- + .../arm/boot/dts/am335x-boneblack-hdmi-overlay.dts | 5 +- + .../boot/dts/am335x-boneblack-nhdmi-overlay.dts | 5 +- + arch/arm/boot/dts/am335x-boneblack-overlay.dts | 5 +- + arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts | 5 +- + arch/arm/boot/dts/am335x-boneblack.dts | 6 +- + arch/arm/boot/dts/am335x-bonegreen-overlay.dts | 5 +- + arch/arm/boot/dts/am335x-bonegreen-wireless.dts | 1 + + arch/arm/boot/dts/am335x-bonegreen.dts | 20 +--- arch/arm/boot/dts/am335x-cape-rtc-ds1307.dtsi | 31 ++++++ arch/arm/boot/dts/am335x-peripheral-can1.dtsi | 13 +++ arch/arm/boot/dts/am335x-peripheral-emmc.dtsi | 15 +++ @@ -23,7 +41,9 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> arch/arm/boot/dts/am335x-peripheral-spi1.dtsi | 13 +++ arch/arm/boot/dts/am335x-peripheral-spi1a.dtsi | 13 +++ arch/arm/boot/dts/am335x-peripheral-ttyS5.dtsi | 13 +++ - 18 files changed, 623 insertions(+) + arch/arm/boot/dts/am335x-sancloud-bbe.dts | 5 +- + arch/arm/boot/dts/am33xx-es2.dtsi | 34 ++++++ + 38 files changed, 697 insertions(+), 93 deletions(-) create mode 100644 arch/arm/boot/dts/am335x-bone-emmc-in-reset.dtsi create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-can1.dtsi create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-emmc.dtsi @@ -42,7 +62,113 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> create mode 100644 arch/arm/boot/dts/am335x-peripheral-spi1.dtsi create mode 100644 arch/arm/boot/dts/am335x-peripheral-spi1a.dtsi create mode 100644 arch/arm/boot/dts/am335x-peripheral-ttyS5.dtsi + create mode 100644 arch/arm/boot/dts/am33xx-es2.dtsi +diff --git a/arch/arm/boot/dts/am335x-abbbi.dts b/arch/arm/boot/dts/am335x-abbbi.dts +index cc9b1f4..5fa9349 100644 +--- a/arch/arm/boot/dts/am335x-abbbi.dts ++++ b/arch/arm/boot/dts/am335x-abbbi.dts +@@ -9,6 +9,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + #include "am33xx-overlay-edma-fix.dtsi" + +@@ -129,21 +130,21 @@ + + / { + clk_mcasp0_fixed: clk_mcasp0_fixed { +- #clock-cells = <0>; +- compatible = "fixed-clock"; +- clock-frequency = <24576000>; ++ #clock-cells = <0>; ++ compatible = "fixed-clock"; ++ clock-frequency = <24576000>; + }; + + clk_mcasp0: clk_mcasp0 { +- #clock-cells = <0>; +- compatible = "gpio-gate-clock"; +- clocks = <&clk_mcasp0_fixed>; +- enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */ ++ #clock-cells = <0>; ++ compatible = "gpio-gate-clock"; ++ clocks = <&clk_mcasp0_fixed>; ++ enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */ + }; + + hdmi_audio: hdmi_audio@0 { +- compatible = "linux,hdmi-audio"; +- status = "okay"; ++ compatible = "linux,hdmi-audio"; ++ status = "okay"; + }; + + sound { +diff --git a/arch/arm/boot/dts/am335x-arduino-tre.dts b/arch/arm/boot/dts/am335x-arduino-tre.dts +index 9e27df0..0e6b364 100644 +--- a/arch/arm/boot/dts/am335x-arduino-tre.dts ++++ b/arch/arm/boot/dts/am335x-arduino-tre.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + + / { + model = "TI AM335x Arduino Tre"; +diff --git a/arch/arm/boot/dts/am335x-bone-common-no-capemgr.dtsi b/arch/arm/boot/dts/am335x-bone-common-no-capemgr.dtsi +index 1f272a1..fa5311f 100644 +--- a/arch/arm/boot/dts/am335x-bone-common-no-capemgr.dtsi ++++ b/arch/arm/boot/dts/am335x-bone-common-no-capemgr.dtsi +@@ -308,15 +308,11 @@ + phy-mode = "mii"; + }; + +-&cpsw_emac1 { +- phy_id = <&davinci_mdio>, <1>; +- phy-mode = "mii"; +-}; +- + &mac { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&cpsw_default>; + pinctrl-1 = <&cpsw_sleep>; ++ slaves = <1>; + status = "okay"; + }; + +@@ -342,3 +338,7 @@ + &sham { + status = "okay"; + }; ++ ++&rtc { ++ system-power-controller; ++}; +diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi +index 7e59d0b..b34f3bb 100644 +--- a/arch/arm/boot/dts/am335x-bone-common.dtsi ++++ b/arch/arm/boot/dts/am335x-bone-common.dtsi +@@ -357,15 +357,11 @@ + phy-mode = "mii"; + }; + +-&cpsw_emac1 { +- phy_id = <&davinci_mdio>, <1>; +- phy-mode = "mii"; +-}; +- + &mac { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&cpsw_default>; + pinctrl-1 = <&cpsw_sleep>; ++ slaves = <1>; + status = "okay"; + }; + diff --git a/arch/arm/boot/dts/am335x-bone-emmc-in-reset.dtsi b/arch/arm/boot/dts/am335x-bone-emmc-in-reset.dtsi new file mode 100644 index 0000000..7d8f673 @@ -567,6 +693,318 @@ index 0000000..01d0aec +&uart5 { + pinctrl-0 = <&uart5_pins>; +}; +diff --git a/arch/arm/boot/dts/am335x-boneblack-audio.dts b/arch/arm/boot/dts/am335x-boneblack-audio.dts +index cac3626..1c5299c 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-audio.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-audio.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + + / { +@@ -15,16 +16,16 @@ + compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; + + clk_mcasp0_fixed: clk_mcasp0_fixed { +- #clock-cells = <0>; +- compatible = "fixed-clock"; +- clock-frequency = <24576000>; ++ #clock-cells = <0>; ++ compatible = "fixed-clock"; ++ clock-frequency = <24576000>; + }; + + clk_mcasp0: clk_mcasp0 { +- #clock-cells = <0>; +- compatible = "gpio-gate-clock"; +- clocks = <&clk_mcasp0_fixed>; +- enable-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>; /* BeagleBone Black Clk enable on GPIO1_27 */ ++ #clock-cells = <0>; ++ compatible = "gpio-gate-clock"; ++ clocks = <&clk_mcasp0_fixed>; ++ enable-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>; /* BeagleBone Black Clk enable on GPIO1_27 */ + }; + }; + +diff --git a/arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts b/arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts +index 857c21e..f5ec278 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common-no-capemgr.dtsi" + + / { +@@ -33,8 +34,4 @@ + status = "okay"; + }; + +-&rtc { +- system-power-controller; +-}; +- + #include "am335x-cape-bbb-exp-c.dtsi" +diff --git a/arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts b/arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts +index b834fa2..27b3b72 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common-no-capemgr.dtsi" + + / { +@@ -33,8 +34,4 @@ + status = "okay"; + }; + +-&rtc { +- system-power-controller; +-}; +- + #include "am335x-cape-bbb-exp-r.dtsi" +diff --git a/arch/arm/boot/dts/am335x-boneblack-bbbmini.dts b/arch/arm/boot/dts/am335x-boneblack-bbbmini.dts +index adb317c..8e41afc 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-bbbmini.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-bbbmini.dts +@@ -9,6 +9,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + + #include <dt-bindings/board/am335x-bbw-bbb-base.h> +@@ -194,7 +195,3 @@ + pinctrl-0 = <&uart5_pins>; + status = "okay"; + }; +- +-&rtc { +- system-power-controller; +-}; +diff --git a/arch/arm/boot/dts/am335x-boneblack-cape-bone-argus.dts b/arch/arm/boot/dts/am335x-boneblack-cape-bone-argus.dts +index cecb0fcc..6f16d4c 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-cape-bone-argus.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-cape-bone-argus.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common-no-capemgr.dtsi" + + / { +@@ -91,8 +92,4 @@ + }; + }; + +-&rtc { +- system-power-controller; +-}; +- + #include "am335x-bone-argus.dtsi" +diff --git a/arch/arm/boot/dts/am335x-boneblack-emmc-overlay.dts b/arch/arm/boot/dts/am335x-boneblack-emmc-overlay.dts +index 5946a7e..68ae67c 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-emmc-overlay.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-emmc-overlay.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + #include "am33xx-overlay-edma-fix.dtsi" + +@@ -33,7 +34,3 @@ + bus-width = <8>; + status = "okay"; + }; +- +-&rtc { +- system-power-controller; +-}; +diff --git a/arch/arm/boot/dts/am335x-boneblack-hdmi-overlay.dts b/arch/arm/boot/dts/am335x-boneblack-hdmi-overlay.dts +index 9b0a7ba..6d419f7 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-hdmi-overlay.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-hdmi-overlay.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + #include "am33xx-overlay-edma-fix.dtsi" + +@@ -93,7 +94,3 @@ + }; + }; + }; +- +-&rtc { +- system-power-controller; +-}; +diff --git a/arch/arm/boot/dts/am335x-boneblack-nhdmi-overlay.dts b/arch/arm/boot/dts/am335x-boneblack-nhdmi-overlay.dts +index 9b0a7ba..6d419f7 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-nhdmi-overlay.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-nhdmi-overlay.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + #include "am33xx-overlay-edma-fix.dtsi" + +@@ -93,7 +94,3 @@ + }; + }; + }; +- +-&rtc { +- system-power-controller; +-}; +diff --git a/arch/arm/boot/dts/am335x-boneblack-overlay.dts b/arch/arm/boot/dts/am335x-boneblack-overlay.dts +index 880629c..d8051b6 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-overlay.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-overlay.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + #include "am33xx-overlay-edma-fix.dtsi" + +@@ -35,7 +36,3 @@ + line-name = "EMMC ResetN"; + }; + }; +- +-&rtc { +- system-power-controller; +-}; +diff --git a/arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts b/arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts +index e376613..ec953a9 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common-no-capemgr.dtsi" + + / { +@@ -25,10 +26,6 @@ + vmmc-supply = <&vmmcsd_fixed>; + }; + +-&rtc { +- system-power-controller; +-}; +- + /* EMMC in reset */ + &gpio1 { + emmc_rst { +diff --git a/arch/arm/boot/dts/am335x-boneblack.dts b/arch/arm/boot/dts/am335x-boneblack.dts +index db5beb5..11e4a16 100644 +--- a/arch/arm/boot/dts/am335x-boneblack.dts ++++ b/arch/arm/boot/dts/am335x-boneblack.dts +@@ -8,8 +8,10 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + #include "am33xx-overlay-edma-fix.dtsi" ++/* #include "am335x-bone-jtag.dtsi" */ + + / { + model = "TI AM335x BeagleBone Black"; +@@ -91,7 +93,3 @@ + }; + }; + }; +- +-&rtc { +- system-power-controller; +-}; +diff --git a/arch/arm/boot/dts/am335x-bonegreen-overlay.dts b/arch/arm/boot/dts/am335x-bonegreen-overlay.dts +index b87a606..c4bb320 100644 +--- a/arch/arm/boot/dts/am335x-bonegreen-overlay.dts ++++ b/arch/arm/boot/dts/am335x-bonegreen-overlay.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + #include "am33xx-overlay-edma-fix.dtsi" + +@@ -35,7 +36,3 @@ + line-name = "EMMC ResetN"; + }; + }; +- +-&rtc { +- system-power-controller; +-}; +diff --git a/arch/arm/boot/dts/am335x-bonegreen-wireless.dts b/arch/arm/boot/dts/am335x-bonegreen-wireless.dts +index b4fabfe..44c872d 100644 +--- a/arch/arm/boot/dts/am335x-bonegreen-wireless.dts ++++ b/arch/arm/boot/dts/am335x-bonegreen-wireless.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + #include "am335x-bonegreen-wl1835.dtsi" + +diff --git a/arch/arm/boot/dts/am335x-bonegreen.dts b/arch/arm/boot/dts/am335x-bonegreen.dts +index 42ac698..ef2e6cd 100644 +--- a/arch/arm/boot/dts/am335x-bonegreen.dts ++++ b/arch/arm/boot/dts/am335x-bonegreen.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + #include "am33xx-overlay-edma-fix.dtsi" + +@@ -33,22 +34,3 @@ + bus-width = <8>; + status = "okay"; + }; +- +-&am33xx_pinmux { +- uart2_pins: uart2_pins { +- pinctrl-single,pins = < +- AM33XX_IOPAD(0x950, PIN_INPUT | MUX_MODE1) /* spi0_sclk.uart2_rxd */ +- AM33XX_IOPAD(0x954, PIN_OUTPUT | MUX_MODE1) /* spi0_d0.uart2_txd */ +- >; +- }; +-}; +- +-&uart2 { +- pinctrl-names = "default"; +- pinctrl-0 = <&uart2_pins>; +- status = "okay"; +-}; +- +-&rtc { +- system-power-controller; +-}; diff --git a/arch/arm/boot/dts/am335x-cape-rtc-ds1307.dtsi b/arch/arm/boot/dts/am335x-cape-rtc-ds1307.dtsi new file mode 100644 index 0000000..bce6ac5 @@ -774,6 +1212,66 @@ index 0000000..8b42fb0 + + status = "okay"; +}; +diff --git a/arch/arm/boot/dts/am335x-sancloud-bbe.dts b/arch/arm/boot/dts/am335x-sancloud-bbe.dts +index 561f98a..1212a53 100644 +--- a/arch/arm/boot/dts/am335x-sancloud-bbe.dts ++++ b/arch/arm/boot/dts/am335x-sancloud-bbe.dts +@@ -8,6 +8,7 @@ + /dts-v1/; + + #include "am33xx.dtsi" ++#include "am33xx-es2.dtsi" + #include "am335x-bone-common.dtsi" + #include "am33xx-overlay-edma-fix.dtsi" + #include <dt-bindings/interrupt-controller/irq.h> +@@ -199,7 +200,3 @@ + //orientation = <0xff 0 0 0 1 0 0 0 0xff>; + }; + }; +- +-&rtc { +- system-power-controller; +-}; +diff --git a/arch/arm/boot/dts/am33xx-es2.dtsi b/arch/arm/boot/dts/am33xx-es2.dtsi +new file mode 100644 +index 0000000..6e252d42 +--- /dev/null ++++ b/arch/arm/boot/dts/am33xx-es2.dtsi +@@ -0,0 +1,34 @@ ++/* ++ * Device Tree Source for AM33XX SoC ++ * ++ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ ++ * ++ * This file is licensed under the terms of the GNU General Public License ++ * version 2. This program is licensed "as is" without any warranty of any ++ * kind, whether express or implied. ++ */ ++ ++/ { ++ cpus { ++ cpu@0 { ++ /* ++ * To consider voltage drop between PMIC and SoC, ++ * tolerance value is reduced to 2% from 4% and ++ * voltage value is increased as a precaution. ++ */ ++ operating-points = < ++ /* kHz uV */ ++ 1000000 1325000 ++ 800000 1300000 ++ 600000 1112000 ++ 300000 969000 ++ >; ++ voltage-tolerance = <2>; /* 2 percentage */ ++ ++ clocks = <&dpll_mpu_ck>; ++ clock-names = "cpu"; ++ ++ clock-latency = <300000>; /* From omap-cpufreq driver */ ++ }; ++ }; ++}; -- -2.7.0.rc3 +2.8.0.rc3 diff --git a/patches/beaglebone/jtag/0001-add-jtag-clock-pinmux.patch b/patches/beaglebone/jtag/0001-add-jtag-clock-pinmux.patch new file mode 100644 index 0000000000000000000000000000000000000000..6ff2d3d0d7177f92c34b5694927de9ac042afabf --- /dev/null +++ b/patches/beaglebone/jtag/0001-add-jtag-clock-pinmux.patch @@ -0,0 +1,40 @@ +From dd209ec38149ea96d9e0319ee115990176c1a29d Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Thu, 3 Mar 2016 10:30:58 -0600 +Subject: [PATCH] add: jtag clock pinmux + +Signed-off-by: Robert Nelson <robertcnelson@gmail.com> +--- + arch/arm/boot/dts/am335x-bone-jtag.dtsi | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + create mode 100644 arch/arm/boot/dts/am335x-bone-jtag.dtsi + +diff --git a/arch/arm/boot/dts/am335x-bone-jtag.dtsi b/arch/arm/boot/dts/am335x-bone-jtag.dtsi +new file mode 100644 +index 0000000..a92db8e +--- /dev/null ++++ b/arch/arm/boot/dts/am335x-bone-jtag.dtsi +@@ -0,0 +1,20 @@ ++/* ++ * Device Tree Source for bone jtag ++ * ++ * Copyright (C) 2015 Robert Nelson <robertcnelson@gmail.com> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++&am33xx_pinmux { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&clkout2_pin>; ++ ++ clkout2_pin: pinmux_clkout2_pin { ++ pinctrl-single,pins = < ++ 0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */ ++ >; ++ }; ++}; +-- +2.7.0 + diff --git a/patches/beaglebone/rs485/0001-tty-Move-serial8250_stop_rx-in-front-of-serial8250_s.patch b/patches/beaglebone/rs485/0001-tty-Move-serial8250_stop_rx-in-front-of-serial8250_s.patch deleted file mode 100644 index d949e1912ffc1a62201d586457461e4b377c9a02..0000000000000000000000000000000000000000 --- a/patches/beaglebone/rs485/0001-tty-Move-serial8250_stop_rx-in-front-of-serial8250_s.patch +++ /dev/null @@ -1,64 +0,0 @@ -From a07a70bcb72e4a766c8d3173986a773cef842d30 Mon Sep 17 00:00:00 2001 -From: "Matwey V. Kornilov" <matwey@sai.msu.ru> -Date: Mon, 1 Feb 2016 21:09:20 +0300 -Subject: [PATCH] tty: Move serial8250_stop_rx() in front of - serial8250_start_tx() - -Software RS485 emultaion is to be added in the following commit. -serial8250_start_tx() will need to refer serial8250_stop_rx(). -Move serial8250_stop_rx() in front of serial8250_start_tx() in order -to avoid function forward declaration. - -Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - drivers/tty/serial/8250/8250_port.c | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 0bd3c6b..04681e5 100644 ---- a/drivers/tty/serial/8250/8250_port.c -+++ b/drivers/tty/serial/8250/8250_port.c -@@ -1304,6 +1304,19 @@ static void autoconfig_irq(struct uart_8250_port *up) - port->irq = (irq > 0) ? irq : 0; - } - -+static void serial8250_stop_rx(struct uart_port *port) -+{ -+ struct uart_8250_port *up = up_to_u8250p(port); -+ -+ serial8250_rpm_get(up); -+ -+ up->ier &= ~(UART_IER_RLSI | UART_IER_RDI); -+ up->port.read_status_mask &= ~UART_LSR_DR; -+ serial_port_out(port, UART_IER, up->ier); -+ -+ serial8250_rpm_put(up); -+} -+ - static inline void __stop_tx(struct uart_8250_port *p) - { - if (p->ier & UART_IER_THRI) { -@@ -1371,19 +1384,6 @@ static void serial8250_unthrottle(struct uart_port *port) - port->unthrottle(port); - } - --static void serial8250_stop_rx(struct uart_port *port) --{ -- struct uart_8250_port *up = up_to_u8250p(port); -- -- serial8250_rpm_get(up); -- -- up->ier &= ~(UART_IER_RLSI | UART_IER_RDI); -- up->port.read_status_mask &= ~UART_LSR_DR; -- serial_port_out(port, UART_IER, up->ier); -- -- serial8250_rpm_put(up); --} -- - static void serial8250_disable_ms(struct uart_port *port) - { - struct uart_8250_port *up = --- -2.7.0 - diff --git a/patches/beaglebone/rs485/0002-tty-Add-software-emulated-RS485-support-for-8250.patch b/patches/beaglebone/rs485/0002-tty-Add-software-emulated-RS485-support-for-8250.patch deleted file mode 100644 index 39a28949ad53f3d26f180189d44250da77ce1a56..0000000000000000000000000000000000000000 --- a/patches/beaglebone/rs485/0002-tty-Add-software-emulated-RS485-support-for-8250.patch +++ /dev/null @@ -1,345 +0,0 @@ -From e490c9144cfaa8e2242c1e5d5187230928f27417 Mon Sep 17 00:00:00 2001 -From: "Matwey V. Kornilov" <matwey@sai.msu.ru> -Date: Mon, 1 Feb 2016 21:09:21 +0300 -Subject: [PATCH] tty: Add software emulated RS485 support for 8250 - -Implementation of software emulation of RS485 direction handling is based -on omap_serial driver. -Before and after transmission RTS is set to the appropriate value. - -Note that before calling serial8250_em485_init() the caller has to -ensure that UART will interrupt when shift register empty. Otherwise, -emultaion cannot be used. - -Both serial8250_em485_init() and serial8250_em485_destroy() are -idempotent functions. - -Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - drivers/tty/serial/8250/8250.h | 2 + - drivers/tty/serial/8250/8250_port.c | 223 +++++++++++++++++++++++++++++++++++- - include/linux/serial_8250.h | 8 ++ - 3 files changed, 229 insertions(+), 4 deletions(-) - -diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h -index d54dcd8..ce587c0 100644 ---- a/drivers/tty/serial/8250/8250.h -+++ b/drivers/tty/serial/8250/8250.h -@@ -117,6 +117,8 @@ static inline void serial_dl_write(struct uart_8250_port *up, int value) - struct uart_8250_port *serial8250_get_port(int line); - void serial8250_rpm_get(struct uart_8250_port *p); - void serial8250_rpm_put(struct uart_8250_port *p); -+int serial8250_em485_init(struct uart_8250_port *p); -+void serial8250_em485_destroy(struct uart_8250_port *p); - - #if defined(__alpha__) && !defined(CONFIG_PCI) - /* -diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 04681e5..01a85a7 100644 ---- a/drivers/tty/serial/8250/8250_port.c -+++ b/drivers/tty/serial/8250/8250_port.c -@@ -37,6 +37,7 @@ - #include <linux/slab.h> - #include <linux/uaccess.h> - #include <linux/pm_runtime.h> -+#include <linux/timer.h> - - #include <asm/io.h> - #include <asm/irq.h> -@@ -522,6 +523,20 @@ static void serial8250_clear_fifos(struct uart_8250_port *p) - } - } - -+static inline void serial8250_em485_rts_after_send(struct uart_8250_port *p) -+{ -+ unsigned char mcr = serial_in(p, UART_MCR); -+ -+ if (p->port.rs485.flags & SER_RS485_RTS_AFTER_SEND) -+ mcr |= UART_MCR_RTS; -+ else -+ mcr &= ~UART_MCR_RTS; -+ serial_out(p, UART_MCR, mcr); -+} -+ -+static void serial8250_em485_handle_start_tx(unsigned long arg); -+static void serial8250_em485_handle_stop_tx(unsigned long arg); -+ - void serial8250_clear_and_reinit_fifos(struct uart_8250_port *p) - { - serial8250_clear_fifos(p); -@@ -546,6 +561,73 @@ void serial8250_rpm_put(struct uart_8250_port *p) - } - EXPORT_SYMBOL_GPL(serial8250_rpm_put); - -+/** -+ * serial8250_em485_init() - put uart_8250_port into rs485 emulating -+ * @p: uart_8250_port port instance -+ * -+ * The function is used to start rs485 software emulating on the -+ * &struct uart_8250_port* @p. Namely, RTS is switched before/after -+ * transmission. The function is idempotent, so it is safe to call it -+ * multiple times. -+ * -+ * The caller MUST enable interrupt on empty shift register before -+ * calling serial8250_em485_init(). This interrupt is not a part of -+ * 8250 standard, but implementation defined. -+ * -+ * The function is supposed to be called from .rs485_config callback -+ * or from any other callback protected with p->port.lock spinlock. -+ * -+ * See also serial8250_em485_destroy() -+ * -+ * Return 0 - success, -errno - otherwise -+ */ -+int serial8250_em485_init(struct uart_8250_port *p) -+{ -+ if (p->em485 != NULL) -+ return 0; -+ -+ p->em485 = kmalloc(sizeof(struct uart_8250_em485), GFP_KERNEL); -+ if (p->em485 == NULL) -+ return -ENOMEM; -+ -+ setup_timer(&p->em485->stop_tx_timer, -+ serial8250_em485_handle_stop_tx, (unsigned long)p); -+ setup_timer(&p->em485->start_tx_timer, -+ serial8250_em485_handle_start_tx, (unsigned long)p); -+ p->em485->active_timer = NULL; -+ -+ serial8250_em485_rts_after_send(p); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(serial8250_em485_init); -+ -+/** -+ * serial8250_em485_destroy() - put uart_8250_port into normal state -+ * @p: uart_8250_port port instance -+ * -+ * The function is used to stop rs485 software emulating on the -+ * &struct uart_8250_port* @p. The function is idempotent, so it is safe to -+ * call it multiple times. -+ * -+ * The function is supposed to be called from .rs485_config callback -+ * or from any other callback protected with p->port.lock spinlock. -+ * -+ * See also serial8250_em485_init() -+ */ -+void serial8250_em485_destroy(struct uart_8250_port *p) -+{ -+ if (p->em485 == NULL) -+ return; -+ -+ del_timer(&p->em485->start_tx_timer); -+ del_timer(&p->em485->stop_tx_timer); -+ -+ kfree(p->em485); -+ p->em485 = NULL; -+} -+EXPORT_SYMBOL_GPL(serial8250_em485_destroy); -+ - /* - * These two wrappers ensure that enable_runtime_pm_tx() can be called more than - * once and disable_runtime_pm_tx() will still disable RPM because the fifo is -@@ -1317,7 +1399,56 @@ static void serial8250_stop_rx(struct uart_port *port) - serial8250_rpm_put(up); - } - --static inline void __stop_tx(struct uart_8250_port *p) -+static void __do_stop_tx_rs485(struct uart_8250_port *p) -+{ -+ if (!p->em485) -+ return; -+ -+ serial8250_em485_rts_after_send(p); -+ /* -+ * Empty the RX FIFO, we are not interested in anything -+ * received during the half-duplex transmission. -+ */ -+ if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) -+ serial8250_clear_fifos(p); -+} -+ -+static void serial8250_em485_handle_stop_tx(unsigned long arg) -+{ -+ struct uart_8250_port *p = (struct uart_8250_port *)arg; -+ struct uart_8250_em485 *em485 = p->em485; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&p->port.lock, flags); -+ if (em485 && -+ em485->active_timer == &em485->stop_tx_timer) { -+ __do_stop_tx_rs485(p); -+ em485->active_timer = NULL; -+ } -+ spin_unlock_irqrestore(&p->port.lock, flags); -+} -+ -+static void __stop_tx_rs485(struct uart_8250_port *p) -+{ -+ struct uart_8250_em485 *em485 = p->em485; -+ -+ if (!em485) -+ return; -+ -+ /* -+ * __do_stop_tx_rs485 is going to set RTS according to config -+ * AND flush RX FIFO if required. -+ */ -+ if (p->port.rs485.delay_rts_after_send > 0) { -+ em485->active_timer = &em485->stop_tx_timer; -+ mod_timer(&em485->stop_tx_timer, jiffies + -+ p->port.rs485.delay_rts_after_send * HZ / 1000); -+ } else { -+ __do_stop_tx_rs485(p); -+ } -+} -+ -+static inline void __do_stop_tx(struct uart_8250_port *p) - { - if (p->ier & UART_IER_THRI) { - p->ier &= ~UART_IER_THRI; -@@ -1326,6 +1457,28 @@ static inline void __stop_tx(struct uart_8250_port *p) - } - } - -+static inline void __stop_tx(struct uart_8250_port *p) -+{ -+ struct uart_8250_em485 *em485 = p->em485; -+ -+ if (em485) { -+ unsigned char lsr = serial_in(p, UART_LSR); -+ /* -+ * To provide required timeing and allow FIFO transfer, -+ * __stop_tx_rs485 must be called only when both FIFO and -+ * shift register are empty. It is for device driver to enable -+ * interrupt on TEMT. -+ */ -+ if ((lsr & BOTH_EMPTY) != BOTH_EMPTY) -+ return; -+ -+ del_timer(&em485->start_tx_timer); -+ em485->active_timer = NULL; -+ } -+ __do_stop_tx(p); -+ __stop_tx_rs485(p); -+} -+ - static void serial8250_stop_tx(struct uart_port *port) - { - struct uart_8250_port *up = up_to_u8250p(port); -@@ -1343,12 +1496,10 @@ static void serial8250_stop_tx(struct uart_port *port) - serial8250_rpm_put(up); - } - --static void serial8250_start_tx(struct uart_port *port) -+static inline void __start_tx(struct uart_port *port) - { - struct uart_8250_port *up = up_to_u8250p(port); - -- serial8250_rpm_get_tx(up); -- - if (up->dma && !up->dma->tx_dma(up)) - return; - -@@ -1374,6 +1525,70 @@ static void serial8250_start_tx(struct uart_port *port) - } - } - -+static inline void start_tx_rs485(struct uart_port *port) -+{ -+ struct uart_8250_port *up = up_to_u8250p(port); -+ struct uart_8250_em485 *em485 = up->em485; -+ unsigned char mcr; -+ -+ if (!(up->port.rs485.flags & SER_RS485_RX_DURING_TX)) -+ serial8250_stop_rx(&up->port); -+ -+ del_timer(&em485->stop_tx_timer); -+ em485->active_timer = NULL; -+ -+ mcr = serial_in(up, UART_MCR); -+ if (!!(up->port.rs485.flags & SER_RS485_RTS_ON_SEND) != -+ !!(mcr & UART_MCR_RTS)) { -+ if (up->port.rs485.flags & SER_RS485_RTS_ON_SEND) -+ mcr |= UART_MCR_RTS; -+ else -+ mcr &= ~UART_MCR_RTS; -+ serial_out(up, UART_MCR, mcr); -+ -+ if (up->port.rs485.delay_rts_before_send > 0) { -+ em485->active_timer = &em485->start_tx_timer; -+ mod_timer(&em485->start_tx_timer, jiffies + -+ up->port.rs485.delay_rts_before_send * HZ / 1000); -+ return; -+ } -+ } -+ -+ __start_tx(port); -+} -+ -+static void serial8250_em485_handle_start_tx(unsigned long arg) -+{ -+ struct uart_8250_port *p = (struct uart_8250_port *)arg; -+ struct uart_8250_em485 *em485 = p->em485; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&p->port.lock, flags); -+ if (em485 && -+ em485->active_timer == &em485->start_tx_timer) { -+ __start_tx(&p->port); -+ em485->active_timer = NULL; -+ } -+ spin_unlock_irqrestore(&p->port.lock, flags); -+} -+ -+static void serial8250_start_tx(struct uart_port *port) -+{ -+ struct uart_8250_port *up = up_to_u8250p(port); -+ struct uart_8250_em485 *em485 = up->em485; -+ -+ serial8250_rpm_get_tx(up); -+ -+ if (em485 && -+ em485->active_timer == &em485->start_tx_timer) -+ return; -+ -+ if (em485) -+ start_tx_rs485(port); -+ else -+ __start_tx(port); -+} -+ - static void serial8250_throttle(struct uart_port *port) - { - port->throttle(port); -diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h -index faa0e03..4348797 100644 ---- a/include/linux/serial_8250.h -+++ b/include/linux/serial_8250.h -@@ -76,6 +76,12 @@ struct uart_8250_ops { - void (*release_irq)(struct uart_8250_port *); - }; - -+struct uart_8250_em485 { -+ struct timer_list start_tx_timer; /* "rs485 start tx" timer */ -+ struct timer_list stop_tx_timer; /* "rs485 stop tx" timer */ -+ struct timer_list *active_timer; /* pointer to active timer */ -+}; -+ - /* - * This should be used by drivers which want to register - * their own 8250 ports without registering their own -@@ -122,6 +128,8 @@ struct uart_8250_port { - /* 8250 specific callbacks */ - int (*dl_read)(struct uart_8250_port *); - void (*dl_write)(struct uart_8250_port *, int); -+ -+ struct uart_8250_em485 *em485; - }; - - static inline struct uart_8250_port *up_to_u8250p(struct uart_port *up) --- -2.7.0 - diff --git a/patches/beaglebone/rs485/0003-tty-8250_omap-Use-software-emulated-RS485-direction-.patch b/patches/beaglebone/rs485/0003-tty-8250_omap-Use-software-emulated-RS485-direction-.patch deleted file mode 100644 index 74d98eef3a8b5f8e57775d00b2d89fc82d790bc6..0000000000000000000000000000000000000000 --- a/patches/beaglebone/rs485/0003-tty-8250_omap-Use-software-emulated-RS485-direction-.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 344cee2470ff70801c95c62ab2762da0834c8c6c Mon Sep 17 00:00:00 2001 -From: "Matwey V. Kornilov" <matwey@sai.msu.ru> -Date: Mon, 1 Feb 2016 21:09:22 +0300 -Subject: [PATCH] tty: 8250_omap: Use software emulated RS485 direction control - -Use software emulated RS485 direction control to provide RS485 API -existed in omap_serial driver. Note that 8250_omap issues interrupt -on shift register empty which is single prerequesite for using software -emulated RS485. - -Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - drivers/tty/serial/8250/8250_omap.c | 31 +++++++++++++++++++++++++++++++ - 1 file changed, 31 insertions(+) - -diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c -index a2c0734..d710985 100644 ---- a/drivers/tty/serial/8250/8250_omap.c -+++ b/drivers/tty/serial/8250/8250_omap.c -@@ -697,6 +697,36 @@ static void omap_8250_throttle(struct uart_port *port) - pm_runtime_put_autosuspend(port->dev); - } - -+static int omap_8250_rs485_config(struct uart_port *port, -+ struct serial_rs485 *rs485) -+{ -+ struct uart_8250_port *up = up_to_u8250p(port); -+ -+ /* Clamp the delays to [0, 100ms] */ -+ rs485->delay_rts_before_send = min(rs485->delay_rts_before_send, 100U); -+ rs485->delay_rts_after_send = min(rs485->delay_rts_after_send, 100U); -+ -+ port->rs485 = *rs485; -+ -+ /* -+ * Both serial8250_em485_init and serial8250_em485_destroy -+ * are idempotent -+ */ -+ if (rs485->flags & SER_RS485_ENABLED) { -+ int ret = serial8250_em485_init(up); -+ -+ if (ret) { -+ rs485->flags &= ~SER_RS485_ENABLED; -+ port->rs485.flags &= ~SER_RS485_ENABLED; -+ } -+ return ret; -+ } -+ -+ serial8250_em485_destroy(up); -+ -+ return 0; -+} -+ - static void omap_8250_unthrottle(struct uart_port *port) - { - unsigned long flags; -@@ -1146,6 +1176,7 @@ static int omap8250_probe(struct platform_device *pdev) - up.port.shutdown = omap_8250_shutdown; - up.port.throttle = omap_8250_throttle; - up.port.unthrottle = omap_8250_unthrottle; -+ up.port.rs485_config = omap_8250_rs485_config; - - if (pdev->dev.of_node) { - const struct of_device_id *id; --- -2.7.0 - diff --git a/patches/beaglebone/rs485/0004-tty-serial-8250-Cleanup-p-em485-in-serial8250_unregi.patch b/patches/beaglebone/rs485/0004-tty-serial-8250-Cleanup-p-em485-in-serial8250_unregi.patch deleted file mode 100644 index 93198a397a3d86614b2eedd94431262b070522af..0000000000000000000000000000000000000000 --- a/patches/beaglebone/rs485/0004-tty-serial-8250-Cleanup-p-em485-in-serial8250_unregi.patch +++ /dev/null @@ -1,40 +0,0 @@ -From bf2a0be45ffc5ab706f9be71a2cdc3f4600cb444 Mon Sep 17 00:00:00 2001 -From: "Matwey V. Kornilov" <matwey@sai.msu.ru> -Date: Mon, 15 Feb 2016 21:42:12 +0300 -Subject: [PATCH] tty: serial: 8250: Cleanup p->em485 in - serial8250_unregister_port - -Formally, currently there is no memory leak, but if -serial8250_ports[line] is reused with other 8250 driver, then em485 -will be already activated and it will cause issues. - -Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250") -Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - drivers/tty/serial/8250/8250_core.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c -index 7775221..2f4f5ee 100644 ---- a/drivers/tty/serial/8250/8250_core.c -+++ b/drivers/tty/serial/8250/8250_core.c -@@ -1074,6 +1074,15 @@ void serial8250_unregister_port(int line) - struct uart_8250_port *uart = &serial8250_ports[line]; - - mutex_lock(&serial_mutex); -+ -+ if (uart->em485) { -+ unsigned long flags; -+ -+ spin_lock_irqsave(&uart->port.lock, flags); -+ serial8250_em485_destroy(uart); -+ spin_unlock_irqrestore(&uart->port.lock, flags); -+ } -+ - uart_remove_one_port(&serial8250_reg, &uart->port); - if (serial8250_isa_devs) { - uart->port.flags &= ~UPF_BOOT_AUTOCONF; --- -2.7.0 - diff --git a/patches/beaglebone/rs485/0005-tty-serial-Use-GFP_ATOMIC-instead-of-GFP_KERNEL-in-s.patch b/patches/beaglebone/rs485/0005-tty-serial-Use-GFP_ATOMIC-instead-of-GFP_KERNEL-in-s.patch deleted file mode 100644 index c0b5bf3ae1575427edc0e45958b390aba161b649..0000000000000000000000000000000000000000 --- a/patches/beaglebone/rs485/0005-tty-serial-Use-GFP_ATOMIC-instead-of-GFP_KERNEL-in-s.patch +++ /dev/null @@ -1,38 +0,0 @@ -From b18a183eaac25bd8dc51eab85437c7253f5c31d1 Mon Sep 17 00:00:00 2001 -From: "Matwey V. Kornilov" <matwey@sai.msu.ru> -Date: Fri, 19 Feb 2016 08:29:10 +0300 -Subject: [PATCH] tty: serial: Use GFP_ATOMIC instead of GFP_KERNEL in - serial8250_em485_init() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -serial8250_em485_init() is supposed to be protected with -p->port.lock spinlock. -This may lead to issues when kmalloc sleeps, so it is better to use -GFP_ATOMIC in this spinlocked context. - -Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250") -Reported-by: ИльÑÑ Ð“Ð°Ñанов <torso.nafi@gmail.com> -Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - drivers/tty/serial/8250/8250_port.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index e376cfa..2ffda79 100644 ---- a/drivers/tty/serial/8250/8250_port.c -+++ b/drivers/tty/serial/8250/8250_port.c -@@ -588,7 +588,7 @@ int serial8250_em485_init(struct uart_8250_port *p) - if (p->em485 != NULL) - return 0; - -- p->em485 = kmalloc(sizeof(struct uart_8250_em485), GFP_KERNEL); -+ p->em485 = kmalloc(sizeof(struct uart_8250_em485), GFP_ATOMIC); - if (p->em485 == NULL) - return -ENOMEM; - --- -2.7.0 - diff --git a/patches/beaglebone/sancloud/0001-add-sancloud-beaglebone-enhanced.patch b/patches/beaglebone/sancloud/0001-add-am335x-sancloud-bbe.patch similarity index 68% rename from patches/beaglebone/sancloud/0001-add-sancloud-beaglebone-enhanced.patch rename to patches/beaglebone/sancloud/0001-add-am335x-sancloud-bbe.patch index e107f1af0b5f8e4ff8b1b802fb03897919a47c3a..248bef6e628884c98bb5ce42057b191d66a3e5bd 100644 --- a/patches/beaglebone/sancloud/0001-add-sancloud-beaglebone-enhanced.patch +++ b/patches/beaglebone/sancloud/0001-add-am335x-sancloud-bbe.patch @@ -1,7 +1,7 @@ -From 0fccc99e70a834415d85efc351e6d4ba299a9a7f Mon Sep 17 00:00:00 2001 +From 6a9a05b8fb3fbdd4eb4587a5ec6a4b11d4744588 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> -Date: Fri, 11 Mar 2016 10:46:23 -0600 -Subject: [PATCH 1/2] add: sancloud beaglebone enhanced +Date: Wed, 9 Mar 2016 15:00:11 -0600 +Subject: [PATCH] add: am335x-sancloud-bbe Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -11,7 +11,7 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> diff --git a/arch/arm/boot/dts/am335x-sancloud-bbe.dts b/arch/arm/boot/dts/am335x-sancloud-bbe.dts new file mode 100644 -index 0000000..e9d6616 +index 0000000..2447d14 --- /dev/null +++ b/arch/arm/boot/dts/am335x-sancloud-bbe.dts @@ -0,0 +1,201 @@ @@ -58,32 +58,32 @@ index 0000000..e9d6616 + + nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins { + pinctrl-single,pins = < -+ AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr0 */ -+ AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE0) /* lcd_data0.lcd_data0 */ -+ AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE0) /* lcd_data1.lcd_data1 */ -+ AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE0) /* lcd_data2.lcd_data2 */ -+ AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE0) /* lcd_data3.lcd_data3 */ -+ AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE0) /* lcd_data4.lcd_data4 */ -+ AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE0) /* lcd_data5.lcd_data5 */ -+ AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE0) /* lcd_data6.lcd_data6 */ -+ AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE0) /* lcd_data7.lcd_data7 */ -+ AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE0) /* lcd_data8.lcd_data8 */ -+ AM33XX_IOPAD(0x8c4, PIN_OUTPUT | MUX_MODE0) /* lcd_data9.lcd_data9 */ -+ AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE0) /* lcd_data10.lcd_data10 */ -+ AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE0) /* lcd_data11.lcd_data11 */ -+ AM33XX_IOPAD(0x8d0, PIN_OUTPUT | MUX_MODE0) /* lcd_data12.lcd_data12 */ -+ AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE0) /* lcd_data13.lcd_data13 */ -+ AM33XX_IOPAD(0x8d8, PIN_OUTPUT | MUX_MODE0) /* lcd_data14.lcd_data14 */ -+ AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE0) /* lcd_data15.lcd_data15 */ -+ AM33XX_IOPAD(0x8e0, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_vsync.lcd_vsync */ -+ AM33XX_IOPAD(0x8e4, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_hsync.lcd_hsync */ -+ AM33XX_IOPAD(0x8e8, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_pclk.lcd_pclk */ -+ AM33XX_IOPAD(0x8ec, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_ac_bias_en.lcd_ac_bias_en */ ++ 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ ++ 0xa0 0x08 /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xa4 0x08 /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xa8 0x08 /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xac 0x08 /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xb0 0x08 /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xb4 0x08 /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xb8 0x08 /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xbc 0x08 /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xc0 0x08 /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xc4 0x08 /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xc8 0x08 /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xcc 0x08 /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xd0 0x08 /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xd4 0x08 /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xd8 0x08 /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xdc 0x08 /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ ++ 0xe0 0x00 /* lcd_vsync.lcd_vsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ 0xe4 0x00 /* lcd_hsync.lcd_hsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ 0xe8 0x00 /* lcd_pclk.lcd_pclk, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ ++ 0xec 0x00 /* lcd_ac_bias_en.lcd_ac_bias_en, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ + >; + }; + nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins { + pinctrl-single,pins = < -+ AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr0 */ ++ 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ + >; + }; + @@ -217,5 +217,5 @@ index 0000000..e9d6616 + system-power-controller; +}; -- -2.8.0.rc3 +2.7.0 diff --git a/patches/beaglebone/tilcdc/0023-drm-tilcdc-Write-to-LCDC_END_OF_INT_IND_REG-at-the-e.patch b/patches/beaglebone/tilcdc/0023-drm-tilcdc-Write-to-LCDC_END_OF_INT_IND_REG-at-the-e.patch new file mode 100644 index 0000000000000000000000000000000000000000..cdb320dc13770e7a10a965a60c78f51be279719e --- /dev/null +++ b/patches/beaglebone/tilcdc/0023-drm-tilcdc-Write-to-LCDC_END_OF_INT_IND_REG-at-the-e.patch @@ -0,0 +1,64 @@ +From 739b8621b8819a79ef4fd62ae79fd786df1266f4 Mon Sep 17 00:00:00 2001 +From: Jyri Sarha <jsarha@ti.com> +Date: Fri, 8 Apr 2016 12:31:02 +0300 +Subject: [PATCH 23/25] drm/tilcdc: Write to LCDC_END_OF_INT_IND_REG at the end + of IRQ function + +Reorder the IRQ function so that the write to LCDC_END_OF_INT_IND_REG +is done last. The write to LCDC_END_OF_INT_IND_REG indicates to LCDC +that the interrupt service routine has completed (see section +13.3.6.1.6 in AM335x TRM). This is needed if LCDC's ipgvmodirq module +is configured for pulse interrupts. + +Signed-off-by: Jyri Sarha <jsarha@ti.com> +--- + drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 24 +++++++++++++++--------- + 1 file changed, 15 insertions(+), 9 deletions(-) + +diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +index 051e5e1..a06e73a 100644 +--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c ++++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +@@ -718,14 +718,19 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) + tilcdc_crtc->frame_intact = true; + } + +- if (priv->rev == 2) { +- if (stat & LCDC_FRAME_DONE) { +- tilcdc_crtc->frame_done = true; +- wake_up(&tilcdc_crtc->frame_done_wq); +- } +- tilcdc_write(dev, LCDC_END_OF_INT_IND_REG, 0); ++ if (priv->rev == 1) ++ return IRQ_HANDLED; ++ /* The rest is for revision 2 only */ ++ ++ if (stat & LCDC_FRAME_DONE) { ++ tilcdc_crtc->frame_done = true; ++ wake_up(&tilcdc_crtc->frame_done_wq); + } + ++ if (stat & LCDC_FIFO_UNDERFLOW) ++ dev_err_ratelimited(dev->dev, "%s(0x%08x): FIFO underfow", ++ __func__, stat); ++ + if (stat & LCDC_SYNC_LOST) { + dev_err_ratelimited(dev->dev, "%s(0x%08x): Sync lost", + __func__, stat); +@@ -739,9 +744,10 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) + } + } + +- if (stat & LCDC_FIFO_UNDERFLOW) +- dev_err_ratelimited(dev->dev, "%s(0x%08x): FIFO underfow", +- __func__, stat); ++ /* Indicate to LCDC that the interrupt service routine has ++ * completed, see 13.3.6.1.6 in AM335x TRM. ++ */ ++ tilcdc_write(dev, LCDC_END_OF_INT_IND_REG, 0); + + return IRQ_HANDLED; + } +-- +2.8.0.rc3 + diff --git a/patches/beaglebone/tilcdc/0024-drm-tilcdc-Move-waiting-of-LCDC_FRAME_DONE-IRQ-into-.patch b/patches/beaglebone/tilcdc/0024-drm-tilcdc-Move-waiting-of-LCDC_FRAME_DONE-IRQ-into-.patch new file mode 100644 index 0000000000000000000000000000000000000000..2eb6ac1e9a43661636e0d66352841bbb1c92fa3a --- /dev/null +++ b/patches/beaglebone/tilcdc/0024-drm-tilcdc-Move-waiting-of-LCDC_FRAME_DONE-IRQ-into-.patch @@ -0,0 +1,70 @@ +From 513c7e9450434a2f71129f8c15b67db4e10cd4b7 Mon Sep 17 00:00:00 2001 +From: Jyri Sarha <jsarha@ti.com> +Date: Fri, 8 Apr 2016 12:31:03 +0300 +Subject: [PATCH 24/25] drm/tilcdc: Move waiting of LCDC_FRAME_DONE IRQ into + stop() + +Move wait queue waiting of LCDC_FRAME_DONE IRQ from tilcdc_crtc_dpms() +into stop() function. + +Signed-off-by: Jyri Sarha <jsarha@ti.com> +--- + drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 31 ++++++++++++++++--------------- + 1 file changed, 16 insertions(+), 15 deletions(-) + +diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +index a06e73a..7a5cc03 100644 +--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c ++++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +@@ -113,9 +113,25 @@ static void start(struct drm_crtc *crtc) + + static void stop(struct drm_crtc *crtc) + { ++ struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); + struct drm_device *dev = crtc->dev; ++ struct tilcdc_drm_private *priv = dev->dev_private; + ++ tilcdc_crtc->frame_done = false; + tilcdc_clear(dev, LCDC_RASTER_CTRL_REG, LCDC_RASTER_ENABLE); ++ ++ /* ++ * if necessary wait for framedone irq which will still come ++ * before putting things to sleep.. ++ */ ++ if (priv->rev == 2) { ++ int ret = wait_event_timeout(tilcdc_crtc->frame_done_wq, ++ tilcdc_crtc->frame_done, ++ msecs_to_jiffies(50)); ++ if (ret == 0) ++ dev_err(dev->dev, "%s: timeout waiting for framedone\n", ++ __func__); ++ } + } + + static void tilcdc_crtc_destroy(struct drm_crtc *crtc) +@@ -212,22 +228,7 @@ void tilcdc_crtc_dpms(struct drm_crtc *crtc, int mode) + pm_runtime_get_sync(dev->dev); + start(crtc); + } else { +- tilcdc_crtc->frame_done = false; + stop(crtc); +- +- /* +- * if necessary wait for framedone irq which will still come +- * before putting things to sleep.. +- */ +- if (priv->rev == 2) { +- int ret = wait_event_timeout( +- tilcdc_crtc->frame_done_wq, +- tilcdc_crtc->frame_done, +- msecs_to_jiffies(50)); +- if (ret == 0) +- dev_err(dev->dev, "timeout waiting for framedone\n"); +- } +- + pm_runtime_put_sync(dev->dev); + + if (tilcdc_crtc->next_fb) { +-- +2.8.0.rc3 + diff --git a/patches/beaglebone/tilcdc/0025-drm-tilcdc-Recover-from-sync-lost-error-flood-by-res.patch b/patches/beaglebone/tilcdc/0025-drm-tilcdc-Recover-from-sync-lost-error-flood-by-res.patch new file mode 100644 index 0000000000000000000000000000000000000000..8c8f6a8296bfd2cd74820209d30665537007f8b0 --- /dev/null +++ b/patches/beaglebone/tilcdc/0025-drm-tilcdc-Recover-from-sync-lost-error-flood-by-res.patch @@ -0,0 +1,84 @@ +From 430c28b76b0520dbcfe541ce582f408c0c6521e2 Mon Sep 17 00:00:00 2001 +From: Jyri Sarha <jsarha@ti.com> +Date: Fri, 8 Apr 2016 12:31:04 +0300 +Subject: [PATCH 25/25] drm/tilcdc: Recover from sync lost error flood by + resetting the LCDC + +Recover from sync lost error flood by resetting the LCDC instead of +turning off the SYNC_LOST error IRQ. When LCDC starves on limited +memory bandwidth it may sometimes result an error situation when the +picture may have shifted couple of pixels to right and SYNC_LOST +interrupt is generated on every frame. LCDC main reset recovers from +this situation and causes a brief blanking on the screen. + +Signed-off-by: Jyri Sarha <jsarha@ti.com> +--- + drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +index 7a5cc03..6dce763 100644 +--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c ++++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +@@ -46,6 +46,7 @@ struct tilcdc_crtc { + + int sync_lost_count; + bool frame_intact; ++ struct work_struct recover_work; + }; + #define to_tilcdc_crtc(x) container_of(x, struct tilcdc_crtc, base) + +@@ -134,6 +135,28 @@ static void stop(struct drm_crtc *crtc) + } + } + ++static void tilcdc_crtc_recover_work(struct work_struct *work) ++{ ++ struct tilcdc_crtc *tilcdc_crtc = ++ container_of(work, struct tilcdc_crtc, recover_work); ++ struct drm_crtc *crtc = &tilcdc_crtc->base; ++ struct drm_device *dev = crtc->dev; ++ ++ dev_info(crtc->dev->dev, "%s: Reset CRTC", __func__); ++ ++ drm_modeset_lock_crtc(crtc, NULL); ++ ++ if (tilcdc_crtc->dpms == DRM_MODE_DPMS_OFF) ++ goto out; ++ ++ tilcdc_crtc->frame_done = false; ++ stop(crtc); ++ tilcdc_write(dev, LCDC_INT_ENABLE_SET_REG, LCDC_SYNC_LOST); ++ start(crtc); ++out: ++ drm_modeset_unlock_crtc(crtc); ++} ++ + static void tilcdc_crtc_destroy(struct drm_crtc *crtc) + { + struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); +@@ -738,10 +761,12 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) + tilcdc_crtc->frame_intact = false; + if (tilcdc_crtc->sync_lost_count++ > SYNC_LOST_COUNT_LIMIT) { + dev_err(dev->dev, +- "%s(0x%08x): Sync lost flood detected, disabling the interrupt", ++ "%s(0x%08x): Sync lost flood detected, recovering", + __func__, stat); ++ queue_work(system_wq, &tilcdc_crtc->recover_work); + tilcdc_write(dev, LCDC_INT_ENABLE_CLR_REG, + LCDC_SYNC_LOST); ++ tilcdc_crtc->sync_lost_count = 0; + } + } + +@@ -775,6 +800,7 @@ struct drm_crtc *tilcdc_crtc_create(struct drm_device *dev) + "unref", unref_worker); + + spin_lock_init(&tilcdc_crtc->irq_lock); ++ INIT_WORK(&tilcdc_crtc->recover_work, tilcdc_crtc_recover_work); + + ret = drm_crtc_init(dev, crtc, &tilcdc_crtc_funcs); + if (ret < 0) +-- +2.8.0.rc3 + diff --git a/patches/defconfig b/patches/defconfig index d2bcd6579a9999516e68045d96c6f271acfc5097..f2efde1f8a9fb162c769aabe020f4dba13cab1d1 100644 --- a/patches/defconfig +++ b/patches/defconfig @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.6.0-rc2 Kernel Configuration +# Linux/arm 4.6.0-rc3 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -2213,13 +2213,14 @@ CONFIG_HOSTAP_FIRMWARE=y # CONFIG_HOSTAP_FIRMWARE_NVRAM is not set CONFIG_P54_COMMON=m CONFIG_P54_USB=m -# CONFIG_P54_SPI is not set +CONFIG_P54_SPI=m +# CONFIG_P54_SPI_DEFAULT_EEPROM is not set CONFIG_P54_LEDS=y CONFIG_WLAN_VENDOR_MARVELL=y CONFIG_LIBERTAS=m CONFIG_LIBERTAS_USB=m CONFIG_LIBERTAS_SDIO=m -# CONFIG_LIBERTAS_SPI is not set +CONFIG_LIBERTAS_SPI=m # CONFIG_LIBERTAS_DEBUG is not set CONFIG_LIBERTAS_MESH=y CONFIG_LIBERTAS_THINFIRM=m @@ -2260,10 +2261,12 @@ CONFIG_RTL8XXXU=m CONFIG_WLAN_VENDOR_RSI=y CONFIG_RSI_91X=m CONFIG_RSI_DEBUGFS=y -# CONFIG_RSI_SDIO is not set +CONFIG_RSI_SDIO=m CONFIG_RSI_USB=m CONFIG_WLAN_VENDOR_ST=y -# CONFIG_CW1200 is not set +CONFIG_CW1200=m +CONFIG_CW1200_WLAN_SDIO=m +CONFIG_CW1200_WLAN_SPI=m CONFIG_WLAN_VENDOR_TI=y CONFIG_WL1251=m CONFIG_WL1251_SPI=m @@ -3983,7 +3986,6 @@ CONFIG_SND_ARM=y CONFIG_SND_SPI=y CONFIG_SND_USB=y CONFIG_SND_USB_AUDIO=m -CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER=y CONFIG_SND_USB_UA101=m CONFIG_SND_USB_CAIAQ=m CONFIG_SND_USB_CAIAQ_INPUT=y @@ -5811,7 +5813,11 @@ CONFIG_DYNAMIC_DEBUG=y # # Compile-time checks and compiler options # -# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_INFO_REDUCED is not set +CONFIG_DEBUG_INFO_SPLIT=y +CONFIG_DEBUG_INFO_DWARF4=y +# CONFIG_GDB_SCRIPTS is not set CONFIG_ENABLE_WARN_DEPRECATED=y CONFIG_ENABLE_MUST_CHECK=y CONFIG_FRAME_WARN=1024 diff --git a/patches/defconfig-bone b/patches/defconfig-bone index 39ae32252188fc60f2d3b96b8c20685032e6f0d6..1870cdb0507ddf288a6b4c51b6833fbf8204a5df 100644 --- a/patches/defconfig-bone +++ b/patches/defconfig-bone @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.6.0-rc2 Kernel Configuration +# Linux/arm 4.6.0-rc3 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -2213,13 +2213,14 @@ CONFIG_HOSTAP_FIRMWARE=y # CONFIG_HOSTAP_FIRMWARE_NVRAM is not set CONFIG_P54_COMMON=m CONFIG_P54_USB=m -# CONFIG_P54_SPI is not set +CONFIG_P54_SPI=m +# CONFIG_P54_SPI_DEFAULT_EEPROM is not set CONFIG_P54_LEDS=y CONFIG_WLAN_VENDOR_MARVELL=y CONFIG_LIBERTAS=m CONFIG_LIBERTAS_USB=m CONFIG_LIBERTAS_SDIO=m -# CONFIG_LIBERTAS_SPI is not set +CONFIG_LIBERTAS_SPI=m # CONFIG_LIBERTAS_DEBUG is not set CONFIG_LIBERTAS_MESH=y CONFIG_LIBERTAS_THINFIRM=m @@ -2260,10 +2261,12 @@ CONFIG_RTL8XXXU=m CONFIG_WLAN_VENDOR_RSI=y CONFIG_RSI_91X=m CONFIG_RSI_DEBUGFS=y -# CONFIG_RSI_SDIO is not set +CONFIG_RSI_SDIO=m CONFIG_RSI_USB=m CONFIG_WLAN_VENDOR_ST=y -# CONFIG_CW1200 is not set +CONFIG_CW1200=m +CONFIG_CW1200_WLAN_SDIO=m +CONFIG_CW1200_WLAN_SPI=m CONFIG_WLAN_VENDOR_TI=y CONFIG_WL1251=m CONFIG_WL1251_SPI=m @@ -3983,7 +3986,6 @@ CONFIG_SND_ARM=y CONFIG_SND_SPI=y CONFIG_SND_USB=y CONFIG_SND_USB_AUDIO=m -CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER=y CONFIG_SND_USB_UA101=m CONFIG_SND_USB_CAIAQ=m CONFIG_SND_USB_CAIAQ_INPUT=y @@ -5812,7 +5814,11 @@ CONFIG_DYNAMIC_DEBUG=y # # Compile-time checks and compiler options # -# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_INFO_REDUCED is not set +CONFIG_DEBUG_INFO_SPLIT=y +CONFIG_DEBUG_INFO_DWARF4=y +# CONFIG_GDB_SCRIPTS is not set CONFIG_ENABLE_WARN_DEPRECATED=y CONFIG_ENABLE_MUST_CHECK=y CONFIG_FRAME_WARN=1024 diff --git a/patches/ref_omap2plus_defconfig b/patches/ref_omap2plus_defconfig index 4d9c91b989dd7adaaefa7f69171cab552ab777a8..a348175b7ea2865563327130e859094288e571a1 100644 --- a/patches/ref_omap2plus_defconfig +++ b/patches/ref_omap2plus_defconfig @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.6.0-rc2 Kernel Configuration +# Linux/arm 4.6.0-rc3 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -2778,7 +2778,6 @@ CONFIG_SND_ARM=y CONFIG_SND_SPI=y CONFIG_SND_USB=y CONFIG_SND_USB_AUDIO=m -CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER=y # CONFIG_SND_USB_UA101 is not set # CONFIG_SND_USB_CAIAQ is not set # CONFIG_SND_USB_6FIRE is not set @@ -3769,7 +3768,6 @@ CONFIG_TI_AM335X_ADC=m # CONFIG_ADIS16400 is not set # CONFIG_ADIS16480 is not set # CONFIG_KMX61 is not set -# CONFIG_INV_MPU6050_I2C is not set # CONFIG_INV_MPU6050_SPI is not set # diff --git a/patches/ti/dtbs/0001-sync-with-ti-4.4.patch b/patches/ti/dtbs/0001-sync-with-ti-4.4.patch new file mode 100644 index 0000000000000000000000000000000000000000..2bf0d89e6592ca3d4c432815debc69c08d99338f --- /dev/null +++ b/patches/ti/dtbs/0001-sync-with-ti-4.4.patch @@ -0,0 +1,25 @@ +From 28fee62f8f743b83642d3f72920b8c60306cefd9 Mon Sep 17 00:00:00 2001 +From: Robert Nelson <robertcnelson@gmail.com> +Date: Mon, 4 Apr 2016 11:06:52 -0500 +Subject: [PATCH] sync: with ti-4.4 + +Signed-off-by: Robert Nelson <robertcnelson@gmail.com> +--- + arch/arm/boot/dts/am335x-bone-common.dtsi | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi +index 5d370d5..38e19ab 100644 +--- a/arch/arm/boot/dts/am335x-bone-common.dtsi ++++ b/arch/arm/boot/dts/am335x-bone-common.dtsi +@@ -393,3 +393,7 @@ + &sham { + status = "okay"; + }; ++ ++&rtc { ++ system-power-controller; ++}; +-- +2.8.0.rc3 + diff --git a/version.sh b/version.sh index ecdd055133662f25566a08d87644fa005ecfc7c6..cf45818e7b50bb79dbff401027427762c2e8c1d9 100644 --- a/version.sh +++ b/version.sh @@ -24,7 +24,7 @@ toolchain="gcc_linaro_gnueabihf_5" #Kernel/Build KERNEL_REL=4.6 -KERNEL_TAG=${KERNEL_REL}-rc2 +KERNEL_TAG=${KERNEL_REL}-rc3 BUILD=${build_prefix}1 kernel_rt=".X-rtY"