socsvn commit: r240444 - in soc2012/aleek/beaglexm-armv6/sys:
arm/conf arm/ti arm/ti/twl boot/fdt/dts
aleek at FreeBSD.org
aleek at FreeBSD.org
Thu Aug 16 20:00:07 UTC 2012
Author: aleek
Date: Thu Aug 16 20:00:04 2012
New Revision: 240444
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=240444
Log:
refactoring part 1 - common.c and DTS file
Modified:
soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM
soc2012/aleek/beaglexm-armv6/sys/arm/ti/common.c
soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c
soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl.c
soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c
soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts
Modified: soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM Thu Aug 16 18:31:50 2012 (r240443)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/conf/BEAGLEBOARD-XM Thu Aug 16 20:00:04 2012 (r240444)
@@ -63,20 +63,6 @@
options DEBUG
-# NFS support
-#options NFSCL
-#options NFSSERVER #Network Filesystem Server
-#options NFSCLIENT #Network Filesystem Client
-
-# Uncomment this for NFS root
-#options NFS_ROOT #NFS usable as /, requires NFSCLIENT
-#options BOOTP_NFSROOT
-#options BOOTP_COMPAT
-#options BOOTP
-#options BOOTP_NFSV3
-#options BOOTP_WIRED_TO=cpsw0
-
-
# MMC/SD/SDIO card slot support
device mmc # mmc/sd bus
device mmcsd # mmc/sd flash cards
@@ -129,8 +115,3 @@
options FDT
options FDT_DTB_STATIC
makeoptions FDT_DTS_FILE=beagleboardxm.dts
-
-#options MD_ROOT
-#options MD_ROOT_SIZE=8192
-#makeoptions MFS_IMAGE=/home/alek/beaglexm-armv6/arm.ramfs
-#options ROOTDEVNAME=\"ufs:md0\"
Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/common.c
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/ti/common.c Thu Aug 16 18:31:50 2012 (r240443)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/common.c Thu Aug 16 20:00:04 2012 (r240444)
@@ -91,12 +91,8 @@
#ifdef SOC_OMAP4
&fdt_gic_decode_ic,
#endif
-#ifdef SOC_TI_AM335X
+#if defined( SOC_TI_AM335X ) || defined( SOC_TI_AM37X )
&fdt_aintc_decode_ic,
#endif
-#ifdef SOC_TI_AM37X
- &fdt_aintc_decode_ic,
-#endif
-
NULL
};
Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c Thu Aug 16 18:31:50 2012 (r240443)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/ti_i2c.c Thu Aug 16 20:00:04 2012 (r240444)
@@ -403,13 +403,16 @@
int start_ticks = ticks;
int rc;
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
TI_I2C_ASSERT_LOCKED(sc);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* check if the condition has already occured, the interrupt routine will
* clear the status flags.
*/
if ((sc->sc_stat_flags & flags) == 0) {
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* condition(s) haven't occured so sleep on the IRQ */
while (waittime > 0) {
@@ -431,6 +434,7 @@
}
}
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* copy the actual status bits */
if (statp != NULL)
*statp = sc->sc_stat_flags;
@@ -505,12 +509,14 @@
uint32_t sofar = 0;
uint32_t i;
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* wait for the bus to become free */
err = ti_i2c_wait_for_free_bus(sc, timo);
if (err != 0) {
device_printf(sc->sc_dev, "bus never freed\n");
return (err);
}
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* set the events to wait for */
events = I2C_IE_RDR | /* Receive draining interrupt */
@@ -522,9 +528,11 @@
/* enable interrupts for the events we want */
ti_i2c_set_intr_enable(sc, events);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* write the number of bytes to read */
ti_i2c_write_reg(sc, I2C_REG_CNT, len);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* clear the write bit and initiate the read transaction. Setting the STT
* (start) bit initiates the transfer.
*/
@@ -533,15 +541,18 @@
con_reg |= I2C_CON_MST | I2C_CON_STT | I2C_CON_STP;
ti_i2c_write_reg(sc, I2C_REG_CON, con_reg);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* reading loop */
while (1) {
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* wait for an event */
err = ti_i2c_wait(sc, events, &status, timo);
if (err != 0) {
break;
}
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* check for the error conditions */
if (status & I2C_STAT_NACK) {
/* no ACK from slave */
@@ -600,6 +611,7 @@
ti_i2c_write_reg(sc, I2C_REG_STAT, I2C_STAT_RDR | I2C_STAT_RRDY);
}
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* reset the registers regardless if there was an error or not */
ti_i2c_set_intr_enable(sc, 0x0000);
ti_i2c_write_reg(sc, I2C_REG_CON, I2C_CON_I2C_EN | I2C_CON_MST | I2C_CON_STP);
@@ -634,10 +646,12 @@
uint32_t sofar = 0;
uint32_t i;
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* wait for the bus to become free */
err = ti_i2c_wait_for_free_bus(sc, timo);
if (err != 0)
return (err);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* set the events to wait for */
events = I2C_IE_XDR | /* Transmit draining interrupt */
@@ -649,9 +663,11 @@
/* enable interrupts for the events we want*/
ti_i2c_set_intr_enable(sc, events);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* write the number of bytes to write */
ti_i2c_write_reg(sc, I2C_REG_CNT, len);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* set the write bit and initiate the write transaction. Setting the STT
* (start) bit initiates the transfer.
*/
@@ -662,6 +678,7 @@
/* writing loop */
while (1) {
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* wait for an event */
err = ti_i2c_wait(sc, events, &status, timo);
if (err != 0) {
@@ -1104,6 +1121,7 @@
device_printf(dev, "I2C revision %d.%d\n", sc->sc_rev >> 4,
sc->sc_rev & 0xf);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* Activate the H/W */
err = ti_i2c_activate(dev);
if (err) {
@@ -1111,19 +1129,23 @@
goto out;
}
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* activate the interrupt */
err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
NULL, ti_i2c_intr, sc, &sc->sc_irq_h);
if (err)
goto out;
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* Attach to the iicbus */
if ((sc->sc_iicbus = device_add_child(dev, "iicbus", -1)) == NULL)
device_printf(dev, "could not allocate iicbus instance\n");
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* Probe and attach the iicbus */
bus_generic_attach(dev);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
out:
if (err) {
ti_i2c_deactivate(dev);
Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl.c
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl.c Thu Aug 16 18:31:50 2012 (r240443)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl.c Thu Aug 16 20:00:04 2012 (r240444)
@@ -280,6 +280,7 @@
{
struct iic_msg msg;
uint8_t tmp;
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
/* Set the address to read from */
msg.slave = addr;
@@ -290,6 +291,7 @@
if (iicbus_transfer(sc->sc_dev, &msg, 1) != 0)
return (EIO);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
return (0);
}
@@ -312,6 +314,7 @@
uint8_t base = TWL_CHIP_ID0;
sc = device_get_softc((device_t)dev);
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
memset(devs, TWL_INVALID_CHIP_ID, TWL_MAX_SUBADDRS);
@@ -324,6 +327,7 @@
device_printf(sc->sc_dev, "Found (sub)device at 0x%02x\n", (base + i));
}
}
+ device_printf(sc->sc_dev, "%s:%d\n", __func__, __LINE__);
TWL_LOCK(sc);
memcpy(sc->sc_subaddr_map, devs, TWL_MAX_SUBADDRS);
Modified: soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c Thu Aug 16 18:31:50 2012 (r240443)
+++ soc2012/aleek/beaglexm-armv6/sys/arm/ti/twl/twl_vreg.c Thu Aug 16 20:00:04 2012 (r240444)
@@ -1016,7 +1016,7 @@
TWL_VREG_XUNLOCK(sc);
- config_intrhook_disestablish(&sc->sc_init_hook);
+ //config_intrhook_disestablish(&sc->sc_init_hook);
}
static int
@@ -1049,12 +1049,12 @@
/* We have to wait until interrupts are enabled. I2C read and write
* only works if the interrupts are available.
*/
- sc->sc_init_hook.ich_func = twl_vreg_init;
- sc->sc_init_hook.ich_arg = dev;
+ //sc->sc_init_hook.ich_func = twl_vreg_init;
+ //sc->sc_init_hook.ich_arg = dev;
- if (config_intrhook_establish(&sc->sc_init_hook) != 0)
- return (ENOMEM);
- //twl_vreg_init( dev );
+ //if (config_intrhook_establish(&sc->sc_init_hook) != 0)
+ // return (ENOMEM);
+ twl_vreg_init( dev );
return (0);
}
Modified: soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts
==============================================================================
--- soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts Thu Aug 16 18:31:50 2012 (r240443)
+++ soc2012/aleek/beaglexm-armv6/sys/boot/fdt/dts/beagleboardxm.dts Thu Aug 16 20:00:04 2012 (r240444)
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2012 Damjan Marion <dmarion at Freebsd.org>
+ * Copyright (c) 2012 Aleksander Dutkowski <aleek at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -64,8 +64,8 @@
reg = < 0x48002000 0x2000 >;
/* Set of triplets < padname, muxname, padstate> */
scm-pad-config =
- /* USB */
-
+ /* USB OTG */
+ /*
"af10", "hsusb1_stp", "output",
"ae10", "hsusb1_clk", "output",
"af9", "hsusb1_dir", "input_pulldown",
@@ -78,11 +78,12 @@
"ah9", "hsusb1_data5", "input_pulldown",
"af13", "hsusb1_data6", "input_pulldown",
"ae13", "hsusb1_data7", "input_pulldown",
+ */
+ /* USB HS */
"af7", "hsusb2_stp", "output",
"ag7", "hsusb2_dir", "input_pulldown",
"ah7", "hsusb2_nxt", "input_pulldown",
-
"ag8", "hsusb2_data0", "input_pulldown",
"ah8", "hsusb2_data1", "input_pulldown",
"ab2", "hsusb2_data2", "input_pulldown",
@@ -91,10 +92,8 @@
"y3", "hsusb2_data5", "input_pulldown",
"y4", "hsusb2_data6", "input_pulldown",
"aa3", "hsusb2_data7", "input_pulldown",
-
"ad25", "gpio_147", "output",
"ae7", "hsusb2_clk", "output",
- /*"r8", "gpio_56", "output",/*
/* i2c */
"ic11", "i2c1_scl", "output",
@@ -124,26 +123,7 @@
interrupts = < 29 30 31 32 33 34 >;
interrupt-parent = <&AINTC>;
};
-/*
- gptimers at 48318000 {
- compatible = "ti,omap3_gptimer";
- #address-cells = <1>;
- #size-cells = <1>;
- reg = < 0x48318000 0x1000
- 0x49032000 0x1000
- 0x49034000 0x1000
- 0x49036000 0x1000
- 0x49038000 0x1000
- 0x4903a000 0x1000
- 0x4903c000 0x1000
- 0x4903e000 0x1000
- 0x49040000 0x1000
- 0x48086000 0x1000
- 0x48088000 0x1000 >;
- interrupts = < 37 38 39 40 41 42 43 >;
- interrupt-parent = <&AINTC>;
- };
-*/
+
gptimer_et at 48086000 {
compatible = "ti,omap3_gptimer_et";
#address-cells = <1>;
More information about the svn-soc-all
mailing list