* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "qemu-common.h"
#include "devices.h"
#include "flash.h"
#include "hw.h"
+#include "bt.h"
/* Nokia N8x0 support */
struct n800_s {
#define N8X0_BD_ADDR 0x00, 0x1a, 0x89, 0x9e, 0x3e, 0x81
-typedef struct {
- uint8_t b[6];
-} __attribute__((packed)) bdaddr_t; /* XXX: move to BT headers */
-
static void n800_mmc_cs_cb(void *opaque, int line, int level)
{
/* TODO: this seems to actually be connected to the menelaus, to
cpu_abort(cpu_single_env, "%s: FIXME: bad SPI word width %i\n",
__FUNCTION__, len);
- if (s->p >= sizeof(s->resp) / sizeof(*s->resp))
+ if (s->p >= ARRAY_SIZE(s->resp))
ret = 0;
else
ret = s->resp[s->p ++];
cbus_attach(cbus, s->tahvo = tahvo_init(tahvo_irq, 1));
}
+static void n8x0_uart_setup(struct n800_s *s)
+{
+ CharDriverState *radio = uart_hci_init(
+ omap2_gpio_in_get(s->cpu->gpif,
+ N8X0_BT_HOST_WKUP_GPIO)[0]);
+
+ omap2_gpio_out_set(s->cpu->gpif, N8X0_BT_RESET_GPIO,
+ csrhci_pins_get(radio)[csrhci_pin_reset]);
+ omap2_gpio_out_set(s->cpu->gpif, N8X0_BT_WKUP_GPIO,
+ csrhci_pins_get(radio)[csrhci_pin_wakeup]);
+
+ omap_uart_attach(s->cpu->uart[BT_UART], radio);
+}
+
static void n8x0_usb_power_cb(void *opaque, int line, int level)
{
struct n800_s *s = opaque;
/* OMAP STI console? Pin out settings? */
ADD_TAG(0x6e01, 414);
- for (i = 0; i < sizeof(n800_pinout) / 4; i ++)
+ for (i = 0; i < ARRAY_SIZE(n800_pinout); i ++)
stl_raw(v ++, n800_pinout[i]);
/* Kernel memsize? */
n8x0_spi_setup(s);
n8x0_dss_setup(s, ds);
n8x0_cbus_setup(s);
+ n8x0_uart_setup(s);
if (usb_enabled)
n8x0_usb_setup(s);
/* FIXME: We shouldn't really be doing this here. The LCD controller
will set the size once configured, so this just sets an initial
size until the guest activates the display. */
- dpy_resize(ds, 800, 480);
+ ds->surface = qemu_resize_displaysurface(ds->surface, 800, 480, 32, 4 * 800);
+ dpy_resize(ds);
}
static struct arm_boot_info n800_binfo = {
}
QEMUMachine n800_machine = {
- "n800",
- "Nokia N800 tablet aka. RX-34 (OMAP2420)",
- n800_init,
- (0x08000000 + 0x00010000 + OMAP242X_SRAM_SIZE) | RAMSIZE_FIXED,
+ .name = "n800",
+ .desc = "Nokia N800 tablet aka. RX-34 (OMAP2420)",
+ .init = n800_init,
+ .ram_require = (0x08000000 + 0x00010000 + OMAP242X_SRAM_SIZE) |
+ RAMSIZE_FIXED,
};
QEMUMachine n810_machine = {
- "n810",
- "Nokia N810 tablet aka. RX-44 (OMAP2420)",
- n810_init,
- (0x08000000 + 0x00010000 + OMAP242X_SRAM_SIZE) | RAMSIZE_FIXED,
+ .name = "n810",
+ .desc = "Nokia N810 tablet aka. RX-44 (OMAP2420)",
+ .init = n810_init,
+ .ram_require = (0x08000000 + 0x00010000 + OMAP242X_SRAM_SIZE) |
+ RAMSIZE_FIXED,
};