vapier | 1 Aug 2010 08:42
Favicon

[4751] trunk/binutils-2.17/sim/bfin: sim: add gptimer/ ppi stubs so default bf527-ezkit can boot up (has a splash screen)

Diff

Modified: trunk/binutils-2.17/sim/bfin/Makefile.in (4750 => 4751)

--- trunk/binutils-2.17/sim/bfin/Makefile.in 2010-07-31 05:15:31 UTC (rev 4750) +++ trunk/binutils-2.17/sim/bfin/Makefile.in 2010-08-01 06:42:14 UTC (rev 4751) <at> <at> -59,8 +59,10 <at> <at> dv-bfin_ebiu_sdc.o: dv-bfin_ebiu_sdc.c devices.h $(INCLUDE) dv-bfin_emac.o: dv-bfin_emac.c devices.h $(INCLUDE) dv-bfin_evt.o: dv-bfin_evt.c devices.h $(INCLUDE) +dv-bfin_gptimer.o: dv-bfin_gptimer.c devices.h $(INCLUDE) dv-bfin_mmu.o: dv-bfin_mmu.c devices.h $(INCLUDE) dv-bfin_pll.o: dv-bfin_pll.c devices.h $(INCLUDE) +dv-bfin_ppi.o: dv-bfin_ppi.c devices.h $(INCLUDE) dv-bfin_rtc.o: dv-bfin_rtc.c devices.h $(INCLUDE) dv-bfin_sic.o: dv-bfin_sic.c devices.h $(INCLUDE) dv-bfin_trace.o: dv-bfin_trace.c devices.h $(INCLUDE)

Modified: trunk/binutils-2.17/sim/bfin/configure.ac (4750 => 4751)

--- trunk/binutils-2.17/sim/bfin/configure.ac 2010-07-31 05:15:31 UTC (rev 4750) +++ trunk/binutils-2.17/sim/bfin/configure.ac 2010-08-01 06:42:14 UTC (rev 4751) <at> <at> -26,8 +26,10 <at> <at> bfin_ebiu_sdc \ bfin_emac \ bfin_evt \ + bfin_gptimer \ bfin_mmu \ bfin_pll \ + bfin_ppi \ bfin_rtc \ bfin_sic \ bfin_trace \

Added: trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.c (0 => 4751)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.c (rev 0) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.c 2010-08-01 06:42:14 UTC (rev 4751) <at> <at> -0,0 +1,182 <at> <at> +/* Blackfin General Purpose Timers (GPtimer) model + + Copyright (C) 2010 Free Software Foundation, Inc. + Contributed by Analog Devices, Inc. + + This file is part of simulators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "config.h" + +#include "sim-main.h" +#include "devices.h" +#include "dv-bfin_gptimer.h" + +/* XXX: This is merely a stub. */ + +struct bfin_gptimer +{ + /* This top portion matches common dv_bfin struct. */ + bu32 base; + struct hw *dma_master; + bool acked; + + struct hw_event *handler; + char saved_byte; + int saved_count; + + /* Order after here is important -- matches hardware MMR layout. */ + bu16 BFIN_MMR_16(config); + bu32 counter, period, width; +}; +#define mmr_base() offsetof(struct bfin_gptimer, config) +#define mmr_offset(mmr) (offsetof(struct bfin_gptimer, mmr) - mmr_base()) + +static const char * const mmr_names[] = { + "TIMER_CONFIG", "TIMER_COUNTER", "TIMER_PERIOD", "TIMER_WIDTH", +}; +#define mmr_name(off) mmr_names[(off) / 4] + +static unsigned +bfin_gptimer_io_write_buffer (struct hw *me, const void *source, int space, + address_word addr, unsigned nr_bytes) +{ + struct bfin_gptimer *gptimer = hw_data (me); + bu32 mmr_off; + bu32 value; + bu16 *value16p; + bu32 *value32p; + void *valuep; + + if (nr_bytes == 4) + value = dv_load_4 (source); + else + value = dv_load_2 (source); + + mmr_off = addr - gptimer->base; + valuep = (void *)((unsigned long)gptimer + mmr_base() + mmr_off); + value16p = valuep; + value32p = valuep; + + HW_TRACE_WRITE (); + + switch (mmr_off) + { + case mmr_offset(config): + dv_bfin_mmr_require_16 (me, addr, nr_bytes, true); + *value16p = value; + break; + case mmr_offset(counter): + case mmr_offset(period): + case mmr_offset(width): + dv_bfin_mmr_require_32 (me, addr, nr_bytes, true); + *value32p = value; + break; + default: + dv_bfin_mmr_invalid (me, addr, nr_bytes, true); + break; + } + + return nr_bytes; +} + +static unsigned +bfin_gptimer_io_read_buffer (struct hw *me, void *dest, int space, + address_word addr, unsigned nr_bytes) +{ + struct bfin_gptimer *gptimer = hw_data (me); + bu32 mmr_off; + bu16 *value16p; + bu32 *value32p; + void *valuep; + + mmr_off = addr - gptimer->base; + valuep = (void *)((unsigned long)gptimer + mmr_base() + mmr_off); + value16p = valuep; + value32p = valuep; + + HW_TRACE_READ (); + + switch (mmr_off) + { + case mmr_offset(config): + dv_bfin_mmr_require_16 (me, addr, nr_bytes, true); + dv_store_2 (dest, *value16p); + break; + case mmr_offset(counter): + case mmr_offset(period): + case mmr_offset(width): + dv_bfin_mmr_require_32 (me, addr, nr_bytes, true); + dv_store_4 (dest, *value32p); + break; + default: + dv_bfin_mmr_invalid (me, addr, nr_bytes, false); + break; + } + + return nr_bytes; +} + +static const struct hw_port_descriptor bfin_gptimer_ports[] = { + { "stat", 0, 0, output_port, }, +}; + +static void +attach_bfin_gptimer_regs (struct hw *me, struct bfin_gptimer *gptimer) +{ + address_word attach_address; + int attach_space; + unsigned attach_size; + reg_property_spec reg; + + if (hw_find_property (me, "reg") == NULL) + hw_abort (me, "Missing \"reg\" property"); + + if (!hw_find_reg_array_property (me, "reg", 0, &reg)) + hw_abort (me, "\"reg\" property must contain three addr/size entries"); + + hw_unit_address_to_attach_address (hw_parent (me), + &reg.address, + &attach_space, &attach_address, me); + hw_unit_size_to_attach_size (hw_parent (me), &reg.size, &attach_size, me); + + if (attach_size != BFIN_MMR_GPTIMER_SIZE) + hw_abort (me, "\"reg\" size must be %#x", BFIN_MMR_GPTIMER_SIZE); + + hw_attach_address (hw_parent (me), + 0, attach_space, attach_address, attach_size, me); + + gptimer->base = attach_address; +} + +static void +bfin_gptimer_finish (struct hw *me) +{ + struct bfin_gptimer *gptimer; + + gptimer = HW_ZALLOC (me, struct bfin_gptimer); + + set_hw_data (me, gptimer); + set_hw_io_read_buffer (me, bfin_gptimer_io_read_buffer); + set_hw_io_write_buffer (me, bfin_gptimer_io_write_buffer); + set_hw_ports (me, bfin_gptimer_ports); + + attach_bfin_gptimer_regs (me, gptimer); +} + +const struct hw_descriptor dv_bfin_gptimer_descriptor[] = { + {"bfin_gptimer", bfin_gptimer_finish,}, + {NULL, NULL}, +};

Added: trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.h (0 => 4751)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.h (rev 0) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.h 2010-08-01 06:42:14 UTC (rev 4751) <at> <at> -0,0 +1,27 <at> <at> +/* Blackfin General Purpose Timers (GPtimer) model + + Copyright (C) 2010 Free Software Foundation, Inc. + Contributed by Analog Devices, Inc. + + This file is part of simulators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef DV_BFIN_GPTIMER_H +#define DV_BFIN_GPTIMER_H + +/* XXX: This should be pushed into the model data. */ +#define BFIN_MMR_GPTIMER_SIZE (4 * 4) + +#endif

Added: trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.c (0 => 4751)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.c (rev 0) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.c 2010-08-01 06:42:14 UTC (rev 4751) <at> <at> -0,0 +1,198 <at> <at> +/* Blackfin Parallel Port Interface (PPI) model + For "old style" PPIs on BF53x/etc... parts. + + Copyright (C) 2010 Free Software Foundation, Inc. + Contributed by Analog Devices, Inc. + + This file is part of simulators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include "config.h" + +#include "sim-main.h" +#include "devices.h" +#include "dv-bfin_ppi.h" + +/* XXX: This is merely a stub. Maybe put a simple SDL window up ? */ + +struct bfin_ppi +{ + /* This top portion matches common dv_bfin struct. */ + bu32 base; + struct hw *dma_master; + bool acked; + + struct hw_event *handler; + char saved_byte; + int saved_count; + + /* Order after here is important -- matches hardware MMR layout. */ + bu16 BFIN_MMR_16(control); + bu16 BFIN_MMR_16(status); + bu16 BFIN_MMR_16(count); + bu16 BFIN_MMR_16(delay); + bu16 BFIN_MMR_16(frame); +}; +#define mmr_base() offsetof(struct bfin_ppi, control) +#define mmr_offset(mmr) (offsetof(struct bfin_ppi, mmr) - mmr_base()) + +static const char * const mmr_names[] = { + "PPI_CONTROL", "PPI_STATUS", "PPI_COUNT", "PPI_DELAY", "PPI_FRAME", +}; +#define mmr_name(off) mmr_names[(off) / 4] + +static unsigned +bfin_ppi_io_write_buffer (struct hw *me, const void *source, + int space, address_word addr, unsigned nr_bytes) +{ + struct bfin_ppi *ppi = hw_data (me); + bu32 mmr_off; + bu32 value; + bu16 *valuep; + + value = dv_load_2 (source); + mmr_off = addr - ppi->base; + valuep = (void *)((unsigned long)ppi + mmr_base() + mmr_off); + + HW_TRACE_WRITE (); + + dv_bfin_mmr_require_16 (me, addr, nr_bytes, true); + + switch (mmr_off) + { + case mmr_offset(control): + case mmr_offset(count): + case mmr_offset(delay): + case mmr_offset(frame): + *valuep = value; + break; + case mmr_offset(status): + dv_w1c_2 (valuep, value, (1 << 10)); + break; + default: + dv_bfin_mmr_invalid (me, addr, nr_bytes, true); + break; + } + + return nr_bytes; +} + +static unsigned +bfin_ppi_io_read_buffer (struct hw *me, void *dest, + int space, address_word addr, unsigned nr_bytes) +{ + struct bfin_ppi *ppi = hw_data (me); + bu32 mmr_off; + bu16 *valuep; + + mmr_off = addr - ppi->base; + valuep = (void *)((unsigned long)ppi + mmr_base() + mmr_off); + + HW_TRACE_READ (); + + dv_bfin_mmr_require_16 (me, addr, nr_bytes, false); + + switch (mmr_off) + { + case mmr_offset(control): + case mmr_offset(count): + case mmr_offset(delay): + case mmr_offset(frame): + case mmr_offset(status): + dv_store_2 (dest, *valuep); + break; + default: + dv_bfin_mmr_invalid (me, addr, nr_bytes, false); + break; + } + + return nr_bytes; +} + +static unsigned +bfin_ppi_dma_read_buffer (struct hw *me, void *dest, int space, + unsigned_word addr, unsigned nr_bytes) +{ + HW_TRACE_DMA_READ (); + return 0; +} + +static unsigned +bfin_ppi_dma_write_buffer (struct hw *me, const void *source, + int space, unsigned_word addr, + unsigned nr_bytes, + int violate_read_only_section) +{ + struct bfin_ppi *ppi = hw_data (me); + unsigned ret; + + HW_TRACE_DMA_WRITE (); + + return 0; +} + +static const struct hw_port_descriptor bfin_ppi_ports[] = { + { "stat", 0, 0, output_port, }, +}; + +static void +attach_bfin_ppi_regs (struct hw *me, struct bfin_ppi *ppi) +{ + address_word attach_address; + int attach_space; + unsigned attach_size; + reg_property_spec reg; + + if (hw_find_property (me, "reg") == NULL) + hw_abort (me, "Missing \"reg\" property"); + + if (!hw_find_reg_array_property (me, "reg", 0, &reg)) + hw_abort (me, "\"reg\" property must contain three addr/size entries"); + + hw_unit_address_to_attach_address (hw_parent (me), + &reg.address, + &attach_space, &attach_address, me); + hw_unit_size_to_attach_size (hw_parent (me), &reg.size, &attach_size, me); + + if (attach_size != BFIN_MMR_PPI_SIZE) + hw_abort (me, "\"reg\" size must be %#x", BFIN_MMR_PPI_SIZE); + + hw_attach_address (hw_parent (me), + 0, attach_space, attach_address, attach_size, me); + + ppi->base = attach_address; +} + +static void +bfin_ppi_finish (struct hw *me) +{ + struct bfin_ppi *ppi; + + ppi = HW_ZALLOC (me, struct bfin_ppi); + + set_hw_data (me, ppi); + set_hw_io_read_buffer (me, bfin_ppi_io_read_buffer); + set_hw_io_write_buffer (me, bfin_ppi_io_write_buffer); + set_hw_dma_read_buffer (me, bfin_ppi_dma_read_buffer); + set_hw_dma_write_buffer (me, bfin_ppi_dma_write_buffer); + set_hw_ports (me, bfin_ppi_ports); + + attach_bfin_ppi_regs (me, ppi); +} + +const struct hw_descriptor dv_bfin_ppi_descriptor[] = { + {"bfin_ppi", bfin_ppi_finish,}, + {NULL, NULL}, +};

Added: trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.h (0 => 4751)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.h (rev 0) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.h 2010-08-01 06:42:14 UTC (rev 4751) <at> <at> -0,0 +1,28 <at> <at> +/* Blackfin Parallel Port Interface (PPI) model + For "old style" PPIs on BF53x/etc... parts. + + Copyright (C) 2010 Free Software Foundation, Inc. + Contributed by Analog Devices, Inc. + + This file is part of simulators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#ifndef DV_BFIN_PPI_H +#define DV_BFIN_PPI_H + +/* XXX: This should be pushed into the model data. */ +#define BFIN_MMR_PPI_SIZE (4 * 5) + +#endif

Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c (4750 => 4751)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c 2010-07-31 05:15:31 UTC (rev 4750) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c 2010-08-01 06:42:14 UTC (rev 4751) <at> <at> -191,7 +191,7 <at> <at> { "emac_stat", 21, 0, input_port, }, { "sport <at> 0_stat", 22, 0, input_port, }, { "sport <at> 1_stat", 23, 0, input_port, }, - { "ppi_stat", 24, 0, input_port, }, + { "ppi", 24, 0, input_port, }, { "spi_stat", 25, 0, input_port, }, { "uart <at> 0_stat", 26, 0, input_port, }, { "uart <at> 1_stat", 27, 0, input_port, }, <at> <at> -213,14 +213,14 <at> <at> { "porth_irq_a", 171, 0, input_port, }, { "dma2", 180, 0, input_port, }, { "porth_irq_b", 181, 0, input_port, }, - { "timer0", 190, 0, input_port, }, - { "timer1", 200, 0, input_port, }, - { "timer0", 210, 0, input_port, }, - { "timer3", 220, 0, input_port, }, - { "timer4", 230, 0, input_port, }, - { "timer5", 240, 0, input_port, }, - { "timer6", 250, 0, input_port, }, - { "timer7", 260, 0, input_port, }, + { "gptimer <at> 0", 190, 0, input_port, }, + { "gptimer <at> 1", 200, 0, input_port, }, + { "gptimer <at> 2", 210, 0, input_port, }, + { "gptimer <at> 3", 220, 0, input_port, }, + { "gptimer <at> 4", 230, 0, input_port, }, + { "gptimer <at> 5", 240, 0, input_port, }, + { "gptimer <at> 6", 250, 0, input_port, }, + { "gptimer <at> 7", 260, 0, input_port, }, { "portf_irq_a", 270, 0, input_port, }, { "portg_irq_a", 271, 0, input_port, }, { "portg_irq_b", 280, 0, input_port, },

Modified: trunk/binutils-2.17/sim/bfin/machs.c (4750 => 4751)

--- trunk/binutils-2.17/sim/bfin/machs.c 2010-07-31 05:15:31 UTC (rev 4750) +++ trunk/binutils-2.17/sim/bfin/machs.c 2010-08-01 06:42:14 UTC (rev 4751) <at> <at> -36,7 +36,9 <at> <at> #include "dv-bfin_ebiu_sdc.h" #include "dv-bfin_emac.h" #include "dv-bfin_evt.h" +#include "dv-bfin_gptimer.h" #include "dv-bfin_mmu.h" +#include "dv-bfin_ppi.h" #include "dv-bfin_pll.h" #include "dv-bfin_rtc.h" #include "dv-bfin_sic.h" <at> <at> -104,6 +106,7 <at> <at> #define bf518_chipid bf51x_chipid static const struct bfin_memory_layout bf51x_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI0 stub */ + LAYOUT (0xFFC00680, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ <at> <at> -122,14 +125,32 <at> <at> #define bf516_mem bf51x_mem #define bf518_mem bf51x_mem static const struct bfin_dev_layout bf512_dev[] = { - DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), - DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), + DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), + DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"), + DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"), + DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"), + DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"), + DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"), + DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"), + DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"), + DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"), + DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE, "bfin_ppi"), + DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), }; #define bf514_dev bf512_dev static const struct bfin_dev_layout bf516_dev[] = { - DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), - DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), - DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE, "bfin_emac"), + DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), + DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"), + DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"), + DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"), + DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"), + DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"), + DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"), + DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"), + DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"), + DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE, "bfin_ppi"), + DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), + DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE, "bfin_emac"), DEVICE (0, 0x20, "bfin_emac/eth_phy"), }; #define bf518_dev bf516_dev <at> <at> -142,6 +163,7 <at> <at> #define bf527_chipid bf523_chipid static const struct bfin_memory_layout bf52x_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ + LAYOUT (0xFFC00680, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ <at> <at> -162,16 +184,34 <at> <at> #define bf526_mem bf52x_mem #define bf527_mem bf52x_mem static const struct bfin_dev_layout bf522_dev[] = { - DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), - DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), + DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), + DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"), + DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"), + DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"), + DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"), + DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"), + DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"), + DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"), + DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"), + DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE, "bfin_ppi"), + DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), }; #define bf523_dev bf522_dev #define bf524_dev bf522_dev #define bf525_dev bf522_dev static const struct bfin_dev_layout bf526_dev[] = { - DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), - DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), - DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE, "bfin_emac"), + DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), + DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"), + DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"), + DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"), + DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"), + DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"), + DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"), + DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"), + DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"), + DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE, "bfin_ppi"), + DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), + DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE, "bfin_emac"), DEVICE (0, 0x20, "bfin_emac/eth_phy"), }; #define bf527_dev bf526_dev <at> <at> -181,6 +221,7 <at> <at> #define bf533_chipid bf531_chipid static const struct bfin_memory_layout bf531_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ + LAYOUT (0xFFC00640, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* GPIO stub */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ LAYOUT (0xFFA08000, 0x4000, read_write_exec), /* Inst B [1] */ <at> <at> -188,6 +229,7 <at> <at> }; static const struct bfin_memory_layout bf532_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ + LAYOUT (0xFFC00640, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* GPIO stub */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ LAYOUT (0xFF904000, 0x4000, read_write), /* Data B Cache */ <at> <at> -197,6 +239,7 <at> <at> }; static const struct bfin_memory_layout bf533_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ + LAYOUT (0xFFC00640, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* GPIO stub */ LAYOUT (0xFF800000, 0x4000, read_write), /* Data A */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ <at> <at> -208,7 +251,11 <at> <at> LAYOUT (0xFFA10000, 0x4000, read_write_exec), /* Inst Cache [1] */ }; static const struct bfin_dev_layout bf533_dev[] = { - DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), + DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), + DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"), + DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"), + DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"), + DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE, "bfin_ppi"), }; #define bf531_dev bf533_dev #define bf532_dev bf533_dev <at> <at> -218,6 +265,7 <at> <at> #define bf537_chipid bf536_chipid static const struct bfin_memory_layout bf534_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ + LAYOUT (0xFFC00680, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ <at> <at> -233,6 +281,7 <at> <at> }; static const struct bfin_memory_layout bf536_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ + LAYOUT (0xFFC00680, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ <at> <at> -246,6 +295,7 <at> <at> }; static const struct bfin_memory_layout bf537_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ + LAYOUT (0xFFC00680, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ <at> <at> -260,13 +310,31 <at> <at> LAYOUT (0xFFA10000, 0x4000, read_write_exec), /* Inst Cache [1] */ }; static const struct bfin_dev_layout bf534_dev[] = { - DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), - DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), + DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), + DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"), + DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"), + DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"), + DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"), + DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"), + DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"), + DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"), + DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"), + DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE, "bfin_ppi"), + DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), }; static const struct bfin_dev_layout bf537_dev[] = { - DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), - DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), - DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE, "bfin_emac"), + DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), + DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"), + DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"), + DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"), + DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"), + DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"), + DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"), + DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"), + DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"), + DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE, "bfin_ppi"), + DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), + DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE, "bfin_emac"), DEVICE (0, 0x20, "bfin_emac/eth_phy"), }; #define bf536_dev bf537_dev <at> <at> -292,9 +360,18 <at> <at> }; #define bf539_mem bf538_mem static const struct bfin_dev_layout bf538_dev[] = { - DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), - DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), - DEVICE (0xFFC02100, BFIN_MMR_UART_SIZE, "bfin_uart <at> 2"), + DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), + DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"), + DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"), + DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"), + DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"), + DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"), + DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"), + DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"), + DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"), + DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE, "bfin_ppi"), + DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), + DEVICE (0xFFC02100, BFIN_MMR_UART_SIZE, "bfin_uart <at> 2"), }; #define bf539_dev bf538_dev <at> <at> -357,6 +434,8 <at> <at> }; static const struct bfin_dev_layout bf561_dev[] = { DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"), + DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE, "bfin_ppi <at> 0"), + DEVICE (0xFFC01300, BFIN_MMR_PPI_SIZE, "bfin_ppi <at> 1"), }; static const struct bfin_model_data bfin_model_data[] = <at> <at> -475,6 +554,16 <at> <at> sim_hw_parse (sd, "/core/%s > rx %s_rx /core/bfin_dmac <at> 0", dev->dev, sint); sim_hw_parse (sd, "/core/%s > stat %s_stat /core/bfin_sic", dev->dev, sint); } + else if (!strncmp (dev->dev, "bfin_gptimer", 12)) + { + const char *sint = dev->dev + 5; + sim_hw_parse (sd, "/core/%s > stat %s /core/bfin_sic", dev->dev, sint); + } + else if (!strncmp (dev->dev, "bfin_ppi", 7)) + { + const char *sint = dev->dev + 5; + sim_hw_parse (sd, "/core/%s > stat %s /core/bfin_sic", dev->dev, sint); + } } done:
<div>

<div>
Revision <a href="http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/?action=browse&amp;path=/&amp;view=rev&amp;root=toolchain&amp;revision=4751">4751</a>
Author <a href="http://blackfin.uclinux.org/gf/user/vapier/">vapier</a>
Date 2010-08-01 02:42:14 -0400 (Sun, 01 Aug 2010)
<h3>Log Message</h3>
sim: add gptimer/ppi stubs so default bf527-ezkit can boot up (has a splash screen)

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfinMakefilein">trunk/binutils-2.17/sim/bfin/Makefile.in</a></li>
<li><a href="#trunkbinutils217simbfinconfigureac">trunk/binutils-2.17/sim/bfin/configure.ac</a></li>
<li><a href="#trunkbinutils217simbfindvbfin_sicc">trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c</a></li>
<li><a href="#trunkbinutils217simbfinmachsc">trunk/binutils-2.17/sim/bfin/machs.c</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfindvbfin_gptimerc">trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.c</a></li>
<li><a href="#trunkbinutils217simbfindvbfin_gptimerh">trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.h</a></li>
<li><a href="#trunkbinutils217simbfindvbfin_ppic">trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.c</a></li>
<li><a href="#trunkbinutils217simbfindvbfin_ppih">trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.h</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/Makefile.in (4750 =&gt; 4751)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/Makefile.in	2010-07-31 05:15:31 UTC (rev 4750)
+++ trunk/binutils-2.17/sim/bfin/Makefile.in	2010-08-01 06:42:14 UTC (rev 4751)
</span><span class="lines"> <at>  <at>  -59,8 +59,10  <at>  <at> 
</span><span class="cx"> dv-bfin_ebiu_sdc.o: dv-bfin_ebiu_sdc.c devices.h $(INCLUDE)
</span><span class="cx"> dv-bfin_emac.o: dv-bfin_emac.c devices.h $(INCLUDE)
</span><span class="cx"> dv-bfin_evt.o: dv-bfin_evt.c devices.h $(INCLUDE)
</span>+dv-bfin_gptimer.o: dv-bfin_gptimer.c devices.h $(INCLUDE)
<span class="cx"> dv-bfin_mmu.o: dv-bfin_mmu.c devices.h $(INCLUDE)
</span><span class="cx"> dv-bfin_pll.o: dv-bfin_pll.c devices.h $(INCLUDE)
</span>+dv-bfin_ppi.o: dv-bfin_ppi.c devices.h $(INCLUDE)
<span class="cx"> dv-bfin_rtc.o: dv-bfin_rtc.c devices.h $(INCLUDE)
</span><span class="cx"> dv-bfin_sic.o: dv-bfin_sic.c devices.h $(INCLUDE)
</span><span class="cx"> dv-bfin_trace.o: dv-bfin_trace.c devices.h $(INCLUDE)
</span></span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/configure.ac (4750 =&gt; 4751)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/configure.ac	2010-07-31 05:15:31 UTC (rev 4750)
+++ trunk/binutils-2.17/sim/bfin/configure.ac	2010-08-01 06:42:14 UTC (rev 4751)
</span><span class="lines"> <at>  <at>  -26,8 +26,10  <at>  <at> 
</span><span class="cx"> 	bfin_ebiu_sdc \
</span><span class="cx"> 	bfin_emac \
</span><span class="cx"> 	bfin_evt \
</span>+	bfin_gptimer \
<span class="cx"> 	bfin_mmu \
</span><span class="cx"> 	bfin_pll \
</span>+	bfin_ppi \
<span class="cx"> 	bfin_rtc \
</span><span class="cx"> 	bfin_sic \
</span><span class="cx"> 	bfin_trace \
</span></span>
</div>
<a></a>
<div class="addfile">
<h4>Added: trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.c (0 =&gt; 4751)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.c	                        (rev 0)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.c	2010-08-01 06:42:14 UTC (rev 4751)
</span><span class="lines"> <at>  <at>  -0,0 +1,182  <at>  <at> 
</span>+/* Blackfin General Purpose Timers (GPtimer) model
+
+   Copyright (C) 2010 Free Software Foundation, Inc.
+   Contributed by Analog Devices, Inc.
+
+   This file is part of simulators.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.  */
+
+#include "config.h"
+
+#include "sim-main.h"
+#include "devices.h"
+#include "dv-bfin_gptimer.h"
+
+/* XXX: This is merely a stub.  */
+
+struct bfin_gptimer
+{
+  /* This top portion matches common dv_bfin struct.  */
+  bu32 base;
+  struct hw *dma_master;
+  bool acked;
+
+  struct hw_event *handler;
+  char saved_byte;
+  int saved_count;
+
+  /* Order after here is important -- matches hardware MMR layout.  */
+  bu16 BFIN_MMR_16(config);
+  bu32 counter, period, width;
+};
+#define mmr_base()      offsetof(struct bfin_gptimer, config)
+#define mmr_offset(mmr) (offsetof(struct bfin_gptimer, mmr) - mmr_base())
+
+static const char * const mmr_names[] = {
+  "TIMER_CONFIG", "TIMER_COUNTER", "TIMER_PERIOD", "TIMER_WIDTH",
+};
+#define mmr_name(off) mmr_names[(off) / 4]
+
+static unsigned
+bfin_gptimer_io_write_buffer (struct hw *me, const void *source, int space,
+			      address_word addr, unsigned nr_bytes)
+{
+  struct bfin_gptimer *gptimer = hw_data (me);
+  bu32 mmr_off;
+  bu32 value;
+  bu16 *value16p;
+  bu32 *value32p;
+  void *valuep;
+
+  if (nr_bytes == 4)
+    value = dv_load_4 (source);
+  else
+    value = dv_load_2 (source);
+
+  mmr_off = addr - gptimer-&gt;base;
+  valuep = (void *)((unsigned long)gptimer + mmr_base() + mmr_off);
+  value16p = valuep;
+  value32p = valuep;
+
+  HW_TRACE_WRITE ();
+
+  switch (mmr_off)
+    {
+    case mmr_offset(config):
+      dv_bfin_mmr_require_16 (me, addr, nr_bytes, true);
+      *value16p = value;
+      break;
+    case mmr_offset(counter):
+    case mmr_offset(period):
+    case mmr_offset(width):
+      dv_bfin_mmr_require_32 (me, addr, nr_bytes, true);
+      *value32p = value;
+      break;
+    default:
+      dv_bfin_mmr_invalid (me, addr, nr_bytes, true);
+      break;
+    }
+
+  return nr_bytes;
+}
+
+static unsigned
+bfin_gptimer_io_read_buffer (struct hw *me, void *dest, int space,
+			     address_word addr, unsigned nr_bytes)
+{
+  struct bfin_gptimer *gptimer = hw_data (me);
+  bu32 mmr_off;
+  bu16 *value16p;
+  bu32 *value32p;
+  void *valuep;
+
+  mmr_off = addr - gptimer-&gt;base;
+  valuep = (void *)((unsigned long)gptimer + mmr_base() + mmr_off);
+  value16p = valuep;
+  value32p = valuep;
+
+  HW_TRACE_READ ();
+
+  switch (mmr_off)
+    {
+    case mmr_offset(config):
+      dv_bfin_mmr_require_16 (me, addr, nr_bytes, true);
+      dv_store_2 (dest, *value16p);
+      break;
+    case mmr_offset(counter):
+    case mmr_offset(period):
+    case mmr_offset(width):
+      dv_bfin_mmr_require_32 (me, addr, nr_bytes, true);
+      dv_store_4 (dest, *value32p);
+      break;
+    default:
+      dv_bfin_mmr_invalid (me, addr, nr_bytes, false);
+      break;
+    }
+
+  return nr_bytes;
+}
+
+static const struct hw_port_descriptor bfin_gptimer_ports[] = {
+  { "stat", 0, 0, output_port, },
+};
+
+static void
+attach_bfin_gptimer_regs (struct hw *me, struct bfin_gptimer *gptimer)
+{
+  address_word attach_address;
+  int attach_space;
+  unsigned attach_size;
+  reg_property_spec reg;
+
+  if (hw_find_property (me, "reg") == NULL)
+    hw_abort (me, "Missing \"reg\" property");
+
+  if (!hw_find_reg_array_property (me, "reg", 0, &amp;reg))
+    hw_abort (me, "\"reg\" property must contain three addr/size entries");
+
+  hw_unit_address_to_attach_address (hw_parent (me),
+				     &amp;reg.address,
+				     &amp;attach_space, &amp;attach_address, me);
+  hw_unit_size_to_attach_size (hw_parent (me), &amp;reg.size, &amp;attach_size, me);
+
+  if (attach_size != BFIN_MMR_GPTIMER_SIZE)
+    hw_abort (me, "\"reg\" size must be %#x", BFIN_MMR_GPTIMER_SIZE);
+
+  hw_attach_address (hw_parent (me),
+		     0, attach_space, attach_address, attach_size, me);
+
+  gptimer-&gt;base = attach_address;
+}
+
+static void
+bfin_gptimer_finish (struct hw *me)
+{
+  struct bfin_gptimer *gptimer;
+
+  gptimer = HW_ZALLOC (me, struct bfin_gptimer);
+
+  set_hw_data (me, gptimer);
+  set_hw_io_read_buffer (me, bfin_gptimer_io_read_buffer);
+  set_hw_io_write_buffer (me, bfin_gptimer_io_write_buffer);
+  set_hw_ports (me, bfin_gptimer_ports);
+
+  attach_bfin_gptimer_regs (me, gptimer);
+}
+
+const struct hw_descriptor dv_bfin_gptimer_descriptor[] = {
+  {"bfin_gptimer", bfin_gptimer_finish,},
+  {NULL, NULL},
+};
</span>
</div>
<a></a>
<div class="addfile">
<h4>Added: trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.h (0 =&gt; 4751)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.h	                        (rev 0)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_gptimer.h	2010-08-01 06:42:14 UTC (rev 4751)
</span><span class="lines"> <at>  <at>  -0,0 +1,27  <at>  <at> 
</span>+/* Blackfin General Purpose Timers (GPtimer) model
+
+   Copyright (C) 2010 Free Software Foundation, Inc.
+   Contributed by Analog Devices, Inc.
+
+   This file is part of simulators.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.  */
+
+#ifndef DV_BFIN_GPTIMER_H
+#define DV_BFIN_GPTIMER_H
+
+/* XXX: This should be pushed into the model data.  */
+#define BFIN_MMR_GPTIMER_SIZE	(4 * 4)
+
+#endif
</span>
</div>
<a></a>
<div class="addfile">
<h4>Added: trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.c (0 =&gt; 4751)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.c	                        (rev 0)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.c	2010-08-01 06:42:14 UTC (rev 4751)
</span><span class="lines"> <at>  <at>  -0,0 +1,198  <at>  <at> 
</span>+/* Blackfin Parallel Port Interface (PPI) model
+   For "old style" PPIs on BF53x/etc... parts.
+
+   Copyright (C) 2010 Free Software Foundation, Inc.
+   Contributed by Analog Devices, Inc.
+
+   This file is part of simulators.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.  */
+
+#include "config.h"
+
+#include "sim-main.h"
+#include "devices.h"
+#include "dv-bfin_ppi.h"
+
+/* XXX: This is merely a stub.  Maybe put a simple SDL window up ?  */
+
+struct bfin_ppi
+{
+  /* This top portion matches common dv_bfin struct.  */
+  bu32 base;
+  struct hw *dma_master;
+  bool acked;
+
+  struct hw_event *handler;
+  char saved_byte;
+  int saved_count;
+
+  /* Order after here is important -- matches hardware MMR layout.  */
+  bu16 BFIN_MMR_16(control);
+  bu16 BFIN_MMR_16(status);
+  bu16 BFIN_MMR_16(count);
+  bu16 BFIN_MMR_16(delay);
+  bu16 BFIN_MMR_16(frame);
+};
+#define mmr_base()      offsetof(struct bfin_ppi, control)
+#define mmr_offset(mmr) (offsetof(struct bfin_ppi, mmr) - mmr_base())
+
+static const char * const mmr_names[] = {
+  "PPI_CONTROL", "PPI_STATUS", "PPI_COUNT", "PPI_DELAY", "PPI_FRAME",
+};
+#define mmr_name(off) mmr_names[(off) / 4]
+
+static unsigned
+bfin_ppi_io_write_buffer (struct hw *me, const void *source,
+			   int space, address_word addr, unsigned nr_bytes)
+{
+  struct bfin_ppi *ppi = hw_data (me);
+  bu32 mmr_off;
+  bu32 value;
+  bu16 *valuep;
+
+  value = dv_load_2 (source);
+  mmr_off = addr - ppi-&gt;base;
+  valuep = (void *)((unsigned long)ppi + mmr_base() + mmr_off);
+
+  HW_TRACE_WRITE ();
+
+  dv_bfin_mmr_require_16 (me, addr, nr_bytes, true);
+
+  switch (mmr_off)
+    {
+    case mmr_offset(control):
+    case mmr_offset(count):
+    case mmr_offset(delay):
+    case mmr_offset(frame):
+      *valuep = value;
+      break;
+    case mmr_offset(status):
+      dv_w1c_2 (valuep, value, (1 &lt;&lt; 10));
+      break;
+    default:
+      dv_bfin_mmr_invalid (me, addr, nr_bytes, true);
+      break;
+    }
+
+  return nr_bytes;
+}
+
+static unsigned
+bfin_ppi_io_read_buffer (struct hw *me, void *dest,
+			  int space, address_word addr, unsigned nr_bytes)
+{
+  struct bfin_ppi *ppi = hw_data (me);
+  bu32 mmr_off;
+  bu16 *valuep;
+
+  mmr_off = addr - ppi-&gt;base;
+  valuep = (void *)((unsigned long)ppi + mmr_base() + mmr_off);
+
+  HW_TRACE_READ ();
+
+  dv_bfin_mmr_require_16 (me, addr, nr_bytes, false);
+
+  switch (mmr_off)
+    {
+    case mmr_offset(control):
+    case mmr_offset(count):
+    case mmr_offset(delay):
+    case mmr_offset(frame):
+    case mmr_offset(status):
+      dv_store_2 (dest, *valuep);
+      break;
+    default:
+      dv_bfin_mmr_invalid (me, addr, nr_bytes, false);
+      break;
+    }
+
+  return nr_bytes;
+}
+
+static unsigned
+bfin_ppi_dma_read_buffer (struct hw *me, void *dest, int space,
+			   unsigned_word addr, unsigned nr_bytes)
+{
+  HW_TRACE_DMA_READ ();
+  return 0;
+}
+
+static unsigned
+bfin_ppi_dma_write_buffer (struct hw *me, const void *source,
+			    int space, unsigned_word addr,
+			    unsigned nr_bytes,
+			    int violate_read_only_section)
+{
+  struct bfin_ppi *ppi = hw_data (me);
+  unsigned ret;
+
+  HW_TRACE_DMA_WRITE ();
+
+  return 0;
+}
+
+static const struct hw_port_descriptor bfin_ppi_ports[] = {
+  { "stat", 0, 0, output_port, },
+};
+
+static void
+attach_bfin_ppi_regs (struct hw *me, struct bfin_ppi *ppi)
+{
+  address_word attach_address;
+  int attach_space;
+  unsigned attach_size;
+  reg_property_spec reg;
+
+  if (hw_find_property (me, "reg") == NULL)
+    hw_abort (me, "Missing \"reg\" property");
+
+  if (!hw_find_reg_array_property (me, "reg", 0, &amp;reg))
+    hw_abort (me, "\"reg\" property must contain three addr/size entries");
+
+  hw_unit_address_to_attach_address (hw_parent (me),
+				     &amp;reg.address,
+				     &amp;attach_space, &amp;attach_address, me);
+  hw_unit_size_to_attach_size (hw_parent (me), &amp;reg.size, &amp;attach_size, me);
+
+  if (attach_size != BFIN_MMR_PPI_SIZE)
+    hw_abort (me, "\"reg\" size must be %#x", BFIN_MMR_PPI_SIZE);
+
+  hw_attach_address (hw_parent (me),
+		     0, attach_space, attach_address, attach_size, me);
+
+  ppi-&gt;base = attach_address;
+}
+
+static void
+bfin_ppi_finish (struct hw *me)
+{
+  struct bfin_ppi *ppi;
+
+  ppi = HW_ZALLOC (me, struct bfin_ppi);
+
+  set_hw_data (me, ppi);
+  set_hw_io_read_buffer (me, bfin_ppi_io_read_buffer);
+  set_hw_io_write_buffer (me, bfin_ppi_io_write_buffer);
+  set_hw_dma_read_buffer (me, bfin_ppi_dma_read_buffer);
+  set_hw_dma_write_buffer (me, bfin_ppi_dma_write_buffer);
+  set_hw_ports (me, bfin_ppi_ports);
+
+  attach_bfin_ppi_regs (me, ppi);
+}
+
+const struct hw_descriptor dv_bfin_ppi_descriptor[] = {
+  {"bfin_ppi", bfin_ppi_finish,},
+  {NULL, NULL},
+};
</span>
</div>
<a></a>
<div class="addfile">
<h4>Added: trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.h (0 =&gt; 4751)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.h	                        (rev 0)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_ppi.h	2010-08-01 06:42:14 UTC (rev 4751)
</span><span class="lines"> <at>  <at>  -0,0 +1,28  <at>  <at> 
</span>+/* Blackfin Parallel Port Interface (PPI) model
+   For "old style" PPIs on BF53x/etc... parts.
+
+   Copyright (C) 2010 Free Software Foundation, Inc.
+   Contributed by Analog Devices, Inc.
+
+   This file is part of simulators.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.  */
+
+#ifndef DV_BFIN_PPI_H
+#define DV_BFIN_PPI_H
+
+/* XXX: This should be pushed into the model data.  */
+#define BFIN_MMR_PPI_SIZE	(4 * 5)
+
+#endif
</span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c (4750 =&gt; 4751)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c	2010-07-31 05:15:31 UTC (rev 4750)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c	2010-08-01 06:42:14 UTC (rev 4751)
</span><span class="lines"> <at>  <at>  -191,7 +191,7  <at>  <at> 
</span><span class="cx">   { "emac_stat",    21, 0, input_port, },
</span><span class="cx">   { "sport <at> 0_stat", 22, 0, input_port, },
</span><span class="cx">   { "sport <at> 1_stat", 23, 0, input_port, },
</span>-  { "ppi_stat",     24, 0, input_port, },
+  { "ppi",          24, 0, input_port, },
<span class="cx">   { "spi_stat",     25, 0, input_port, },
</span><span class="cx">   { "uart <at> 0_stat",  26, 0, input_port, },
</span><span class="cx">   { "uart <at> 1_stat",  27, 0, input_port, },
</span><span class="lines"> <at>  <at>  -213,14 +213,14  <at>  <at> 
</span><span class="cx">   { "porth_irq_a", 171, 0, input_port, },
</span><span class="cx">   { "dma2",        180, 0, input_port, },
</span><span class="cx">   { "porth_irq_b", 181, 0, input_port, },
</span>-  { "timer0",      190, 0, input_port, },
-  { "timer1",      200, 0, input_port, },
-  { "timer0",      210, 0, input_port, },
-  { "timer3",      220, 0, input_port, },
-  { "timer4",      230, 0, input_port, },
-  { "timer5",      240, 0, input_port, },
-  { "timer6",      250, 0, input_port, },
-  { "timer7",      260, 0, input_port, },
+  { "gptimer <at> 0",   190, 0, input_port, },
+  { "gptimer <at> 1",   200, 0, input_port, },
+  { "gptimer <at> 2",   210, 0, input_port, },
+  { "gptimer <at> 3",   220, 0, input_port, },
+  { "gptimer <at> 4",   230, 0, input_port, },
+  { "gptimer <at> 5",   240, 0, input_port, },
+  { "gptimer <at> 6",   250, 0, input_port, },
+  { "gptimer <at> 7",   260, 0, input_port, },
<span class="cx">   { "portf_irq_a", 270, 0, input_port, },
</span><span class="cx">   { "portg_irq_a", 271, 0, input_port, },
</span><span class="cx">   { "portg_irq_b", 280, 0, input_port, },
</span></span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/machs.c (4750 =&gt; 4751)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/machs.c	2010-07-31 05:15:31 UTC (rev 4750)
+++ trunk/binutils-2.17/sim/bfin/machs.c	2010-08-01 06:42:14 UTC (rev 4751)
</span><span class="lines"> <at>  <at>  -36,7 +36,9  <at>  <at> 
</span><span class="cx"> #include "dv-bfin_ebiu_sdc.h"
</span><span class="cx"> #include "dv-bfin_emac.h"
</span><span class="cx"> #include "dv-bfin_evt.h"
</span>+#include "dv-bfin_gptimer.h"
<span class="cx"> #include "dv-bfin_mmu.h"
</span>+#include "dv-bfin_ppi.h"
<span class="cx"> #include "dv-bfin_pll.h"
</span><span class="cx"> #include "dv-bfin_rtc.h"
</span><span class="cx"> #include "dv-bfin_sic.h"
</span><span class="lines"> <at>  <at>  -104,6 +106,7  <at>  <at> 
</span><span class="cx"> #define bf518_chipid bf51x_chipid
</span><span class="cx"> static const struct bfin_memory_layout bf51x_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI0 stub */
</span>+  LAYOUT (0xFFC00680, 0xC, read_write),		/* TIMER stub */
<span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span><span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="lines"> <at>  <at>  -122,14 +125,32  <at>  <at> 
</span><span class="cx"> #define bf516_mem bf51x_mem
</span><span class="cx"> #define bf518_mem bf51x_mem
</span><span class="cx"> static const struct bfin_dev_layout bf512_dev[] = {
</span>-  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"),
-  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"),
+  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 0"),
+  DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"),
+  DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"),
+  DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"),
+  DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"),
+  DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"),
+  DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"),
+  DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"),
+  DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"),
+  DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE,     "bfin_ppi"),
+  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 1"),
<span class="cx"> };
</span><span class="cx"> #define bf514_dev bf512_dev
</span><span class="cx"> static const struct bfin_dev_layout bf516_dev[] = {
</span>-  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"),
-  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"),
-  DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE, "bfin_emac"),
+  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 0"),
+  DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"),
+  DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"),
+  DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"),
+  DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"),
+  DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"),
+  DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"),
+  DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"),
+  DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"),
+  DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE,     "bfin_ppi"),
+  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 1"),
+  DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE,    "bfin_emac"),
<span class="cx">   DEVICE (0, 0x20, "bfin_emac/eth_phy"),
</span><span class="cx"> };
</span><span class="cx"> #define bf518_dev bf516_dev
</span><span class="lines"> <at>  <at>  -142,6 +163,7  <at>  <at> 
</span><span class="cx"> #define bf527_chipid bf523_chipid
</span><span class="cx"> static const struct bfin_memory_layout bf52x_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span>+  LAYOUT (0xFFC00680, 0xC, read_write),		/* TIMER stub */
<span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span><span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="lines"> <at>  <at>  -162,16 +184,34  <at>  <at> 
</span><span class="cx"> #define bf526_mem bf52x_mem
</span><span class="cx"> #define bf527_mem bf52x_mem
</span><span class="cx"> static const struct bfin_dev_layout bf522_dev[] = {
</span>-  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"),
-  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"),
+  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 0"),
+  DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"),
+  DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"),
+  DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"),
+  DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"),
+  DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"),
+  DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"),
+  DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"),
+  DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"),
+  DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE,     "bfin_ppi"),
+  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 1"),
<span class="cx"> };
</span><span class="cx"> #define bf523_dev bf522_dev
</span><span class="cx"> #define bf524_dev bf522_dev
</span><span class="cx"> #define bf525_dev bf522_dev
</span><span class="cx"> static const struct bfin_dev_layout bf526_dev[] = {
</span>-  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"),
-  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"),
-  DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE, "bfin_emac"),
+  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 0"),
+  DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"),
+  DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"),
+  DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"),
+  DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"),
+  DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"),
+  DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"),
+  DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"),
+  DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"),
+  DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE,     "bfin_ppi"),
+  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 1"),
+  DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE,    "bfin_emac"),
<span class="cx">   DEVICE (0, 0x20, "bfin_emac/eth_phy"),
</span><span class="cx"> };
</span><span class="cx"> #define bf527_dev bf526_dev
</span><span class="lines"> <at>  <at>  -181,6 +221,7  <at>  <at> 
</span><span class="cx"> #define bf533_chipid bf531_chipid
</span><span class="cx"> static const struct bfin_memory_layout bf531_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span>+  LAYOUT (0xFFC00640, 0xC, read_write),		/* TIMER stub */
<span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* GPIO stub */
</span><span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="cx">   LAYOUT (0xFFA08000, 0x4000, read_write_exec),	/* Inst B [1] */
</span><span class="lines"> <at>  <at>  -188,6 +229,7  <at>  <at> 
</span><span class="cx"> };
</span><span class="cx"> static const struct bfin_memory_layout bf532_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span>+  LAYOUT (0xFFC00640, 0xC, read_write),		/* TIMER stub */
<span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* GPIO stub */
</span><span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="cx">   LAYOUT (0xFF904000, 0x4000, read_write),	/* Data B Cache */
</span><span class="lines"> <at>  <at>  -197,6 +239,7  <at>  <at> 
</span><span class="cx"> };
</span><span class="cx"> static const struct bfin_memory_layout bf533_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span>+  LAYOUT (0xFFC00640, 0xC, read_write),		/* TIMER stub */
<span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* GPIO stub */
</span><span class="cx">   LAYOUT (0xFF800000, 0x4000, read_write),	/* Data A */
</span><span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="lines"> <at>  <at>  -208,7 +251,11  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFA10000, 0x4000, read_write_exec),	/* Inst Cache [1] */
</span><span class="cx"> };
</span><span class="cx"> static const struct bfin_dev_layout bf533_dev[] = {
</span>-  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"),
+  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 0"),
+  DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"),
+  DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"),
+  DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"),
+  DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE,     "bfin_ppi"),
<span class="cx"> };
</span><span class="cx"> #define bf531_dev bf533_dev
</span><span class="cx"> #define bf532_dev bf533_dev
</span><span class="lines"> <at>  <at>  -218,6 +265,7  <at>  <at> 
</span><span class="cx"> #define bf537_chipid bf536_chipid
</span><span class="cx"> static const struct bfin_memory_layout bf534_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span>+  LAYOUT (0xFFC00680, 0xC, read_write),		/* TIMER stub */
<span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span><span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="lines"> <at>  <at>  -233,6 +281,7  <at>  <at> 
</span><span class="cx"> };
</span><span class="cx"> static const struct bfin_memory_layout bf536_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span>+  LAYOUT (0xFFC00680, 0xC, read_write),		/* TIMER stub */
<span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span><span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="lines"> <at>  <at>  -246,6 +295,7  <at>  <at> 
</span><span class="cx"> };
</span><span class="cx"> static const struct bfin_memory_layout bf537_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span>+  LAYOUT (0xFFC00680, 0xC, read_write),		/* TIMER stub */
<span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span><span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="lines"> <at>  <at>  -260,13 +310,31  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFA10000, 0x4000, read_write_exec),	/* Inst Cache [1] */
</span><span class="cx"> };
</span><span class="cx"> static const struct bfin_dev_layout bf534_dev[] = {
</span>-  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"),
-  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"),
+  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 0"),
+  DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"),
+  DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"),
+  DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"),
+  DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"),
+  DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"),
+  DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"),
+  DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"),
+  DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"),
+  DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE,     "bfin_ppi"),
+  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 1"),
<span class="cx"> };
</span><span class="cx"> static const struct bfin_dev_layout bf537_dev[] = {
</span>-  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"),
-  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"),
-  DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE, "bfin_emac"),
+  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 0"),
+  DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"),
+  DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"),
+  DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"),
+  DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"),
+  DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"),
+  DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"),
+  DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"),
+  DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"),
+  DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE,     "bfin_ppi"),
+  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 1"),
+  DEVICE (0xFFC03000, BFIN_MMR_EMAC_SIZE,    "bfin_emac"),
<span class="cx">   DEVICE (0, 0x20, "bfin_emac/eth_phy"),
</span><span class="cx"> };
</span><span class="cx"> #define bf536_dev bf537_dev
</span><span class="lines"> <at>  <at>  -292,9 +360,18  <at>  <at> 
</span><span class="cx"> };
</span><span class="cx"> #define bf539_mem bf538_mem
</span><span class="cx"> static const struct bfin_dev_layout bf538_dev[] = {
</span>-  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"),
-  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"),
-  DEVICE (0xFFC02100, BFIN_MMR_UART_SIZE, "bfin_uart <at> 2"),
+  DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 0"),
+  DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"),
+  DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"),
+  DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"),
+  DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"),
+  DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"),
+  DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"),
+  DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"),
+  DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"),
+  DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE,     "bfin_ppi"),
+  DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 1"),
+  DEVICE (0xFFC02100, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 2"),
<span class="cx"> };
</span><span class="cx"> #define bf539_dev bf538_dev
</span><span class="cx"> 
</span><span class="lines"> <at>  <at>  -357,6 +434,8  <at>  <at> 
</span><span class="cx"> };
</span><span class="cx"> static const struct bfin_dev_layout bf561_dev[] = {
</span><span class="cx">   DEVICE (0xFFC00400, BFIN_MMR_UART_SIZE, "bfin_uart <at> 0"),
</span>+  DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE,  "bfin_ppi <at> 0"),
+  DEVICE (0xFFC01300, BFIN_MMR_PPI_SIZE,  "bfin_ppi <at> 1"),
<span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static const struct bfin_model_data bfin_model_data[] =
</span><span class="lines"> <at>  <at>  -475,6 +554,16  <at>  <at> 
</span><span class="cx"> 	  sim_hw_parse (sd, "/core/%s &gt; rx   %s_rx   /core/bfin_dmac <at> 0", dev-&gt;dev, sint);
</span><span class="cx"> 	  sim_hw_parse (sd, "/core/%s &gt; stat %s_stat /core/bfin_sic", dev-&gt;dev, sint);
</span><span class="cx"> 	}
</span>+      else if (!strncmp (dev-&gt;dev, "bfin_gptimer", 12))
+	{
+	  const char *sint = dev-&gt;dev + 5;
+	  sim_hw_parse (sd, "/core/%s &gt; stat %s /core/bfin_sic", dev-&gt;dev, sint);
+	}
+      else if (!strncmp (dev-&gt;dev, "bfin_ppi", 7))
+	{
+	  const char *sint = dev-&gt;dev + 5;
+	  sim_hw_parse (sd, "/core/%s &gt; stat %s /core/bfin_sic", dev-&gt;dev, sint);
+	}
<span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">  done:
</span></span>
</div>
</div>

</div>
vapier | 1 Aug 2010 08:42
Favicon

[4752] trunk/binutils-2.17/sim/bfin/configure: sim: add gptimer/ ppi stubs so default bf527-ezkit can boot up (has a splash screen)

Revision 4752 Author vapier Date 2010-08-01 02:42:33 -0400 (Sun, 01 Aug 2010)

Log Message

sim: add gptimer/ppi stubs so default bf527-ezkit can boot up (has a splash screen)

Modified Paths

Diff

Modified: trunk/binutils-2.17/sim/bfin/configure (4751 => 4752)

--- trunk/binutils-2.17/sim/bfin/configure 2010-08-01 06:42:14 UTC (rev 4751) +++ trunk/binutils-2.17/sim/bfin/configure 2010-08-01 06:42:33 UTC (rev 4752) <at> <at> -4791,8 +4791,10 <at> <at> bfin_ebiu_sdc \ bfin_emac \ bfin_evt \ + bfin_gptimer \ bfin_mmu \ bfin_pll \ + bfin_ppi \ bfin_rtc \ bfin_sic \ bfin_trace \
<div>

<div>
Revision <a href="http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/?action=browse&amp;path=/&amp;view=rev&amp;root=toolchain&amp;revision=4752">4752</a>
Author <a href="http://blackfin.uclinux.org/gf/user/vapier/">vapier</a>
Date 2010-08-01 02:42:33 -0400 (Sun, 01 Aug 2010)
<h3>Log Message</h3>
sim: add gptimer/ppi stubs so default bf527-ezkit can boot up (has a splash screen)

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfinconfigure">trunk/binutils-2.17/sim/bfin/configure</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/configure (4751 =&gt; 4752)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/configure	2010-08-01 06:42:14 UTC (rev 4751)
+++ trunk/binutils-2.17/sim/bfin/configure	2010-08-01 06:42:33 UTC (rev 4752)
</span><span class="lines"> <at>  <at>  -4791,8 +4791,10  <at>  <at> 
</span><span class="cx"> 	bfin_ebiu_sdc \
</span><span class="cx"> 	bfin_emac \
</span><span class="cx"> 	bfin_evt \
</span>+	bfin_gptimer \
<span class="cx"> 	bfin_mmu \
</span><span class="cx"> 	bfin_pll \
</span>+	bfin_ppi \
<span class="cx"> 	bfin_rtc \
</span><span class="cx"> 	bfin_sic \
</span><span class="cx"> 	bfin_trace \
</span></span>
</div>
</div>

</div>
vapier | 1 Aug 2010 09:05
Favicon

[4753] trunk/binutils-2.17/sim/bfin/machs.c: sim: add OTP/MUSB MMR stubs

Revision 4753 Author vapier Date 2010-08-01 03:05:56 -0400 (Sun, 01 Aug 2010)

Log Message

sim: add OTP/MUSB MMR stubs

Modified Paths

Diff

Modified: trunk/binutils-2.17/sim/bfin/machs.c (4752 => 4753)

--- trunk/binutils-2.17/sim/bfin/machs.c 2010-08-01 06:42:33 UTC (rev 4752) +++ trunk/binutils-2.17/sim/bfin/machs.c 2010-08-01 07:05:56 UTC (rev 4753) <at> <at> -113,6 +113,8 <at> <at> LAYOUT (0xFFC01700, 0x50, read_write), /* PORTH stub */ LAYOUT (0xFFC03200, 0x50, read_write), /* PORT_MUX stub */ LAYOUT (0xFFC03400, 0x20, read_write), /* SPI1 stub */ + LAYOUT (0xFFC03600, 0x10, read_write), /* OTP stub */ + LAYOUT (0xFFC03680, 0x10, read_write), /* OTP Data stub */ LAYOUT (0xFF800000, 0x4000, read_write), /* Data A */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ LAYOUT (0xFF900000, 0x4000, read_write), /* Data B */ <at> <at> -169,6 +171,9 <at> <at> LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ LAYOUT (0xFFC01700, 0x50, read_write), /* PORTH stub */ LAYOUT (0xFFC03200, 0x50, read_write), /* PORT_MUX stub */ + LAYOUT (0xFFC03600, 0x10, read_write), /* OTP stub */ + LAYOUT (0xFFC03680, 0x10, read_write), /* OTP Data stub */ + LAYOUT (0xFFC03800, 0xd00, read_write), /* MUSB stub */ LAYOUT (0xFF800000, 0x4000, read_write), /* Data A */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ LAYOUT (0xFF900000, 0x4000, read_write), /* Data B */ <at> <at> -387,6 +392,9 <at> <at> LAYOUT (0xFFC01400, 0x200, read_write), /* PORT/GPIO stub */ LAYOUT (0xFFC02200, 0x90, read_write), /* TWI1 stub */ LAYOUT (0xFFC02300, 0x20, read_write), /* SPI1 stub */ + LAYOUT (0xFFC03C00, 0xd00, read_write), /* MUSB stub */ + LAYOUT (0xFFC04300, 0x10, read_write), /* OTP stub */ + LAYOUT (0xFFC04380, 0x10, read_write), /* OTP Data stub */ LAYOUT (0xFEB00000, 0x20000, read_write_exec), /* L2 */ LAYOUT (0xFF800000, 0x4000, read_write), /* Data A */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */
<div>

<div>
Revision <a href="http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/?action=browse&amp;path=/&amp;view=rev&amp;root=toolchain&amp;revision=4753">4753</a>
Author <a href="http://blackfin.uclinux.org/gf/user/vapier/">vapier</a>
Date 2010-08-01 03:05:56 -0400 (Sun, 01 Aug 2010)
<h3>Log Message</h3>
sim: add OTP/MUSB MMR stubs

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfinmachsc">trunk/binutils-2.17/sim/bfin/machs.c</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/machs.c (4752 =&gt; 4753)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/machs.c	2010-08-01 06:42:33 UTC (rev 4752)
+++ trunk/binutils-2.17/sim/bfin/machs.c	2010-08-01 07:05:56 UTC (rev 4753)
</span><span class="lines"> <at>  <at>  -113,6 +113,8  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC01700, 0x50, read_write),	/* PORTH stub */
</span><span class="cx">   LAYOUT (0xFFC03200, 0x50, read_write),	/* PORT_MUX stub */
</span><span class="cx">   LAYOUT (0xFFC03400, 0x20, read_write),	/* SPI1 stub */
</span>+  LAYOUT (0xFFC03600, 0x10, read_write),	/* OTP stub */
+  LAYOUT (0xFFC03680, 0x10, read_write),	/* OTP Data stub */
<span class="cx">   LAYOUT (0xFF800000, 0x4000, read_write),	/* Data A */
</span><span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="cx">   LAYOUT (0xFF900000, 0x4000, read_write),	/* Data B */
</span><span class="lines"> <at>  <at>  -169,6 +171,9  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="cx">   LAYOUT (0xFFC01700, 0x50, read_write),	/* PORTH stub */
</span><span class="cx">   LAYOUT (0xFFC03200, 0x50, read_write),	/* PORT_MUX stub */
</span>+  LAYOUT (0xFFC03600, 0x10, read_write),	/* OTP stub */
+  LAYOUT (0xFFC03680, 0x10, read_write),	/* OTP Data stub */
+  LAYOUT (0xFFC03800, 0xd00, read_write),	/* MUSB stub */
<span class="cx">   LAYOUT (0xFF800000, 0x4000, read_write),	/* Data A */
</span><span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="cx">   LAYOUT (0xFF900000, 0x4000, read_write),	/* Data B */
</span><span class="lines"> <at>  <at>  -387,6 +392,9  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC01400, 0x200, read_write),	/* PORT/GPIO stub */
</span><span class="cx">   LAYOUT (0xFFC02200, 0x90, read_write),	/* TWI1 stub */
</span><span class="cx">   LAYOUT (0xFFC02300, 0x20, read_write),	/* SPI1 stub */
</span>+  LAYOUT (0xFFC03C00, 0xd00, read_write),	/* MUSB stub */
+  LAYOUT (0xFFC04300, 0x10, read_write),	/* OTP stub */
+  LAYOUT (0xFFC04380, 0x10, read_write),	/* OTP Data stub */
<span class="cx">   LAYOUT (0xFEB00000, 0x20000, read_write_exec),	/* L2 */
</span><span class="cx">   LAYOUT (0xFF800000, 0x4000, read_write),	/* Data A */
</span><span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span></span>
</div>
</div>

</div>
vapier | 2 Aug 2010 01:00
Favicon

[4754] trunk/binutils-2.17/sim/bfin: sim: initial BF52x support for DMAC/ SIC (enough to run u-boot/Linux)

Revision 4754 Author vapier Date 2010-08-01 19:00:33 -0400 (Sun, 01 Aug 2010)

Log Message

sim: initial BF52x support for DMAC/SIC (enough to run u-boot/Linux)

Modified Paths

Diff

Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c (4753 => 4754)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c 2010-08-01 07:05:56 UTC (rev 4753) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c 2010-08-01 23:00:33 UTC (rev 4754) <at> <at> -70,7 +70,8 <at> <at> ret = hw_tree_find_device (me, peer); if (!ret) - hw_abort (me, "Unable to locate peer for %s (%#x)", hw_name (dma), pmap); + hw_abort (me, "Unable to locate peer for %s (pmap:%#x %s)", + hw_name (dma), pmap, peer); return ret; } <at> <at> -86,6 +87,40 <at> <at> return CTYPE; /* MDMA */ } +static const unsigned int bfin_dmac_52x_mdma_map[] = { + /* MDMA0 */ + [12] = 13, + [13] = 12, + /* MDMA1 */ + [14] = 15, + [15] = 14, +}; + +static const char *bfin_dmac_52x_pmap[] = { + "ppi", "emac", "emac", "sport <at> 0", "sport <at> 0", "sport <at> 1", + "sport <at> 1", "spi", "uart <at> 0", "uart <at> 0", "uart <at> 1", "uart <at> 1", +}; + +/* XXX: Need to figure out how to handle portmuxed DMA channels + like PPI/NFC here which share DMA0. */ +static const struct hw_port_descriptor bfin_dmac_52x_ports[] = { + { "ppi", 0, 0, input_port, }, +/*{ "nfc", 0, 0, input_port, },*/ + { "emac_rx", 1, 0, input_port, }, +/*{ "hostdp", 1, 0, input_port, },*/ + { "emac_tx", 2, 0, input_port, }, +/*{ "nfc", 2, 0, input_port, },*/ + { "sport <at> 0_tx", 3, 0, input_port, }, + { "sport <at> 0_rx", 4, 0, input_port, }, + { "sport <at> 1_tx", 5, 0, input_port, }, + { "sport <at> 1_rx", 6, 0, input_port, }, + { "spi", 7, 0, input_port, }, + { "uart <at> 0_tx", 8, 0, input_port, }, + { "uart <at> 0_rx", 9, 0, input_port, }, + { "uart <at> 1_tx", 10, 0, input_port, }, + { "uart <at> 1_rx", 11, 0, input_port, }, +}; + static const unsigned int bfin_dmac_537_mdma_map[] = { /* MDMA0 */ [12] = 13, <at> <at> -156,6 +191,13 <at> <at> switch (hw_find_integer_property (me, "type")) { + case 522 ... 527: + dmac->pmap = bfin_dmac_52x_pmap; + dmac->pmap_count = ARRAY_SIZE (bfin_dmac_52x_pmap); + dmac->mdma_map = bfin_dmac_52x_mdma_map; + dmac->mdma_count = ARRAY_SIZE (bfin_dmac_52x_mdma_map); + set_hw_ports (me, bfin_dmac_52x_ports); + break; case 534: case 536: case 537:

Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c (4753 => 4754)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c 2010-08-01 07:05:56 UTC (rev 4753) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c 2010-08-01 23:00:33 UTC (rev 4754) <at> <at> -27,37 +27,55 <at> <at> struct bfin_sic { + /* We assume first element is the base. */ bu32 base; /* Order after here is important -- matches hardware MMR layout. */ - /* XXX: This is the 537 SIC. */ bu16 BFIN_MMR_16(swrst); bu16 BFIN_MMR_16(syscr); bu16 BFIN_MMR_16(rvect); - bu32 imask; union { - bu32 iar[4]; - struct { bu32 iar0, iar1, iar2, iar3; }; + struct { + bu32 imask0; + bu32 iar0, iar1, iar2, iar3; + bu32 isr0, iwr0; + bu32 _pad0[9]; + bu32 imask1; + bu32 iar4, iar5, iar6, iar7; + bu32 isr1, iwr1; + } bf52x; + struct { + bu32 imask; + bu32 iar0, iar1, iar2, iar3; + bu32 isr, iwr; + } bf537; }; - bu32 isr, iwr; }; #define mmr_base() offsetof(struct bfin_sic, swrst) #define mmr_offset(mmr) (offsetof(struct bfin_sic, mmr) - mmr_base()) +#define mmr_idx(mmr) (mmr_offset (mmr) / 4) -static const char * const mmr_names[] = { +static const char * const bf52x_mmr_names[] = { + "SWRST", "SYSCR", "SIC_RVECT", "SIC_IMASK0", "SIC_IAR0", "SIC_IAR1", + "SIC_IAR2", "SIC_IAR3", "SIC_ISR0", "SIC_IWR0", + [mmr_idx (bf52x.imask1)] = "SIC_IMASK1", "SIC_IAR4", "SIC_IAR5", + "SIC_IAR6", "SIC_IAR7", "SIC_ISR1", "SIC_IWR1", +}; +static const char * const bf537_mmr_names[] = { "SWRST", "SYSCR", "SIC_RVECT", "SIC_IMASK", "SIC_IAR0", "SIC_IAR1", "SIC_IAR2", "SIC_IAR3", "SIC_ISR", "SIC_IWR", }; -#define mmr_name(off) mmr_names[(off) / 4] +static const char * const *mmr_names; +#define mmr_name(off) (mmr_names[(off) / 4] ? : "<INV>") static void -bfn_sic_forward_interrupts (struct hw *me, struct bfin_sic *sic) +bfin_sic_forward_interrupts (struct hw *me, bu32 *isr, bu32 *imask, bu32 *iar) { int my_port; bu32 ipend; /* Process pending and unmasked interrupts. */ - ipend = sic->isr & sic->imask; + ipend = *isr & *imask; /* Usually none are pending unmasked, so avoid bit twiddling. */ if (!ipend) <at> <at> -65,7 +83,7 <at> <at> for (my_port = 0; my_port < 32; ++my_port) { - bu32 iar_idx, iar_off, iar; + bu32 iar_idx, iar_off, iar_val; bu32 bit = (1 << my_port); /* This bit isn't pending, so check next one. */ <at> <at> -76,14 +94,21 <at> <at> Every 4 bits in the IAR are used to map to IVG{7..15}. */ iar_idx = my_port / 8; iar_off = (my_port % 8) * 4; - iar = (sic->iar[iar_idx] & (0xf << iar_off)) >> iar_off; - hw_port_event (me, IVG7 + iar, 1); + iar_val = (iar[iar_idx] & (0xf << iar_off)) >> iar_off; + hw_port_event (me, IVG7 + iar_val, 1); } } +static void +bfin_sic_52x_forward_interrupts (struct hw *me, struct bfin_sic *sic) +{ + bfin_sic_forward_interrupts (me, &sic->bf52x.isr0, &sic->bf52x.imask0, &sic->bf52x.iar0); + bfin_sic_forward_interrupts (me, &sic->bf52x.isr1, &sic->bf52x.imask1, &sic->bf52x.iar4); +} + static unsigned -bfin_sic_io_write_buffer (struct hw *me, const void *source, - int space, address_word addr, unsigned nr_bytes) +bfin_sic_52x_io_write_buffer (struct hw *me, const void *source, int space, + address_word addr, unsigned nr_bytes) { struct bfin_sic *sic = hw_data (me); bu32 mmr_off; <at> <at> -113,18 +138,19 <at> <at> case mmr_offset(syscr): /* XXX: what to do ... */ break; - case mmr_offset(imask): - bfn_sic_forward_interrupts (me, sic); + case mmr_offset(bf52x.imask0): + case mmr_offset(bf52x.imask1): + bfin_sic_52x_forward_interrupts (me, sic); *value32p = value; break; - case mmr_offset(iar0): - case mmr_offset(iar1): - case mmr_offset(iar2): - case mmr_offset(iar3): - case mmr_offset(iwr): + case mmr_offset(bf52x.iar0) ... mmr_offset(bf52x.iar3): + case mmr_offset(bf52x.iar4) ... mmr_offset(bf52x.iar7): + case mmr_offset(bf52x.iwr0): + case mmr_offset(bf52x.iwr1): *value32p = value; break; - case mmr_offset(isr): + case mmr_offset(bf52x.isr0): + case mmr_offset(bf52x.isr1): /* ISR is read-only. */ break; default: <at> <at> -136,8 +162,8 <at> <at> } static unsigned -bfin_sic_io_read_buffer (struct hw *me, void *dest, - int space, address_word addr, unsigned nr_bytes) +bfin_sic_52x_io_read_buffer (struct hw *me, void *dest, int space, + address_word addr, unsigned nr_bytes) { struct bfin_sic *sic = hw_data (me); bu32 mmr_off; <at> <at> -159,13 +185,14 <at> <at> case mmr_offset(rvect): dv_store_2 (dest, *value16p); break; - case mmr_offset(imask): - case mmr_offset(iar0): - case mmr_offset(iar1): - case mmr_offset(iar2): - case mmr_offset(iar3): - case mmr_offset(isr): - case mmr_offset(iwr): + case mmr_offset(bf52x.imask0): + case mmr_offset(bf52x.imask1): + case mmr_offset(bf52x.iar0) ... mmr_offset(bf52x.iar3): + case mmr_offset(bf52x.iar4) ... mmr_offset(bf52x.iar7): + case mmr_offset(bf52x.iwr0): + case mmr_offset(bf52x.iwr1): + case mmr_offset(bf52x.isr0): + case mmr_offset(bf52x.isr1): dv_store_4 (dest, *value32p); break; default: <at> <at> -179,68 +206,257 <at> <at> return nr_bytes; } +static void +bfin_sic_537_forward_interrupts (struct hw *me, struct bfin_sic *sic) +{ + bfin_sic_forward_interrupts (me, &sic->bf537.isr, &sic->bf537.imask, &sic->bf537.iar0); +} + +static unsigned +bfin_sic_537_io_write_buffer (struct hw *me, const void *source, int space, + address_word addr, unsigned nr_bytes) +{ + struct bfin_sic *sic = hw_data (me); + bu32 mmr_off; + bu32 value; + bu16 *value16p; + bu32 *value32p; + void *valuep; + + if (nr_bytes == 4) + value = dv_load_4 (source); + else + value = dv_load_2 (source); + + mmr_off = addr - sic->base; + valuep = (void *)((unsigned long)sic + mmr_base() + mmr_off); + value16p = valuep; + value32p = valuep; + + HW_TRACE_WRITE (); + + /* XXX: Discard all SIC writes for now. */ + switch (mmr_off) + { + case mmr_offset(swrst): + /* XXX: This should trigger a software reset ... */ + break; + case mmr_offset(syscr): + /* XXX: what to do ... */ + break; + case mmr_offset(bf537.imask): + bfin_sic_537_forward_interrupts (me, sic); + *value32p = value; + break; + case mmr_offset(bf537.iar0): + case mmr_offset(bf537.iar1): + case mmr_offset(bf537.iar2): + case mmr_offset(bf537.iar3): + case mmr_offset(bf537.iwr): + *value32p = value; + break; + case mmr_offset(bf537.isr): + /* ISR is read-only. */ + break; + default: + /* XXX: Should discard other writes. */ + ; + } + + return nr_bytes; +} + +static unsigned +bfin_sic_537_io_read_buffer (struct hw *me, void *dest, int space, + address_word addr, unsigned nr_bytes) +{ + struct bfin_sic *sic = hw_data (me); + bu32 mmr_off; + bu16 *value16p; + bu32 *value32p; + void *valuep; + + mmr_off = addr - sic->base; + valuep = (void *)((unsigned long)sic + mmr_base() + mmr_off); + value16p = valuep; + value32p = valuep; + + HW_TRACE_READ (); + + switch (mmr_off) + { + case mmr_offset(swrst): + case mmr_offset(syscr): + case mmr_offset(rvect): + dv_store_2 (dest, *value16p); + break; + case mmr_offset(bf537.imask): + case mmr_offset(bf537.iar0): + case mmr_offset(bf537.iar1): + case mmr_offset(bf537.iar2): + case mmr_offset(bf537.iar3): + case mmr_offset(bf537.isr): + case mmr_offset(bf537.iwr): + dv_store_4 (dest, *value32p); + break; + default: + if (nr_bytes == 2) + dv_store_2 (dest, 0); + else + dv_store_4 (dest, 0); + break; + } + + return nr_bytes; +} + /* XXX: This doesn't handle DMA<->peripheral mappings. */ -static const struct hw_port_descriptor bfin_sic_537_ports[] = { - { "pll", 0, 0, input_port, }, - { "dma_stat", 10, 0, input_port, }, - { "dmar0_block", 11, 0, input_port, }, - { "dmar1_block", 12, 0, input_port, }, - { "dmar0_over", 13, 0, input_port, }, - { "dmar1_over", 14, 0, input_port, }, - { "can_stat", 20, 0, input_port, }, - { "emac_stat", 21, 0, input_port, }, - { "sport <at> 0_stat", 22, 0, input_port, }, - { "sport <at> 1_stat", 23, 0, input_port, }, - { "ppi", 24, 0, input_port, }, - { "spi_stat", 25, 0, input_port, }, - { "uart <at> 0_stat", 26, 0, input_port, }, - { "uart <at> 1_stat", 27, 0, input_port, }, - { "rtc", 30, 0, input_port, }, - { "dma0", 40, 0, input_port, }, - { "dma3", 50, 0, input_port, }, - { "dma4", 60, 0, input_port, }, - { "dma5", 70, 0, input_port, }, - { "dma6", 80, 0, input_port, }, - { "twi", 90, 0, input_port, }, - { "dma7", 100, 0, input_port, }, - { "dma8", 110, 0, input_port, }, - { "dma9", 120, 0, input_port, }, - { "dma10", 130, 0, input_port, }, - { "dma11", 140, 0, input_port, }, - { "can_rx", 150, 0, input_port, }, - { "can_tx", 160, 0, input_port, }, - { "dma1", 170, 0, input_port, }, - { "porth_irq_a", 171, 0, input_port, }, - { "dma2", 180, 0, input_port, }, - { "porth_irq_b", 181, 0, input_port, }, - { "gptimer <at> 0", 190, 0, input_port, }, - { "gptimer <at> 1", 200, 0, input_port, }, - { "gptimer <at> 2", 210, 0, input_port, }, - { "gptimer <at> 3", 220, 0, input_port, }, - { "gptimer <at> 4", 230, 0, input_port, }, - { "gptimer <at> 5", 240, 0, input_port, }, - { "gptimer <at> 6", 250, 0, input_port, }, - { "gptimer <at> 7", 260, 0, input_port, }, - { "portf_irq_a", 270, 0, input_port, }, - { "portg_irq_a", 271, 0, input_port, }, - { "portg_irq_b", 280, 0, input_port, }, - { "mdma0", 290, 0, input_port, }, - { "mdma1", 300, 0, input_port, }, - { "watchdog", 310, 0, input_port, }, - { "portf_irq_b", 311, 0, input_port, }, +#define BFIN_SIC_TO_CEC_PORTS \ + { "ivg7", IVG7, 0, output_port, }, \ + { "ivg8", IVG8, 0, output_port, }, \ + { "ivg9", IVG9, 0, output_port, }, \ + { "ivg10", IVG10, 0, output_port, }, \ + { "ivg11", IVG11, 0, output_port, }, \ + { "ivg12", IVG12, 0, output_port, }, \ + { "ivg13", IVG13, 0, output_port, }, \ + { "ivg14", IVG14, 0, output_port, }, \ + { "ivg15", IVG15, 0, output_port, }, - { "ivg7", IVG7, 0, output_port, }, - { "ivg8", IVG8, 0, output_port, }, - { "ivg9", IVG9, 0, output_port, }, - { "ivg10", IVG10, 0, output_port, }, - { "ivg11", IVG11, 0, output_port, }, - { "ivg12", IVG12, 0, output_port, }, - { "ivg13", IVG13, 0, output_port, }, - { "ivg14", IVG14, 0, output_port, }, - { "ivg15", IVG15, 0, output_port, }, +static const struct hw_port_descriptor bfin_sic_52x_ports[] = { + BFIN_SIC_TO_CEC_PORTS + /* SIC0 */ + { "pll", 0, 0, input_port, }, + { "dma_stat", 1, 0, input_port, }, + { "dmar0_block", 2, 0, input_port, }, + { "dmar1_block", 3, 0, input_port, }, + { "dmar0_over", 4, 0, input_port, }, + { "dmar1_over", 5, 0, input_port, }, + { "ppi", 6, 0, input_port, }, + { "emac_stat", 7, 0, input_port, }, + { "sport <at> 0_stat", 8, 0, input_port, }, + { "sport <at> 1_stat", 9, 0, input_port, }, + { "uart <at> 0_stat", 12, 0, input_port, }, + { "uart <at> 1_stat", 13, 0, input_port, }, + { "rtc", 14, 0, input_port, }, + { "dma0", 15, 0, input_port, }, + { "dma3", 16, 0, input_port, }, + { "dma4", 17, 0, input_port, }, + { "dma5", 18, 0, input_port, }, + { "dma6", 19, 0, input_port, }, + { "twi", 20, 0, input_port, }, + { "dma7", 21, 0, input_port, }, + { "dma8", 22, 0, input_port, }, + { "dma9", 23, 0, input_port, }, + { "dma10", 24, 0, input_port, }, + { "dma11", 25, 0, input_port, }, + { "otp", 26, 0, input_port, }, + { "counter", 27, 0, input_port, }, + { "dma1", 28, 0, input_port, }, + { "porth_irq_a", 29, 0, input_port, }, + { "dma2", 30, 0, input_port, }, + { "porth_irq_b", 31, 0, input_port, }, + /* SIC1 */ + { "gptimer <at> 0", 100, 0, input_port, }, + { "gptimer <at> 1", 101, 0, input_port, }, + { "gptimer <at> 2", 102, 0, input_port, }, + { "gptimer <at> 3", 103, 0, input_port, }, + { "gptimer <at> 4", 104, 0, input_port, }, + { "gptimer <at> 5", 105, 0, input_port, }, + { "gptimer <at> 6", 106, 0, input_port, }, + { "gptimer <at> 7", 107, 0, input_port, }, + { "portg_irq_a", 108, 0, input_port, }, + { "portg_irq_b", 109, 0, input_port, }, + { "mdma0", 110, 0, input_port, }, + { "mdma1", 111, 0, input_port, }, + { "watchdog", 112, 0, input_port, }, + { "portf_irq_a", 113, 0, input_port, }, + { "portf_irq_b", 114, 0, input_port, }, + { "spi_stat", 115, 0, input_port, }, + { "nfc_stat", 116, 0, input_port, }, + { "hostdp_stat", 117, 0, input_port, }, + { "hostdp_done", 118, 0, input_port, }, + { "usb_int0", 120, 0, input_port, }, + { "usb_int1", 121, 0, input_port, }, + { "usb_int2", 122, 0, input_port, }, }; static void +bfin_sic_52x_port_event (struct hw *me, int my_port, struct hw *source, + int source_port, int level) +{ + struct bfin_sic *sic = hw_data (me); + bu32 idx = my_port / 100; + bu32 bit = (1 << (my_port & 0x1f)); + + /* SIC only exists to forward interrupts from the system to the CEC. */ + switch (idx) + { + case 0: sic->bf52x.isr0 |= bit; break; + case 1: sic->bf52x.isr1 |= bit; break; + } + + /* XXX: Handle SIC wakeup source ? + if (sic->bf52x.iwr0 & bit) + What to do ?; + if (sic->bf52x.iwr1 & bit) + What to do ?; + */ + + bfin_sic_52x_forward_interrupts (me, sic); +} + +static const struct hw_port_descriptor bfin_sic_537_ports[] = { + BFIN_SIC_TO_CEC_PORTS + { "pll", 0, 0, input_port, }, + { "dma_stat", 10, 0, input_port, }, + { "dmar0_block", 11, 0, input_port, }, + { "dmar1_block", 12, 0, input_port, }, + { "dmar0_over", 13, 0, input_port, }, + { "dmar1_over", 14, 0, input_port, }, + { "can_stat", 20, 0, input_port, }, + { "emac_stat", 21, 0, input_port, }, + { "sport <at> 0_stat", 22, 0, input_port, }, + { "sport <at> 1_stat", 23, 0, input_port, }, + { "ppi", 24, 0, input_port, }, + { "spi_stat", 25, 0, input_port, }, + { "uart <at> 0_stat", 26, 0, input_port, }, + { "uart <at> 1_stat", 27, 0, input_port, }, + { "rtc", 30, 0, input_port, }, + { "dma0", 40, 0, input_port, }, + { "dma3", 50, 0, input_port, }, + { "dma4", 60, 0, input_port, }, + { "dma5", 70, 0, input_port, }, + { "dma6", 80, 0, input_port, }, + { "twi", 90, 0, input_port, }, + { "dma7", 100, 0, input_port, }, + { "dma8", 110, 0, input_port, }, + { "dma9", 120, 0, input_port, }, + { "dma10", 130, 0, input_port, }, + { "dma11", 140, 0, input_port, }, + { "can_rx", 150, 0, input_port, }, + { "can_tx", 160, 0, input_port, }, + { "dma1", 170, 0, input_port, }, + { "porth_irq_a", 171, 0, input_port, }, + { "dma2", 180, 0, input_port, }, + { "porth_irq_b", 181, 0, input_port, }, + { "gptimer <at> 0", 190, 0, input_port, }, + { "gptimer <at> 1", 200, 0, input_port, }, + { "gptimer <at> 2", 210, 0, input_port, }, + { "gptimer <at> 3", 220, 0, input_port, }, + { "gptimer <at> 4", 230, 0, input_port, }, + { "gptimer <at> 5", 240, 0, input_port, }, + { "gptimer <at> 6", 250, 0, input_port, }, + { "gptimer <at> 7", 260, 0, input_port, }, + { "portf_irq_a", 270, 0, input_port, }, + { "portg_irq_a", 271, 0, input_port, }, + { "portg_irq_b", 280, 0, input_port, }, + { "mdma0", 290, 0, input_port, }, + { "mdma1", 300, 0, input_port, }, + { "watchdog", 310, 0, input_port, }, + { "portf_irq_b", 311, 0, input_port, }, +}; + +static void bfin_sic_537_port_event (struct hw *me, int my_port, struct hw *source, int source_port, int level) { <at> <at> -248,14 +464,14 <at> <at> bu32 bit = (1 << (my_port / 10)); /* SIC only exists to forward interrupts from the system to the CEC. */ - sic->isr |= bit; + sic->bf537.isr |= bit; /* XXX: Handle SIC wakeup source ? - if (sic->iwr & bit) + if (sic->bf537.iwr & bit) What to do ?; */ - bfn_sic_forward_interrupts (me, sic); + bfin_sic_537_forward_interrupts (me, sic); } static void <at> <at> -294,21 +510,51 <at> <at> sic = HW_ZALLOC (me, struct bfin_sic); set_hw_data (me, sic); - set_hw_io_read_buffer (me, bfin_sic_io_read_buffer); - set_hw_io_write_buffer (me, bfin_sic_io_write_buffer); - set_hw_ports (me, bfin_sic_537_ports); - set_hw_port_event (me, bfin_sic_537_port_event); - attach_bfin_sic_regs (me, sic); - /* Initialize the SIC. */ - sic->imask = 0x00000000; - sic->iar0 = 0x22211000; - sic->iar1 = 0x43333332; - sic->iar2 = 0x55555444; - sic->iar3 = 0x66655555; - sic->isr = 0x00000000; - sic->iwr = 0xFFFFFFFF; + switch (hw_find_integer_property (me, "type")) + { + case 522 ... 527: + set_hw_io_read_buffer (me, bfin_sic_52x_io_read_buffer); + set_hw_io_write_buffer (me, bfin_sic_52x_io_write_buffer); + set_hw_ports (me, bfin_sic_52x_ports); + set_hw_port_event (me, bfin_sic_52x_port_event); + mmr_names = bf52x_mmr_names; + + /* Initialize the SIC. */ + sic->bf52x.imask0 = sic->bf52x.imask1 = 0; + sic->bf52x.isr0 = sic->bf52x.isr1 = 0; + sic->bf52x.iwr0 = sic->bf52x.iwr1 = 0xFFFFFFFF; + sic->bf52x.iar0 = 0x00000000; + sic->bf52x.iar1 = 0x11000000; + sic->bf52x.iar2 = 0x33332222; + sic->bf52x.iar3 = 0x44444433; + sic->bf52x.iar4 = 0x55555555; + sic->bf52x.iar5 = 0x06666655; + sic->bf52x.iar6 = 0x33333000; + sic->bf52x.iar7 = 0x00000000; + break; + case 534: + case 536: + case 537: + set_hw_io_read_buffer (me, bfin_sic_537_io_read_buffer); + set_hw_io_write_buffer (me, bfin_sic_537_io_write_buffer); + set_hw_ports (me, bfin_sic_537_ports); + set_hw_port_event (me, bfin_sic_537_port_event); + mmr_names = bf537_mmr_names; + + /* Initialize the SIC. */ + sic->bf537.imask = 0; + sic->bf537.isr = 0; + sic->bf537.iwr = 0xFFFFFFFF; + sic->bf537.iar0 = 0x22211000; + sic->bf537.iar1 = 0x43333332; + sic->bf537.iar2 = 0x55555444; + sic->bf537.iar3 = 0x66655555; + break; + default: + hw_abort (me, "no support for SIC on this Blackfin model yet"); + } } const struct hw_descriptor dv_bfin_sic_descriptor[] = {
<div>

<div>
Revision <a href="http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/?action=browse&amp;path=/&amp;view=rev&amp;root=toolchain&amp;revision=4754">4754</a>
Author <a href="http://blackfin.uclinux.org/gf/user/vapier/">vapier</a>
Date 2010-08-01 19:00:33 -0400 (Sun, 01 Aug 2010)
<h3>Log Message</h3>
sim: initial BF52x support for DMAC/SIC (enough to run u-boot/Linux)

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfindvbfin_dmacc">trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c</a></li>
<li><a href="#trunkbinutils217simbfindvbfin_sicc">trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c (4753 =&gt; 4754)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c	2010-08-01 07:05:56 UTC (rev 4753)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c	2010-08-01 23:00:33 UTC (rev 4754)
</span><span class="lines"> <at>  <at>  -70,7 +70,8  <at>  <at> 
</span><span class="cx"> 
</span><span class="cx">   ret = hw_tree_find_device (me, peer);
</span><span class="cx">   if (!ret)
</span>-    hw_abort (me, "Unable to locate peer for %s (%#x)", hw_name (dma), pmap);
+    hw_abort (me, "Unable to locate peer for %s (pmap:%#x %s)",
+	      hw_name (dma), pmap, peer);
<span class="cx">   return ret;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines"> <at>  <at>  -86,6 +87,40  <at>  <at> 
</span><span class="cx">     return CTYPE;	/* MDMA */
</span><span class="cx"> }
</span><span class="cx"> 
</span>+static const unsigned int bfin_dmac_52x_mdma_map[] = {
+  /* MDMA0 */
+  [12] = 13,
+  [13] = 12,
+  /* MDMA1 */
+  [14] = 15,
+  [15] = 14,
+};
+
+static const char *bfin_dmac_52x_pmap[] = {
+  "ppi", "emac", "emac", "sport <at> 0", "sport <at> 0", "sport <at> 1",
+  "sport <at> 1", "spi", "uart <at> 0", "uart <at> 0", "uart <at> 1", "uart <at> 1",
+};
+
+/* XXX: Need to figure out how to handle portmuxed DMA channels
+        like PPI/NFC here which share DMA0.  */
+static const struct hw_port_descriptor bfin_dmac_52x_ports[] = {
+  { "ppi",         0, 0, input_port, },
+/*{ "nfc",         0, 0, input_port, },*/
+  { "emac_rx",     1, 0, input_port, },
+/*{ "hostdp",      1, 0, input_port, },*/
+  { "emac_tx",     2, 0, input_port, },
+/*{ "nfc",         2, 0, input_port, },*/
+  { "sport <at> 0_tx",  3, 0, input_port, },
+  { "sport <at> 0_rx",  4, 0, input_port, },
+  { "sport <at> 1_tx",  5, 0, input_port, },
+  { "sport <at> 1_rx",  6, 0, input_port, },
+  { "spi",         7, 0, input_port, },
+  { "uart <at> 0_tx",   8, 0, input_port, },
+  { "uart <at> 0_rx",   9, 0, input_port, },
+  { "uart <at> 1_tx",  10, 0, input_port, },
+  { "uart <at> 1_rx",  11, 0, input_port, },
+};
+
<span class="cx"> static const unsigned int bfin_dmac_537_mdma_map[] = {
</span><span class="cx">   /* MDMA0 */
</span><span class="cx">   [12] = 13,
</span><span class="lines"> <at>  <at>  -156,6 +191,13  <at>  <at> 
</span><span class="cx"> 
</span><span class="cx">   switch (hw_find_integer_property (me, "type"))
</span><span class="cx">     {
</span>+    case 522 ... 527:
+      dmac-&gt;pmap = bfin_dmac_52x_pmap;
+      dmac-&gt;pmap_count = ARRAY_SIZE (bfin_dmac_52x_pmap);
+      dmac-&gt;mdma_map = bfin_dmac_52x_mdma_map;
+      dmac-&gt;mdma_count = ARRAY_SIZE (bfin_dmac_52x_mdma_map);
+      set_hw_ports (me, bfin_dmac_52x_ports);
+      break;
<span class="cx">     case 534:
</span><span class="cx">     case 536:
</span><span class="cx">     case 537:
</span></span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c (4753 =&gt; 4754)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c	2010-08-01 07:05:56 UTC (rev 4753)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c	2010-08-01 23:00:33 UTC (rev 4754)
</span><span class="lines"> <at>  <at>  -27,37 +27,55  <at>  <at> 
</span><span class="cx"> 
</span><span class="cx"> struct bfin_sic
</span><span class="cx"> {
</span>+  /* We assume first element is the base.  */
<span class="cx">   bu32 base;
</span><span class="cx"> 
</span><span class="cx">   /* Order after here is important -- matches hardware MMR layout.  */
</span>-  /* XXX: This is the 537 SIC.  */
<span class="cx">   bu16 BFIN_MMR_16(swrst);
</span><span class="cx">   bu16 BFIN_MMR_16(syscr);
</span><span class="cx">   bu16 BFIN_MMR_16(rvect);
</span>-  bu32 imask;
<span class="cx">   union {
</span>-    bu32 iar[4];
-    struct { bu32 iar0, iar1, iar2, iar3; };
+    struct {
+      bu32 imask0;
+      bu32 iar0, iar1, iar2, iar3;
+      bu32 isr0, iwr0;
+      bu32 _pad0[9];
+      bu32 imask1;
+      bu32 iar4, iar5, iar6, iar7;
+      bu32 isr1, iwr1;
+    } bf52x;
+    struct {
+      bu32 imask;
+      bu32 iar0, iar1, iar2, iar3;
+      bu32 isr, iwr;
+    } bf537;
<span class="cx">   };
</span>-  bu32 isr, iwr;
<span class="cx"> };
</span><span class="cx"> #define mmr_base()      offsetof(struct bfin_sic, swrst)
</span><span class="cx"> #define mmr_offset(mmr) (offsetof(struct bfin_sic, mmr) - mmr_base())
</span>+#define mmr_idx(mmr)    (mmr_offset (mmr) / 4)
<span class="cx"> 
</span>-static const char * const mmr_names[] = {
+static const char * const bf52x_mmr_names[] = {
+  "SWRST", "SYSCR", "SIC_RVECT", "SIC_IMASK0", "SIC_IAR0", "SIC_IAR1",
+  "SIC_IAR2", "SIC_IAR3", "SIC_ISR0", "SIC_IWR0",
+  [mmr_idx (bf52x.imask1)] = "SIC_IMASK1", "SIC_IAR4", "SIC_IAR5",
+  "SIC_IAR6", "SIC_IAR7", "SIC_ISR1", "SIC_IWR1",
+};
+static const char * const bf537_mmr_names[] = {
<span class="cx">   "SWRST", "SYSCR", "SIC_RVECT", "SIC_IMASK", "SIC_IAR0", "SIC_IAR1",
</span><span class="cx">   "SIC_IAR2", "SIC_IAR3", "SIC_ISR", "SIC_IWR",
</span><span class="cx"> };
</span>-#define mmr_name(off) mmr_names[(off) / 4]
+static const char * const *mmr_names;
+#define mmr_name(off) (mmr_names[(off) / 4] ? : "&lt;INV&gt;")
<span class="cx"> 
</span><span class="cx"> static void
</span>-bfn_sic_forward_interrupts (struct hw *me, struct bfin_sic *sic)
+bfin_sic_forward_interrupts (struct hw *me, bu32 *isr, bu32 *imask, bu32 *iar)
<span class="cx"> {
</span><span class="cx">   int my_port;
</span><span class="cx">   bu32 ipend;
</span><span class="cx"> 
</span><span class="cx">   /* Process pending and unmasked interrupts.  */
</span>-  ipend = sic-&gt;isr &amp; sic-&gt;imask;
+  ipend = *isr &amp; *imask;
<span class="cx"> 
</span><span class="cx">   /* Usually none are pending unmasked, so avoid bit twiddling.  */
</span><span class="cx">   if (!ipend)
</span><span class="lines"> <at>  <at>  -65,7 +83,7  <at>  <at> 
</span><span class="cx"> 
</span><span class="cx">   for (my_port = 0; my_port &lt; 32; ++my_port)
</span><span class="cx">     {
</span>-      bu32 iar_idx, iar_off, iar;
+      bu32 iar_idx, iar_off, iar_val;
<span class="cx">       bu32 bit = (1 &lt;&lt; my_port);
</span><span class="cx"> 
</span><span class="cx">       /* This bit isn't pending, so check next one.  */
</span><span class="lines"> <at>  <at>  -76,14 +94,21  <at>  <at> 
</span><span class="cx">          Every 4 bits in the IAR are used to map to IVG{7..15}.  */
</span><span class="cx">       iar_idx = my_port / 8;
</span><span class="cx">       iar_off = (my_port % 8) * 4;
</span>-      iar = (sic-&gt;iar[iar_idx] &amp; (0xf &lt;&lt; iar_off)) &gt;&gt; iar_off;
-      hw_port_event (me, IVG7 + iar, 1);
+      iar_val = (iar[iar_idx] &amp; (0xf &lt;&lt; iar_off)) &gt;&gt; iar_off;
+      hw_port_event (me, IVG7 + iar_val, 1);
<span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span>+static void
+bfin_sic_52x_forward_interrupts (struct hw *me, struct bfin_sic *sic)
+{
+  bfin_sic_forward_interrupts (me, &amp;sic-&gt;bf52x.isr0, &amp;sic-&gt;bf52x.imask0, &amp;sic-&gt;bf52x.iar0);
+  bfin_sic_forward_interrupts (me, &amp;sic-&gt;bf52x.isr1, &amp;sic-&gt;bf52x.imask1, &amp;sic-&gt;bf52x.iar4);
+}
+
<span class="cx"> static unsigned
</span>-bfin_sic_io_write_buffer (struct hw *me, const void *source,
-			  int space, address_word addr, unsigned nr_bytes)
+bfin_sic_52x_io_write_buffer (struct hw *me, const void *source, int space,
+			      address_word addr, unsigned nr_bytes)
<span class="cx"> {
</span><span class="cx">   struct bfin_sic *sic = hw_data (me);
</span><span class="cx">   bu32 mmr_off;
</span><span class="lines"> <at>  <at>  -113,18 +138,19  <at>  <at> 
</span><span class="cx">     case mmr_offset(syscr):
</span><span class="cx">       /* XXX: what to do ...  */
</span><span class="cx">       break;
</span>-    case mmr_offset(imask):
-      bfn_sic_forward_interrupts (me, sic);
+    case mmr_offset(bf52x.imask0):
+    case mmr_offset(bf52x.imask1):
+      bfin_sic_52x_forward_interrupts (me, sic);
<span class="cx">       *value32p = value;
</span><span class="cx">       break;
</span>-    case mmr_offset(iar0):
-    case mmr_offset(iar1):
-    case mmr_offset(iar2):
-    case mmr_offset(iar3):
-    case mmr_offset(iwr):
+    case mmr_offset(bf52x.iar0) ... mmr_offset(bf52x.iar3):
+    case mmr_offset(bf52x.iar4) ... mmr_offset(bf52x.iar7):
+    case mmr_offset(bf52x.iwr0):
+    case mmr_offset(bf52x.iwr1):
<span class="cx">       *value32p = value;
</span><span class="cx">       break;
</span>-    case mmr_offset(isr):
+    case mmr_offset(bf52x.isr0):
+    case mmr_offset(bf52x.isr1):
<span class="cx">       /* ISR is read-only.  */
</span><span class="cx">       break;
</span><span class="cx">     default:
</span><span class="lines"> <at>  <at>  -136,8 +162,8  <at>  <at> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static unsigned
</span>-bfin_sic_io_read_buffer (struct hw *me, void *dest,
-			 int space, address_word addr, unsigned nr_bytes)
+bfin_sic_52x_io_read_buffer (struct hw *me, void *dest, int space,
+			     address_word addr, unsigned nr_bytes)
<span class="cx"> {
</span><span class="cx">   struct bfin_sic *sic = hw_data (me);
</span><span class="cx">   bu32 mmr_off;
</span><span class="lines"> <at>  <at>  -159,13 +185,14  <at>  <at> 
</span><span class="cx">     case mmr_offset(rvect):
</span><span class="cx">       dv_store_2 (dest, *value16p);
</span><span class="cx">       break;
</span>-    case mmr_offset(imask):
-    case mmr_offset(iar0):
-    case mmr_offset(iar1):
-    case mmr_offset(iar2):
-    case mmr_offset(iar3):
-    case mmr_offset(isr):
-    case mmr_offset(iwr):
+    case mmr_offset(bf52x.imask0):
+    case mmr_offset(bf52x.imask1):
+    case mmr_offset(bf52x.iar0) ... mmr_offset(bf52x.iar3):
+    case mmr_offset(bf52x.iar4) ... mmr_offset(bf52x.iar7):
+    case mmr_offset(bf52x.iwr0):
+    case mmr_offset(bf52x.iwr1):
+    case mmr_offset(bf52x.isr0):
+    case mmr_offset(bf52x.isr1):
<span class="cx">       dv_store_4 (dest, *value32p);
</span><span class="cx">       break;
</span><span class="cx">     default:
</span><span class="lines"> <at>  <at>  -179,68 +206,257  <at>  <at> 
</span><span class="cx">   return nr_bytes;
</span><span class="cx"> }
</span><span class="cx"> 
</span>+static void
+bfin_sic_537_forward_interrupts (struct hw *me, struct bfin_sic *sic)
+{
+  bfin_sic_forward_interrupts (me, &amp;sic-&gt;bf537.isr, &amp;sic-&gt;bf537.imask, &amp;sic-&gt;bf537.iar0);
+}
+
+static unsigned
+bfin_sic_537_io_write_buffer (struct hw *me, const void *source, int space,
+			      address_word addr, unsigned nr_bytes)
+{
+  struct bfin_sic *sic = hw_data (me);
+  bu32 mmr_off;
+  bu32 value;
+  bu16 *value16p;
+  bu32 *value32p;
+  void *valuep;
+
+  if (nr_bytes == 4)
+    value = dv_load_4 (source);
+  else
+    value = dv_load_2 (source);
+
+  mmr_off = addr - sic-&gt;base;
+  valuep = (void *)((unsigned long)sic + mmr_base() + mmr_off);
+  value16p = valuep;
+  value32p = valuep;
+
+  HW_TRACE_WRITE ();
+
+  /* XXX: Discard all SIC writes for now.  */
+  switch (mmr_off)
+    {
+    case mmr_offset(swrst):
+      /* XXX: This should trigger a software reset ...  */
+      break;
+    case mmr_offset(syscr):
+      /* XXX: what to do ...  */
+      break;
+    case mmr_offset(bf537.imask):
+      bfin_sic_537_forward_interrupts (me, sic);
+      *value32p = value;
+      break;
+    case mmr_offset(bf537.iar0):
+    case mmr_offset(bf537.iar1):
+    case mmr_offset(bf537.iar2):
+    case mmr_offset(bf537.iar3):
+    case mmr_offset(bf537.iwr):
+      *value32p = value;
+      break;
+    case mmr_offset(bf537.isr):
+      /* ISR is read-only.  */
+      break;
+    default:
+      /* XXX: Should discard other writes.  */
+      ;
+    }
+
+  return nr_bytes;
+}
+
+static unsigned
+bfin_sic_537_io_read_buffer (struct hw *me, void *dest, int space,
+			     address_word addr, unsigned nr_bytes)
+{
+  struct bfin_sic *sic = hw_data (me);
+  bu32 mmr_off;
+  bu16 *value16p;
+  bu32 *value32p;
+  void *valuep;
+
+  mmr_off = addr - sic-&gt;base;
+  valuep = (void *)((unsigned long)sic + mmr_base() + mmr_off);
+  value16p = valuep;
+  value32p = valuep;
+
+  HW_TRACE_READ ();
+
+  switch (mmr_off)
+    {
+    case mmr_offset(swrst):
+    case mmr_offset(syscr):
+    case mmr_offset(rvect):
+      dv_store_2 (dest, *value16p);
+      break;
+    case mmr_offset(bf537.imask):
+    case mmr_offset(bf537.iar0):
+    case mmr_offset(bf537.iar1):
+    case mmr_offset(bf537.iar2):
+    case mmr_offset(bf537.iar3):
+    case mmr_offset(bf537.isr):
+    case mmr_offset(bf537.iwr):
+      dv_store_4 (dest, *value32p);
+      break;
+    default:
+      if (nr_bytes == 2)
+	dv_store_2 (dest, 0);
+      else
+	dv_store_4 (dest, 0);
+      break;
+    }
+
+  return nr_bytes;
+}
+
<span class="cx"> /* XXX: This doesn't handle DMA&lt;-&gt;peripheral mappings.  */
</span>-static const struct hw_port_descriptor bfin_sic_537_ports[] = {
-  { "pll",           0, 0, input_port, },
-  { "dma_stat",     10, 0, input_port, },
-  { "dmar0_block",  11, 0, input_port, },
-  { "dmar1_block",  12, 0, input_port, },
-  { "dmar0_over",   13, 0, input_port, },
-  { "dmar1_over",   14, 0, input_port, },
-  { "can_stat",     20, 0, input_port, },
-  { "emac_stat",    21, 0, input_port, },
-  { "sport <at> 0_stat", 22, 0, input_port, },
-  { "sport <at> 1_stat", 23, 0, input_port, },
-  { "ppi",          24, 0, input_port, },
-  { "spi_stat",     25, 0, input_port, },
-  { "uart <at> 0_stat",  26, 0, input_port, },
-  { "uart <at> 1_stat",  27, 0, input_port, },
-  { "rtc",          30, 0, input_port, },
-  { "dma0",         40, 0, input_port, },
-  { "dma3",         50, 0, input_port, },
-  { "dma4",         60, 0, input_port, },
-  { "dma5",         70, 0, input_port, },
-  { "dma6",         80, 0, input_port, },
-  { "twi",          90, 0, input_port, },
-  { "dma7",        100, 0, input_port, },
-  { "dma8",        110, 0, input_port, },
-  { "dma9",        120, 0, input_port, },
-  { "dma10",       130, 0, input_port, },
-  { "dma11",       140, 0, input_port, },
-  { "can_rx",      150, 0, input_port, },
-  { "can_tx",      160, 0, input_port, },
-  { "dma1",        170, 0, input_port, },
-  { "porth_irq_a", 171, 0, input_port, },
-  { "dma2",        180, 0, input_port, },
-  { "porth_irq_b", 181, 0, input_port, },
-  { "gptimer <at> 0",   190, 0, input_port, },
-  { "gptimer <at> 1",   200, 0, input_port, },
-  { "gptimer <at> 2",   210, 0, input_port, },
-  { "gptimer <at> 3",   220, 0, input_port, },
-  { "gptimer <at> 4",   230, 0, input_port, },
-  { "gptimer <at> 5",   240, 0, input_port, },
-  { "gptimer <at> 6",   250, 0, input_port, },
-  { "gptimer <at> 7",   260, 0, input_port, },
-  { "portf_irq_a", 270, 0, input_port, },
-  { "portg_irq_a", 271, 0, input_port, },
-  { "portg_irq_b", 280, 0, input_port, },
-  { "mdma0",       290, 0, input_port, },
-  { "mdma1",       300, 0, input_port, },
-  { "watchdog",    310, 0, input_port, },
-  { "portf_irq_b", 311, 0, input_port, },
+#define BFIN_SIC_TO_CEC_PORTS \
+  { "ivg7",  IVG7,  0, output_port, }, \
+  { "ivg8",  IVG8,  0, output_port, }, \
+  { "ivg9",  IVG9,  0, output_port, }, \
+  { "ivg10", IVG10, 0, output_port, }, \
+  { "ivg11", IVG11, 0, output_port, }, \
+  { "ivg12", IVG12, 0, output_port, }, \
+  { "ivg13", IVG13, 0, output_port, }, \
+  { "ivg14", IVG14, 0, output_port, }, \
+  { "ivg15", IVG15, 0, output_port, },
<span class="cx"> 
</span>-  { "ivg7",  IVG7,  0, output_port, },
-  { "ivg8",  IVG8,  0, output_port, },
-  { "ivg9",  IVG9,  0, output_port, },
-  { "ivg10", IVG10, 0, output_port, },
-  { "ivg11", IVG11, 0, output_port, },
-  { "ivg12", IVG12, 0, output_port, },
-  { "ivg13", IVG13, 0, output_port, },
-  { "ivg14", IVG14, 0, output_port, },
-  { "ivg15", IVG15, 0, output_port, },
+static const struct hw_port_descriptor bfin_sic_52x_ports[] = {
+  BFIN_SIC_TO_CEC_PORTS
+  /* SIC0 */
+  { "pll",            0, 0, input_port, },
+  { "dma_stat",       1, 0, input_port, },
+  { "dmar0_block",    2, 0, input_port, },
+  { "dmar1_block",    3, 0, input_port, },
+  { "dmar0_over",     4, 0, input_port, },
+  { "dmar1_over",     5, 0, input_port, },
+  { "ppi",            6, 0, input_port, },
+  { "emac_stat",      7, 0, input_port, },
+  { "sport <at> 0_stat",   8, 0, input_port, },
+  { "sport <at> 1_stat",   9, 0, input_port, },
+  { "uart <at> 0_stat",   12, 0, input_port, },
+  { "uart <at> 1_stat",   13, 0, input_port, },
+  { "rtc",           14, 0, input_port, },
+  { "dma0",          15, 0, input_port, },
+  { "dma3",          16, 0, input_port, },
+  { "dma4",          17, 0, input_port, },
+  { "dma5",          18, 0, input_port, },
+  { "dma6",          19, 0, input_port, },
+  { "twi",           20, 0, input_port, },
+  { "dma7",          21, 0, input_port, },
+  { "dma8",          22, 0, input_port, },
+  { "dma9",          23, 0, input_port, },
+  { "dma10",         24, 0, input_port, },
+  { "dma11",         25, 0, input_port, },
+  { "otp",           26, 0, input_port, },
+  { "counter",       27, 0, input_port, },
+  { "dma1",          28, 0, input_port, },
+  { "porth_irq_a",   29, 0, input_port, },
+  { "dma2",          30, 0, input_port, },
+  { "porth_irq_b",   31, 0, input_port, },
+  /* SIC1 */
+  { "gptimer <at> 0",    100, 0, input_port, },
+  { "gptimer <at> 1",    101, 0, input_port, },
+  { "gptimer <at> 2",    102, 0, input_port, },
+  { "gptimer <at> 3",    103, 0, input_port, },
+  { "gptimer <at> 4",    104, 0, input_port, },
+  { "gptimer <at> 5",    105, 0, input_port, },
+  { "gptimer <at> 6",    106, 0, input_port, },
+  { "gptimer <at> 7",    107, 0, input_port, },
+  { "portg_irq_a",  108, 0, input_port, },
+  { "portg_irq_b",  109, 0, input_port, },
+  { "mdma0",        110, 0, input_port, },
+  { "mdma1",        111, 0, input_port, },
+  { "watchdog",     112, 0, input_port, },
+  { "portf_irq_a",  113, 0, input_port, },
+  { "portf_irq_b",  114, 0, input_port, },
+  { "spi_stat",     115, 0, input_port, },
+  { "nfc_stat",     116, 0, input_port, },
+  { "hostdp_stat",  117, 0, input_port, },
+  { "hostdp_done",  118, 0, input_port, },
+  { "usb_int0",     120, 0, input_port, },
+  { "usb_int1",     121, 0, input_port, },
+  { "usb_int2",     122, 0, input_port, },
<span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static void
</span>+bfin_sic_52x_port_event (struct hw *me, int my_port, struct hw *source,
+			 int source_port, int level)
+{
+  struct bfin_sic *sic = hw_data (me);
+  bu32 idx = my_port / 100;
+  bu32 bit = (1 &lt;&lt; (my_port &amp; 0x1f));
+
+  /* SIC only exists to forward interrupts from the system to the CEC.  */
+  switch (idx)
+    {
+    case 0: sic-&gt;bf52x.isr0 |= bit; break;
+    case 1: sic-&gt;bf52x.isr1 |= bit; break;
+    }
+
+  /* XXX: Handle SIC wakeup source ?
+  if (sic-&gt;bf52x.iwr0 &amp; bit)
+    What to do ?;
+  if (sic-&gt;bf52x.iwr1 &amp; bit)
+    What to do ?;
+   */
+
+  bfin_sic_52x_forward_interrupts (me, sic);
+}
+
+static const struct hw_port_descriptor bfin_sic_537_ports[] = {
+  BFIN_SIC_TO_CEC_PORTS
+  { "pll",            0, 0, input_port, },
+  { "dma_stat",      10, 0, input_port, },
+  { "dmar0_block",   11, 0, input_port, },
+  { "dmar1_block",   12, 0, input_port, },
+  { "dmar0_over",    13, 0, input_port, },
+  { "dmar1_over",    14, 0, input_port, },
+  { "can_stat",      20, 0, input_port, },
+  { "emac_stat",     21, 0, input_port, },
+  { "sport <at> 0_stat",  22, 0, input_port, },
+  { "sport <at> 1_stat",  23, 0, input_port, },
+  { "ppi",           24, 0, input_port, },
+  { "spi_stat",      25, 0, input_port, },
+  { "uart <at> 0_stat",   26, 0, input_port, },
+  { "uart <at> 1_stat",   27, 0, input_port, },
+  { "rtc",           30, 0, input_port, },
+  { "dma0",          40, 0, input_port, },
+  { "dma3",          50, 0, input_port, },
+  { "dma4",          60, 0, input_port, },
+  { "dma5",          70, 0, input_port, },
+  { "dma6",          80, 0, input_port, },
+  { "twi",           90, 0, input_port, },
+  { "dma7",         100, 0, input_port, },
+  { "dma8",         110, 0, input_port, },
+  { "dma9",         120, 0, input_port, },
+  { "dma10",        130, 0, input_port, },
+  { "dma11",        140, 0, input_port, },
+  { "can_rx",       150, 0, input_port, },
+  { "can_tx",       160, 0, input_port, },
+  { "dma1",         170, 0, input_port, },
+  { "porth_irq_a",  171, 0, input_port, },
+  { "dma2",         180, 0, input_port, },
+  { "porth_irq_b",  181, 0, input_port, },
+  { "gptimer <at> 0",    190, 0, input_port, },
+  { "gptimer <at> 1",    200, 0, input_port, },
+  { "gptimer <at> 2",    210, 0, input_port, },
+  { "gptimer <at> 3",    220, 0, input_port, },
+  { "gptimer <at> 4",    230, 0, input_port, },
+  { "gptimer <at> 5",    240, 0, input_port, },
+  { "gptimer <at> 6",    250, 0, input_port, },
+  { "gptimer <at> 7",    260, 0, input_port, },
+  { "portf_irq_a",  270, 0, input_port, },
+  { "portg_irq_a",  271, 0, input_port, },
+  { "portg_irq_b",  280, 0, input_port, },
+  { "mdma0",        290, 0, input_port, },
+  { "mdma1",        300, 0, input_port, },
+  { "watchdog",     310, 0, input_port, },
+  { "portf_irq_b",  311, 0, input_port, },
+};
+
+static void
<span class="cx"> bfin_sic_537_port_event (struct hw *me, int my_port, struct hw *source,
</span><span class="cx"> 			 int source_port, int level)
</span><span class="cx"> {
</span><span class="lines"> <at>  <at>  -248,14 +464,14  <at>  <at> 
</span><span class="cx">   bu32 bit = (1 &lt;&lt; (my_port / 10));
</span><span class="cx"> 
</span><span class="cx">   /* SIC only exists to forward interrupts from the system to the CEC.  */
</span>-  sic-&gt;isr |= bit;
+  sic-&gt;bf537.isr |= bit;
<span class="cx"> 
</span><span class="cx">   /* XXX: Handle SIC wakeup source ?
</span>-  if (sic-&gt;iwr &amp; bit)
+  if (sic-&gt;bf537.iwr &amp; bit)
<span class="cx">     What to do ?;
</span><span class="cx">    */
</span><span class="cx"> 
</span>-  bfn_sic_forward_interrupts (me, sic);
+  bfin_sic_537_forward_interrupts (me, sic);
<span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void
</span><span class="lines"> <at>  <at>  -294,21 +510,51  <at>  <at> 
</span><span class="cx">   sic = HW_ZALLOC (me, struct bfin_sic);
</span><span class="cx"> 
</span><span class="cx">   set_hw_data (me, sic);
</span>-  set_hw_io_read_buffer (me, bfin_sic_io_read_buffer);
-  set_hw_io_write_buffer (me, bfin_sic_io_write_buffer);
-  set_hw_ports (me, bfin_sic_537_ports);
-  set_hw_port_event (me, bfin_sic_537_port_event);
-
<span class="cx">   attach_bfin_sic_regs (me, sic);
</span><span class="cx"> 
</span>-  /* Initialize the SIC.  */
-  sic-&gt;imask = 0x00000000;
-  sic-&gt;iar0 = 0x22211000;
-  sic-&gt;iar1 = 0x43333332;
-  sic-&gt;iar2 = 0x55555444;
-  sic-&gt;iar3 = 0x66655555;
-  sic-&gt;isr = 0x00000000;
-  sic-&gt;iwr = 0xFFFFFFFF;
+  switch (hw_find_integer_property (me, "type"))
+    {
+    case 522 ... 527:
+      set_hw_io_read_buffer (me, bfin_sic_52x_io_read_buffer);
+      set_hw_io_write_buffer (me, bfin_sic_52x_io_write_buffer);
+      set_hw_ports (me, bfin_sic_52x_ports);
+      set_hw_port_event (me, bfin_sic_52x_port_event);
+      mmr_names = bf52x_mmr_names;
+
+      /* Initialize the SIC.  */
+      sic-&gt;bf52x.imask0 = sic-&gt;bf52x.imask1 = 0;
+      sic-&gt;bf52x.isr0 = sic-&gt;bf52x.isr1 = 0;
+      sic-&gt;bf52x.iwr0 = sic-&gt;bf52x.iwr1 = 0xFFFFFFFF;
+      sic-&gt;bf52x.iar0 = 0x00000000;
+      sic-&gt;bf52x.iar1 = 0x11000000;
+      sic-&gt;bf52x.iar2 = 0x33332222;
+      sic-&gt;bf52x.iar3 = 0x44444433;
+      sic-&gt;bf52x.iar4 = 0x55555555;
+      sic-&gt;bf52x.iar5 = 0x06666655;
+      sic-&gt;bf52x.iar6 = 0x33333000;
+      sic-&gt;bf52x.iar7 = 0x00000000;
+      break;
+    case 534:
+    case 536:
+    case 537:
+      set_hw_io_read_buffer (me, bfin_sic_537_io_read_buffer);
+      set_hw_io_write_buffer (me, bfin_sic_537_io_write_buffer);
+      set_hw_ports (me, bfin_sic_537_ports);
+      set_hw_port_event (me, bfin_sic_537_port_event);
+      mmr_names = bf537_mmr_names;
+
+      /* Initialize the SIC.  */
+      sic-&gt;bf537.imask = 0;
+      sic-&gt;bf537.isr = 0;
+      sic-&gt;bf537.iwr = 0xFFFFFFFF;
+      sic-&gt;bf537.iar0 = 0x22211000;
+      sic-&gt;bf537.iar1 = 0x43333332;
+      sic-&gt;bf537.iar2 = 0x55555444;
+      sic-&gt;bf537.iar3 = 0x66655555;
+      break;
+    default:
+      hw_abort (me, "no support for SIC on this Blackfin model yet");
+    }
<span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const struct hw_descriptor dv_bfin_sic_descriptor[] = {
</span></span>
</div>
</div>

</div>
vapier | 2 Aug 2010 03:23
Favicon

[4755] trunk/binutils-2.17/sim/bfin/machs.c: sim: add SPORT stubs as some ports use those to workaround anomalies

Revision 4755 Author vapier Date 2010-08-01 21:23:47 -0400 (Sun, 01 Aug 2010)

Log Message

sim: add SPORT stubs as some ports use those to workaround anomalies

Modified Paths

Diff

Modified: trunk/binutils-2.17/sim/bfin/machs.c (4754 => 4755)

--- trunk/binutils-2.17/sim/bfin/machs.c 2010-08-01 23:00:33 UTC (rev 4754) +++ trunk/binutils-2.17/sim/bfin/machs.c 2010-08-02 01:23:47 UTC (rev 4755) <at> <at> -108,6 +108,8 <at> <at> LAYOUT (0xFFC00500, 0x20, read_write), /* SPI0 stub */ LAYOUT (0xFFC00680, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ LAYOUT (0xFFC01700, 0x50, read_write), /* PORTH stub */ <at> <at> -167,6 +169,8 <at> <at> LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ LAYOUT (0xFFC00680, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ LAYOUT (0xFFC01700, 0x50, read_write), /* PORTH stub */ <at> <at> -228,6 +232,8 <at> <at> LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ LAYOUT (0xFFC00640, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* GPIO stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ LAYOUT (0xFFA08000, 0x4000, read_write_exec), /* Inst B [1] */ LAYOUT (0xFFA10000, 0x4000, read_write_exec), /* Inst Cache [1] */ <at> <at> -236,6 +242,8 <at> <at> LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ LAYOUT (0xFFC00640, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* GPIO stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ LAYOUT (0xFF904000, 0x4000, read_write), /* Data B Cache */ LAYOUT (0xFFA08000, 0x4000, read_write_exec), /* Inst B [1] */ <at> <at> -246,6 +254,8 <at> <at> LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ LAYOUT (0xFFC00640, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* GPIO stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFF800000, 0x4000, read_write), /* Data A */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ LAYOUT (0xFF900000, 0x4000, read_write), /* Data B */ <at> <at> -272,6 +282,8 <at> <at> LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ LAYOUT (0xFFC00680, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ LAYOUT (0xFFC01700, 0x50, read_write), /* PORTH stub */ <at> <at> -288,6 +300,8 <at> <at> LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ LAYOUT (0xFFC00680, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ LAYOUT (0xFFC01700, 0x50, read_write), /* PORTG stub */ <at> <at> -302,6 +316,8 <at> <at> LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ LAYOUT (0xFFC00680, 0xC, read_write), /* TIMER stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* PORTG stub */ LAYOUT (0xFFC01700, 0x50, read_write), /* PORTG stub */ <at> <at> -349,11 +365,15 <at> <at> static const struct bfin_memory_layout bf538_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI0 stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* PORTF stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFFC01400, 0x90, read_write), /* TWI0 stub */ LAYOUT (0xFFC01500, 0x70, read_write), /* PORTC/D/E stub */ LAYOUT (0xFFC02200, 0x90, read_write), /* TWI1 stub */ LAYOUT (0xFFC02300, 0x20, read_write), /* SPI1 stub */ LAYOUT (0xFFC02400, 0x20, read_write), /* SPI2 stub */ + LAYOUT (0xFFC02500, 0x60, read_write), /* SPORT2 stub */ + LAYOUT (0xFFC02600, 0x60, read_write), /* SPORT3 stub */ LAYOUT (0xFF800000, 0x4000, read_write), /* Data A */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ LAYOUT (0xFF900000, 0x4000, read_write), /* Data B */ <at> <at> -389,9 +409,13 <at> <at> static const struct bfin_memory_layout bf54x_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI0 stub */ LAYOUT (0xFFC00700, 0x90, read_write), /* TWI0 stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub XXX: not on BF542/4 */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFFC01400, 0x200, read_write), /* PORT/GPIO stub */ LAYOUT (0xFFC02200, 0x90, read_write), /* TWI1 stub */ LAYOUT (0xFFC02300, 0x20, read_write), /* SPI1 stub */ + LAYOUT (0xFFC02500, 0x60, read_write), /* SPORT2 stub */ + LAYOUT (0xFFC02600, 0x60, read_write), /* SPORT3 stub */ LAYOUT (0xFFC03C00, 0xd00, read_write), /* MUSB stub */ LAYOUT (0xFFC04300, 0x10, read_write), /* OTP stub */ LAYOUT (0xFFC04380, 0x10, read_write), /* OTP Data stub */ <at> <at> -430,6 +454,8 <at> <at> static const struct bfin_memory_layout bf561_mem[] = { LAYOUT (0xFFC00500, 0x20, read_write), /* SPI stub */ LAYOUT (0xFFC00700, 0x50, read_write), /* GPIO0 stub */ + LAYOUT (0xFFC00800, 0x60, read_write), /* SPORT0 stub */ + LAYOUT (0xFFC00900, 0x60, read_write), /* SPORT1 stub */ LAYOUT (0xFFC01500, 0x50, read_write), /* GPIO1 stub */ LAYOUT (0xFFC01700, 0x50, read_write), /* GPIO2 stub */ LAYOUT (0xFEB00000, 0x20000, read_write_exec), /* L2 */
<div>

<div>
Revision <a href="http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/?action=browse&amp;path=/&amp;view=rev&amp;root=toolchain&amp;revision=4755">4755</a>
Author <a href="http://blackfin.uclinux.org/gf/user/vapier/">vapier</a>
Date 2010-08-01 21:23:47 -0400 (Sun, 01 Aug 2010)
<h3>Log Message</h3>
sim: add SPORT stubs as some ports use those to workaround anomalies

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfinmachsc">trunk/binutils-2.17/sim/bfin/machs.c</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/machs.c (4754 =&gt; 4755)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/machs.c	2010-08-01 23:00:33 UTC (rev 4754)
+++ trunk/binutils-2.17/sim/bfin/machs.c	2010-08-02 01:23:47 UTC (rev 4755)
</span><span class="lines"> <at>  <at>  -108,6 +108,8  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI0 stub */
</span><span class="cx">   LAYOUT (0xFFC00680, 0xC, read_write),		/* TIMER stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="cx">   LAYOUT (0xFFC01700, 0x50, read_write),	/* PORTH stub */
</span><span class="lines"> <at>  <at>  -167,6 +169,8  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span><span class="cx">   LAYOUT (0xFFC00680, 0xC, read_write),		/* TIMER stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="cx">   LAYOUT (0xFFC01700, 0x50, read_write),	/* PORTH stub */
</span><span class="lines"> <at>  <at>  -228,6 +232,8  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span><span class="cx">   LAYOUT (0xFFC00640, 0xC, read_write),		/* TIMER stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* GPIO stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="cx">   LAYOUT (0xFFA08000, 0x4000, read_write_exec),	/* Inst B [1] */
</span><span class="cx">   LAYOUT (0xFFA10000, 0x4000, read_write_exec),	/* Inst Cache [1] */
</span><span class="lines"> <at>  <at>  -236,6 +242,8  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span><span class="cx">   LAYOUT (0xFFC00640, 0xC, read_write),		/* TIMER stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* GPIO stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="cx">   LAYOUT (0xFF904000, 0x4000, read_write),	/* Data B Cache */
</span><span class="cx">   LAYOUT (0xFFA08000, 0x4000, read_write_exec),	/* Inst B [1] */
</span><span class="lines"> <at>  <at>  -246,6 +254,8  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span><span class="cx">   LAYOUT (0xFFC00640, 0xC, read_write),		/* TIMER stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* GPIO stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFF800000, 0x4000, read_write),	/* Data A */
</span><span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="cx">   LAYOUT (0xFF900000, 0x4000, read_write),	/* Data B */
</span><span class="lines"> <at>  <at>  -272,6 +282,8  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span><span class="cx">   LAYOUT (0xFFC00680, 0xC, read_write),		/* TIMER stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="cx">   LAYOUT (0xFFC01700, 0x50, read_write),	/* PORTH stub */
</span><span class="lines"> <at>  <at>  -288,6 +300,8  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span><span class="cx">   LAYOUT (0xFFC00680, 0xC, read_write),		/* TIMER stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="cx">   LAYOUT (0xFFC01700, 0x50, read_write),	/* PORTG stub */
</span><span class="lines"> <at>  <at>  -302,6 +316,8  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span><span class="cx">   LAYOUT (0xFFC00680, 0xC, read_write),		/* TIMER stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* PORTG stub */
</span><span class="cx">   LAYOUT (0xFFC01700, 0x50, read_write),	/* PORTG stub */
</span><span class="lines"> <at>  <at>  -349,11 +365,15  <at>  <at> 
</span><span class="cx"> static const struct bfin_memory_layout bf538_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI0 stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* PORTF stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFFC01400, 0x90, read_write),	/* TWI0 stub */
</span><span class="cx">   LAYOUT (0xFFC01500, 0x70, read_write),	/* PORTC/D/E stub */
</span><span class="cx">   LAYOUT (0xFFC02200, 0x90, read_write),	/* TWI1 stub */
</span><span class="cx">   LAYOUT (0xFFC02300, 0x20, read_write),	/* SPI1 stub */
</span><span class="cx">   LAYOUT (0xFFC02400, 0x20, read_write),	/* SPI2 stub */
</span>+  LAYOUT (0xFFC02500, 0x60, read_write),	/* SPORT2 stub */
+  LAYOUT (0xFFC02600, 0x60, read_write),	/* SPORT3 stub */
<span class="cx">   LAYOUT (0xFF800000, 0x4000, read_write),	/* Data A */
</span><span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="cx">   LAYOUT (0xFF900000, 0x4000, read_write),	/* Data B */
</span><span class="lines"> <at>  <at>  -389,9 +409,13  <at>  <at> 
</span><span class="cx"> static const struct bfin_memory_layout bf54x_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI0 stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x90, read_write),	/* TWI0 stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub XXX: not on BF542/4 */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFFC01400, 0x200, read_write),	/* PORT/GPIO stub */
</span><span class="cx">   LAYOUT (0xFFC02200, 0x90, read_write),	/* TWI1 stub */
</span><span class="cx">   LAYOUT (0xFFC02300, 0x20, read_write),	/* SPI1 stub */
</span>+  LAYOUT (0xFFC02500, 0x60, read_write),	/* SPORT2 stub */
+  LAYOUT (0xFFC02600, 0x60, read_write),	/* SPORT3 stub */
<span class="cx">   LAYOUT (0xFFC03C00, 0xd00, read_write),	/* MUSB stub */
</span><span class="cx">   LAYOUT (0xFFC04300, 0x10, read_write),	/* OTP stub */
</span><span class="cx">   LAYOUT (0xFFC04380, 0x10, read_write),	/* OTP Data stub */
</span><span class="lines"> <at>  <at>  -430,6 +454,8  <at>  <at> 
</span><span class="cx"> static const struct bfin_memory_layout bf561_mem[] = {
</span><span class="cx">   LAYOUT (0xFFC00500, 0x20, read_write),	/* SPI stub */
</span><span class="cx">   LAYOUT (0xFFC00700, 0x50, read_write),	/* GPIO0 stub */
</span>+  LAYOUT (0xFFC00800, 0x60, read_write),	/* SPORT0 stub */
+  LAYOUT (0xFFC00900, 0x60, read_write),	/* SPORT1 stub */
<span class="cx">   LAYOUT (0xFFC01500, 0x50, read_write),	/* GPIO1 stub */
</span><span class="cx">   LAYOUT (0xFFC01700, 0x50, read_write),	/* GPIO2 stub */
</span><span class="cx">   LAYOUT (0xFEB00000, 0x20000, read_write_exec),	/* L2 */
</span></span>
</div>
</div>

</div>
vapier | 2 Aug 2010 03:28
Favicon

[4756] trunk/binutils-2.17/sim/bfin/sim-main.h: sim: bfin: increase default memsize to 128MB to match the bf533-stamp

Revision 4756 Author vapier Date 2010-08-01 21:28:10 -0400 (Sun, 01 Aug 2010)

Log Message

sim: bfin: increase default memsize to 128MB to match the bf533-stamp

Modified Paths

Diff

Modified: trunk/binutils-2.17/sim/bfin/sim-main.h (4755 => 4756)

--- trunk/binutils-2.17/sim/bfin/sim-main.h 2010-08-02 01:23:47 UTC (rev 4755) +++ trunk/binutils-2.17/sim/bfin/sim-main.h 2010-08-02 01:28:10 UTC (rev 4756) <at> <at> -111,6 +111,6 <at> <at> #define TRACE_REG(cpu, reg, val) TRACE_REGISTER (cpu, "wrote "#reg" = %#x", val) /* Default memory size. */ -#define BFIN_DEFAULT_MEM_SIZE (64 * 1024 * 1024) +#define BFIN_DEFAULT_MEM_SIZE (128 * 1024 * 1024) #endif
<div>

<div>
Revision <a href="http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/?action=browse&amp;path=/&amp;view=rev&amp;root=toolchain&amp;revision=4756">4756</a>
Author <a href="http://blackfin.uclinux.org/gf/user/vapier/">vapier</a>
Date 2010-08-01 21:28:10 -0400 (Sun, 01 Aug 2010)
<h3>Log Message</h3>
sim: bfin: increase default memsize to 128MB to match the bf533-stamp

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfinsimmainh">trunk/binutils-2.17/sim/bfin/sim-main.h</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/sim-main.h (4755 =&gt; 4756)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/sim-main.h	2010-08-02 01:23:47 UTC (rev 4755)
+++ trunk/binutils-2.17/sim/bfin/sim-main.h	2010-08-02 01:28:10 UTC (rev 4756)
</span><span class="lines"> <at>  <at>  -111,6 +111,6  <at>  <at> 
</span><span class="cx"> #define TRACE_REG(cpu, reg, val) TRACE_REGISTER (cpu, "wrote "#reg" = %#x", val)
</span><span class="cx"> 
</span><span class="cx"> /* Default memory size.  */
</span>-#define BFIN_DEFAULT_MEM_SIZE (64 * 1024 * 1024)
+#define BFIN_DEFAULT_MEM_SIZE (128 * 1024 * 1024)
<span class="cx"> 
</span><span class="cx"> #endif
</span></span>
</div>
</div>

</div>
vapier | 2 Aug 2010 04:21
Favicon

[4757] trunk/binutils-2.17/sim/bfin: sim: bfin: initial BF533 SIC/ DMA support (boots u-boot and linux)

Revision 4757 Author vapier Date 2010-08-01 22:21:08 -0400 (Sun, 01 Aug 2010)

Log Message

sim: bfin: initial BF533 SIC/DMA support (boots u-boot and linux)

Modified Paths

Diff

Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c (4756 => 4757)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c 2010-08-02 01:28:10 UTC (rev 4756) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c 2010-08-02 02:21:08 UTC (rev 4757) <at> <at> -121,6 +121,31 <at> <at> { "uart <at> 1_rx", 11, 0, input_port, }, }; +static const unsigned int bfin_dmac_533_mdma_map[] = { + /* MDMA0 */ + [8] = 9, + [9] = 8, + /* MDMA1 */ + [10] = 11, + [11] = 10, +}; + +static const char *bfin_dmac_533_pmap[] = { + "ppi", "sport <at> 0", "sport <at> 0", "sport <at> 1", "sport <at> 1", "spi", + "uart <at> 0", "uart <at> 0", +}; + +static const struct hw_port_descriptor bfin_dmac_533_ports[] = { + { "ppi", 0, 0, input_port, }, + { "sport <at> 0_tx", 1, 0, input_port, }, + { "sport <at> 0_rx", 2, 0, input_port, }, + { "sport <at> 1_tx", 3, 0, input_port, }, + { "sport <at> 1_rx", 4, 0, input_port, }, + { "spi", 5, 0, input_port, }, + { "uart <at> 0_tx", 6, 0, input_port, }, + { "uart <at> 0_rx", 7, 0, input_port, }, +}; + static const unsigned int bfin_dmac_537_mdma_map[] = { /* MDMA0 */ [12] = 13, <at> <at> -198,6 +223,13 <at> <at> dmac->mdma_count = ARRAY_SIZE (bfin_dmac_52x_mdma_map); set_hw_ports (me, bfin_dmac_52x_ports); break; + case 531 ... 533: + dmac->pmap = bfin_dmac_533_pmap; + dmac->pmap_count = ARRAY_SIZE (bfin_dmac_533_pmap); + dmac->mdma_map = bfin_dmac_533_mdma_map; + dmac->mdma_count = ARRAY_SIZE (bfin_dmac_533_mdma_map); + set_hw_ports (me, bfin_dmac_533_ports); + break; case 534: case 536: case 537:

Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c (4756 => 4757)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c 2010-08-02 01:28:10 UTC (rev 4756) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c 2010-08-02 02:21:08 UTC (rev 4757) <at> <at> -405,6 +405,52 <at> <at> bfin_sic_52x_forward_interrupts (me, sic); } +static const struct hw_port_descriptor bfin_sic_533_ports[] = { + BFIN_SIC_TO_CEC_PORTS + { "pll", 0, 0, input_port, }, + { "dma_stat", 1, 0, input_port, }, + { "ppi", 2, 0, input_port, }, + { "sport <at> 0_stat", 3, 0, input_port, }, + { "sport <at> 1_stat", 4, 0, input_port, }, + { "spi", 5, 0, input_port, }, + { "uart <at> 0_stat", 6, 0, input_port, }, + { "rtc", 7, 0, input_port, }, + { "dma0", 8, 0, input_port, }, + { "dma1", 9, 0, input_port, }, + { "dma2", 10, 0, input_port, }, + { "dma3", 11, 0, input_port, }, + { "dma4", 12, 0, input_port, }, + { "dma5", 13, 0, input_port, }, + { "dma6", 14, 0, input_port, }, + { "dma7", 15, 0, input_port, }, + { "gptimer <at> 0", 16, 0, input_port, }, + { "gptimer <at> 1", 17, 0, input_port, }, + { "gptimer <at> 2", 18, 0, input_port, }, + { "portf_irq_a", 19, 0, input_port, }, + { "portf_irq_b", 20, 0, input_port, }, + { "mdma0", 21, 0, input_port, }, + { "mdma1", 22, 0, input_port, }, + { "watchdog", 23, 0, input_port, }, +}; + +static void +bfin_sic_533_port_event (struct hw *me, int my_port, struct hw *source, + int source_port, int level) +{ + struct bfin_sic *sic = hw_data (me); + bu32 bit = (1 << my_port); + + /* SIC only exists to forward interrupts from the system to the CEC. */ + sic->bf537.isr |= bit; + + /* XXX: Handle SIC wakeup source ? + if (sic->bf537.iwr & bit) + What to do ?; + */ + + bfin_sic_537_forward_interrupts (me, sic); +} + static const struct hw_port_descriptor bfin_sic_537_ports[] = { BFIN_SIC_TO_CEC_PORTS { "pll", 0, 0, input_port, }, <at> <at> -534,6 +580,22 <at> <at> sic->bf52x.iar6 = 0x33333000; sic->bf52x.iar7 = 0x00000000; break; + case 531 ... 533: + set_hw_io_read_buffer (me, bfin_sic_537_io_read_buffer); + set_hw_io_write_buffer (me, bfin_sic_537_io_write_buffer); + set_hw_ports (me, bfin_sic_533_ports); + set_hw_port_event (me, bfin_sic_533_port_event); + mmr_names = bf537_mmr_names; + + /* Initialize the SIC. */ + sic->bf537.imask = 0; + sic->bf537.isr = 0; + sic->bf537.iwr = 0xFFFFFFFF; + sic->bf537.iar0 = 0x10000000; + sic->bf537.iar1 = 0x33322221; + sic->bf537.iar2 = 0x66655444; + sic->bf537.iar3 = 0; /* XXX: fix this */ + break; case 534: case 536: case 537:

Modified: trunk/binutils-2.17/sim/bfin/machs.c (4756 => 4757)

--- trunk/binutils-2.17/sim/bfin/machs.c 2010-08-02 01:28:10 UTC (rev 4756) +++ trunk/binutils-2.17/sim/bfin/machs.c 2010-08-02 02:21:08 UTC (rev 4757) <at> <at> -508,7 +508,7 <at> <at> const MODEL *model = CPU_MODEL (cpu); const struct bfin_model_data *mdata = CPU_MODEL_DATA (cpu); int mnum = MODEL_NUM (model); - unsigned i; + unsigned i, num_dmas; int amc_size; /* Map the core devices. */ <at> <at> -557,21 +557,36 <at> <at> /* XXX: Should be pushed to per-model structs. */ sim_hw_parse (sd, "/core/bfin_dmac <at> 0/type %i", mdata->model_num); - for (i = 0; i < 16; ++i) + switch (mdata->model_num) { + case 522 ... 527: + num_dmas = 16; + break; + case 531 ... 533: + num_dmas = 12; + break; + case 534: + case 536: + case 537: + default: + num_dmas = 16; + break; + } + for (i = 0; i < num_dmas; ++i) + { sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i/reg %#x %i", i, 0xFFC00C00 + i * BFIN_MMR_DMA_SIZE, BFIN_MMR_DMA_SIZE); - if (i < 12) + if (i < num_dmas - 4) { /* Could route these into the bfin_dmac and let that forward it to the SIC, but not much value. */ sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i > di dma%i /core/bfin_sic", i, i); } } - sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> 12 > di mdma0 /core/bfin_sic"); - sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> 13 > di mdma0 /core/bfin_sic"); - sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> 14 > di mdma1 /core/bfin_sic"); - sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> 15 > di mdma1 /core/bfin_sic"); + sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i > di mdma0 /core/bfin_sic", num_dmas - 4); + sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i > di mdma0 /core/bfin_sic", num_dmas - 3); + sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i > di mdma1 /core/bfin_sic", num_dmas - 2); + sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i > di mdma1 /core/bfin_sic", num_dmas - 1); for (i = 0; i < mdata->dev_count; ++i) {
<div>

<div>
Revision <a href="http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/?action=browse&amp;path=/&amp;view=rev&amp;root=toolchain&amp;revision=4757">4757</a>
Author <a href="http://blackfin.uclinux.org/gf/user/vapier/">vapier</a>
Date 2010-08-01 22:21:08 -0400 (Sun, 01 Aug 2010)
<h3>Log Message</h3>
sim: bfin: initial BF533 SIC/DMA support (boots u-boot and linux)

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfindvbfin_dmacc">trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c</a></li>
<li><a href="#trunkbinutils217simbfindvbfin_sicc">trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c</a></li>
<li><a href="#trunkbinutils217simbfinmachsc">trunk/binutils-2.17/sim/bfin/machs.c</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c (4756 =&gt; 4757)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c	2010-08-02 01:28:10 UTC (rev 4756)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c	2010-08-02 02:21:08 UTC (rev 4757)
</span><span class="lines"> <at>  <at>  -121,6 +121,31  <at>  <at> 
</span><span class="cx">   { "uart <at> 1_rx",  11, 0, input_port, },
</span><span class="cx"> };
</span><span class="cx"> 
</span>+static const unsigned int bfin_dmac_533_mdma_map[] = {
+  /* MDMA0 */
+  [8] = 9,
+  [9] = 8,
+  /* MDMA1 */
+  [10] = 11,
+  [11] = 10,
+};
+
+static const char *bfin_dmac_533_pmap[] = {
+  "ppi", "sport <at> 0", "sport <at> 0", "sport <at> 1", "sport <at> 1", "spi",
+  "uart <at> 0", "uart <at> 0",
+};
+
+static const struct hw_port_descriptor bfin_dmac_533_ports[] = {
+  { "ppi",         0, 0, input_port, },
+  { "sport <at> 0_tx",  1, 0, input_port, },
+  { "sport <at> 0_rx",  2, 0, input_port, },
+  { "sport <at> 1_tx",  3, 0, input_port, },
+  { "sport <at> 1_rx",  4, 0, input_port, },
+  { "spi",         5, 0, input_port, },
+  { "uart <at> 0_tx",   6, 0, input_port, },
+  { "uart <at> 0_rx",   7, 0, input_port, },
+};
+
<span class="cx"> static const unsigned int bfin_dmac_537_mdma_map[] = {
</span><span class="cx">   /* MDMA0 */
</span><span class="cx">   [12] = 13,
</span><span class="lines"> <at>  <at>  -198,6 +223,13  <at>  <at> 
</span><span class="cx">       dmac-&gt;mdma_count = ARRAY_SIZE (bfin_dmac_52x_mdma_map);
</span><span class="cx">       set_hw_ports (me, bfin_dmac_52x_ports);
</span><span class="cx">       break;
</span>+    case 531 ... 533:
+      dmac-&gt;pmap = bfin_dmac_533_pmap;
+      dmac-&gt;pmap_count = ARRAY_SIZE (bfin_dmac_533_pmap);
+      dmac-&gt;mdma_map = bfin_dmac_533_mdma_map;
+      dmac-&gt;mdma_count = ARRAY_SIZE (bfin_dmac_533_mdma_map);
+      set_hw_ports (me, bfin_dmac_533_ports);
+      break;
<span class="cx">     case 534:
</span><span class="cx">     case 536:
</span><span class="cx">     case 537:
</span></span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c (4756 =&gt; 4757)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c	2010-08-02 01:28:10 UTC (rev 4756)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c	2010-08-02 02:21:08 UTC (rev 4757)
</span><span class="lines"> <at>  <at>  -405,6 +405,52  <at>  <at> 
</span><span class="cx">   bfin_sic_52x_forward_interrupts (me, sic);
</span><span class="cx"> }
</span><span class="cx"> 
</span>+static const struct hw_port_descriptor bfin_sic_533_ports[] = {
+  BFIN_SIC_TO_CEC_PORTS
+  { "pll",            0, 0, input_port, },
+  { "dma_stat",       1, 0, input_port, },
+  { "ppi",            2, 0, input_port, },
+  { "sport <at> 0_stat",   3, 0, input_port, },
+  { "sport <at> 1_stat",   4, 0, input_port, },
+  { "spi",            5, 0, input_port, },
+  { "uart <at> 0_stat",    6, 0, input_port, },
+  { "rtc",            7, 0, input_port, },
+  { "dma0",           8, 0, input_port, },
+  { "dma1",           9, 0, input_port, },
+  { "dma2",          10, 0, input_port, },
+  { "dma3",          11, 0, input_port, },
+  { "dma4",          12, 0, input_port, },
+  { "dma5",          13, 0, input_port, },
+  { "dma6",          14, 0, input_port, },
+  { "dma7",          15, 0, input_port, },
+  { "gptimer <at> 0",     16, 0, input_port, },
+  { "gptimer <at> 1",     17, 0, input_port, },
+  { "gptimer <at> 2",     18, 0, input_port, },
+  { "portf_irq_a",   19, 0, input_port, },
+  { "portf_irq_b",   20, 0, input_port, },
+  { "mdma0",         21, 0, input_port, },
+  { "mdma1",         22, 0, input_port, },
+  { "watchdog",      23, 0, input_port, },
+};
+
+static void
+bfin_sic_533_port_event (struct hw *me, int my_port, struct hw *source,
+			 int source_port, int level)
+{
+  struct bfin_sic *sic = hw_data (me);
+  bu32 bit = (1 &lt;&lt; my_port);
+
+  /* SIC only exists to forward interrupts from the system to the CEC.  */
+  sic-&gt;bf537.isr |= bit;
+
+  /* XXX: Handle SIC wakeup source ?
+  if (sic-&gt;bf537.iwr &amp; bit)
+    What to do ?;
+   */
+
+  bfin_sic_537_forward_interrupts (me, sic);
+}
+
<span class="cx"> static const struct hw_port_descriptor bfin_sic_537_ports[] = {
</span><span class="cx">   BFIN_SIC_TO_CEC_PORTS
</span><span class="cx">   { "pll",            0, 0, input_port, },
</span><span class="lines"> <at>  <at>  -534,6 +580,22  <at>  <at> 
</span><span class="cx">       sic-&gt;bf52x.iar6 = 0x33333000;
</span><span class="cx">       sic-&gt;bf52x.iar7 = 0x00000000;
</span><span class="cx">       break;
</span>+    case 531 ... 533:
+      set_hw_io_read_buffer (me, bfin_sic_537_io_read_buffer);
+      set_hw_io_write_buffer (me, bfin_sic_537_io_write_buffer);
+      set_hw_ports (me, bfin_sic_533_ports);
+      set_hw_port_event (me, bfin_sic_533_port_event);
+      mmr_names = bf537_mmr_names;
+
+      /* Initialize the SIC.  */
+      sic-&gt;bf537.imask = 0;
+      sic-&gt;bf537.isr = 0;
+      sic-&gt;bf537.iwr = 0xFFFFFFFF;
+      sic-&gt;bf537.iar0 = 0x10000000;
+      sic-&gt;bf537.iar1 = 0x33322221;
+      sic-&gt;bf537.iar2 = 0x66655444;
+      sic-&gt;bf537.iar3 = 0; /* XXX: fix this */
+      break;
<span class="cx">     case 534:
</span><span class="cx">     case 536:
</span><span class="cx">     case 537:
</span></span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/machs.c (4756 =&gt; 4757)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/machs.c	2010-08-02 01:28:10 UTC (rev 4756)
+++ trunk/binutils-2.17/sim/bfin/machs.c	2010-08-02 02:21:08 UTC (rev 4757)
</span><span class="lines"> <at>  <at>  -508,7 +508,7  <at>  <at> 
</span><span class="cx">   const MODEL *model = CPU_MODEL (cpu);
</span><span class="cx">   const struct bfin_model_data *mdata = CPU_MODEL_DATA (cpu);
</span><span class="cx">   int mnum = MODEL_NUM (model);
</span>-  unsigned i;
+  unsigned i, num_dmas;
<span class="cx">   int amc_size;
</span><span class="cx"> 
</span><span class="cx">   /* Map the core devices.  */
</span><span class="lines"> <at>  <at>  -557,21 +557,36  <at>  <at> 
</span><span class="cx"> 
</span><span class="cx">   /* XXX: Should be pushed to per-model structs.  */
</span><span class="cx">   sim_hw_parse (sd, "/core/bfin_dmac <at> 0/type %i", mdata-&gt;model_num);
</span>-  for (i = 0; i &lt; 16; ++i)
+  switch (mdata-&gt;model_num)
<span class="cx">     {
</span>+    case 522 ... 527:
+      num_dmas = 16;
+      break;
+    case 531 ... 533:
+      num_dmas = 12;
+      break;
+    case 534:
+    case 536:
+    case 537:
+    default:
+      num_dmas = 16;
+      break;
+    }
+  for (i = 0; i &lt; num_dmas; ++i)
+    {
<span class="cx">       sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i/reg %#x %i", i,
</span><span class="cx"> 		    0xFFC00C00 + i * BFIN_MMR_DMA_SIZE, BFIN_MMR_DMA_SIZE);
</span>-      if (i &lt; 12)
+      if (i &lt; num_dmas - 4)
<span class="cx"> 	{
</span><span class="cx"> 	  /* Could route these into the bfin_dmac and let that
</span><span class="cx"> 	     forward it to the SIC, but not much value.  */
</span><span class="cx"> 	  sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i &gt; di dma%i /core/bfin_sic", i, i);
</span><span class="cx"> 	}
</span><span class="cx">     }
</span>-  sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> 12 &gt; di mdma0 /core/bfin_sic");
-  sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> 13 &gt; di mdma0 /core/bfin_sic");
-  sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> 14 &gt; di mdma1 /core/bfin_sic");
-  sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> 15 &gt; di mdma1 /core/bfin_sic");
+  sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i &gt; di mdma0 /core/bfin_sic", num_dmas - 4);
+  sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i &gt; di mdma0 /core/bfin_sic", num_dmas - 3);
+  sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i &gt; di mdma1 /core/bfin_sic", num_dmas - 2);
+  sim_hw_parse (sd, "/core/bfin_dmac <at> 0/bfin_dma <at> %i &gt; di mdma1 /core/bfin_sic", num_dmas - 1);
<span class="cx"> 
</span><span class="cx">   for (i = 0; i &lt; mdata-&gt;dev_count; ++i)
</span><span class="cx">     {
</span></span>
</div>
</div>

</div>
vapier | 2 Aug 2010 05:04
Favicon

[4758] trunk/binutils-2.17/sim/bfin: sim: bfin: initial BF51x SIC/ DMA support (boots u-boot and linux)

Revision 4758 Author vapier Date 2010-08-01 23:04:11 -0400 (Sun, 01 Aug 2010)

Log Message

sim: bfin: initial BF51x SIC/DMA support (boots u-boot and linux)

Modified Paths

Diff

Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c (4757 => 4758)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c 2010-08-02 02:21:08 UTC (rev 4757) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c 2010-08-02 03:04:11 UTC (rev 4758) <at> <at> -87,6 +87,38 <at> <at> return CTYPE; /* MDMA */ } +static const unsigned int bfin_dmac_51x_mdma_map[] = { + /* MDMA0 */ + [12] = 13, + [13] = 12, + /* MDMA1 */ + [14] = 15, + [15] = 14, +}; + +static const char *bfin_dmac_51x_pmap[] = { + "ppi", "emac", "emac", "sport <at> 0", "sport <at> 0", "sport <at> 1", + "sport <at> 1", "spi <at> 0", "uart <at> 0", "uart <at> 0", "uart <at> 1", "uart <at> 1", +}; + +/* XXX: Need to figure out how to handle portmuxed DMA channels. */ +static const struct hw_port_descriptor bfin_dmac_51x_ports[] = { + { "ppi", 0, 0, input_port, }, + { "emac_rx", 1, 0, input_port, }, + { "emac_tx", 2, 0, input_port, }, + { "sport <at> 0_rx", 3, 0, input_port, }, + { "sport <at> 0_tx", 4, 0, input_port, }, +/*{ "rsi", 4, 0, input_port, },*/ + { "sport <at> 1_tx", 5, 0, input_port, }, +/*{ "spi <at> 1", 5, 0, input_port, },*/ + { "sport <at> 1_rx", 6, 0, input_port, }, + { "spi <at> 0", 7, 0, input_port, }, + { "uart <at> 0_rx", 8, 0, input_port, }, + { "uart <at> 0_tx", 9, 0, input_port, }, + { "uart <at> 1_rx", 10, 0, input_port, }, + { "uart <at> 1_tx", 11, 0, input_port, }, +}; + static const unsigned int bfin_dmac_52x_mdma_map[] = { /* MDMA0 */ [12] = 13, <at> <at> -216,6 +248,13 <at> <at> switch (hw_find_integer_property (me, "type")) { + case 510 ... 519: + dmac->pmap = bfin_dmac_51x_pmap; + dmac->pmap_count = ARRAY_SIZE (bfin_dmac_51x_pmap); + dmac->mdma_map = bfin_dmac_51x_mdma_map; + dmac->mdma_count = ARRAY_SIZE (bfin_dmac_51x_mdma_map); + set_hw_ports (me, bfin_dmac_51x_ports); + break; case 522 ... 527: dmac->pmap = bfin_dmac_52x_pmap; dmac->pmap_count = ARRAY_SIZE (bfin_dmac_52x_pmap);

Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c (4757 => 4758)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c 2010-08-02 02:21:08 UTC (rev 4757) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c 2010-08-02 03:04:11 UTC (rev 4758) <at> <at> -322,6 +322,68 <at> <at> { "ivg14", IVG14, 0, output_port, }, \ { "ivg15", IVG15, 0, output_port, }, +static const struct hw_port_descriptor bfin_sic_51x_ports[] = { + BFIN_SIC_TO_CEC_PORTS + /* SIC0 */ + { "pll", 0, 0, input_port, }, + { "dma_stat", 1, 0, input_port, }, + { "dmar0_block", 2, 0, input_port, }, + { "dmar1_block", 3, 0, input_port, }, + { "dmar0_over", 4, 0, input_port, }, + { "dmar1_over", 5, 0, input_port, }, + { "ppi", 6, 0, input_port, }, + { "emac_stat", 7, 0, input_port, }, + { "sport <at> 0_stat", 8, 0, input_port, }, + { "sport <at> 1_stat", 9, 0, input_port, }, + { "ptp_err", 10, 0, input_port, }, +/*{ "reserved", 11, 0, input_port, },*/ + { "uart <at> 0_stat", 12, 0, input_port, }, + { "uart <at> 1_stat", 13, 0, input_port, }, + { "rtc", 14, 0, input_port, }, + { "dma0", 15, 0, input_port, }, + { "dma3", 16, 0, input_port, }, + { "dma4", 17, 0, input_port, }, + { "dma5", 18, 0, input_port, }, + { "dma6", 19, 0, input_port, }, + { "twi", 20, 0, input_port, }, + { "dma7", 21, 0, input_port, }, + { "dma8", 22, 0, input_port, }, + { "dma9", 23, 0, input_port, }, + { "dma10", 24, 0, input_port, }, + { "dma11", 25, 0, input_port, }, + { "otp", 26, 0, input_port, }, + { "counter", 27, 0, input_port, }, + { "dma1", 28, 0, input_port, }, + { "porth_irq_a", 29, 0, input_port, }, + { "dma2", 30, 0, input_port, }, + { "porth_irq_b", 31, 0, input_port, }, + /* SIC1 */ + { "gptimer <at> 0", 100, 0, input_port, }, + { "gptimer <at> 1", 101, 0, input_port, }, + { "gptimer <at> 2", 102, 0, input_port, }, + { "gptimer <at> 3", 103, 0, input_port, }, + { "gptimer <at> 4", 104, 0, input_port, }, + { "gptimer <at> 5", 105, 0, input_port, }, + { "gptimer <at> 6", 106, 0, input_port, }, + { "gptimer <at> 7", 107, 0, input_port, }, + { "portg_irq_a", 108, 0, input_port, }, + { "portg_irq_b", 109, 0, input_port, }, + { "mdma0", 110, 0, input_port, }, + { "mdma1", 111, 0, input_port, }, + { "watchdog", 112, 0, input_port, }, + { "portf_irq_a", 113, 0, input_port, }, + { "portf_irq_b", 114, 0, input_port, }, + { "spi <at> 0_stat", 115, 0, input_port, }, + { "spi <at> 1_stat", 116, 0, input_port, }, +/*{ "reserved", 117, 0, input_port, },*/ +/*{ "reserved", 118, 0, input_port, },*/ + { "rsi_int0", 119, 0, input_port, }, + { "rsi_int1", 120, 0, input_port, }, + { "pwm_trip", 121, 0, input_port, }, + { "pwm_sync", 122, 0, input_port, }, + { "ptp_stat", 123, 0, input_port, }, +}; + static const struct hw_port_descriptor bfin_sic_52x_ports[] = { BFIN_SIC_TO_CEC_PORTS /* SIC0 */ <at> <at> -335,6 +397,8 <at> <at> { "emac_stat", 7, 0, input_port, }, { "sport <at> 0_stat", 8, 0, input_port, }, { "sport <at> 1_stat", 9, 0, input_port, }, +/*{ "reserved", 10, 0, input_port, },*/ +/*{ "reserved", 11, 0, input_port, },*/ { "uart <at> 0_stat", 12, 0, input_port, }, { "uart <at> 1_stat", 13, 0, input_port, }, { "rtc", 14, 0, input_port, }, <at> <at> -560,6 +624,26 <at> <at> switch (hw_find_integer_property (me, "type")) { + case 510 ... 519: + set_hw_io_read_buffer (me, bfin_sic_52x_io_read_buffer); + set_hw_io_write_buffer (me, bfin_sic_52x_io_write_buffer); + set_hw_ports (me, bfin_sic_51x_ports); + set_hw_port_event (me, bfin_sic_52x_port_event); + mmr_names = bf52x_mmr_names; + + /* Initialize the SIC. */ + sic->bf52x.imask0 = sic->bf52x.imask1 = 0; + sic->bf52x.isr0 = sic->bf52x.isr1 = 0; + sic->bf52x.iwr0 = sic->bf52x.iwr1 = 0xFFFFFFFF; + sic->bf52x.iar0 = 0x00000000; + sic->bf52x.iar1 = 0x11000000; + sic->bf52x.iar2 = 0x33332222; + sic->bf52x.iar3 = 0x44444433; + sic->bf52x.iar4 = 0x55555555; + sic->bf52x.iar5 = 0x06666655; + sic->bf52x.iar6 = 0x33333000; + sic->bf52x.iar7 = 0x00000000; /* XXX: Find and fix */ + break; case 522 ... 527: set_hw_io_read_buffer (me, bfin_sic_52x_io_read_buffer); set_hw_io_write_buffer (me, bfin_sic_52x_io_write_buffer); <at> <at> -578,7 +662,7 <at> <at> sic->bf52x.iar4 = 0x55555555; sic->bf52x.iar5 = 0x06666655; sic->bf52x.iar6 = 0x33333000; - sic->bf52x.iar7 = 0x00000000; + sic->bf52x.iar7 = 0x00000000; /* XXX: Find and fix */ break; case 531 ... 533: set_hw_io_read_buffer (me, bfin_sic_537_io_read_buffer);

Modified: trunk/binutils-2.17/sim/bfin/machs.c (4757 => 4758)

--- trunk/binutils-2.17/sim/bfin/machs.c 2010-08-02 02:21:08 UTC (rev 4757) +++ trunk/binutils-2.17/sim/bfin/machs.c 2010-08-02 03:04:11 UTC (rev 4758) <at> <at> -117,6 +117,8 <at> <at> LAYOUT (0xFFC03400, 0x20, read_write), /* SPI1 stub */ LAYOUT (0xFFC03600, 0x10, read_write), /* OTP stub */ LAYOUT (0xFFC03680, 0x10, read_write), /* OTP Data stub */ + LAYOUT (0xFFC03800, 0xD0, read_write), /* RSI stub */ + LAYOUT (0xFFC03FE0, 0x20, read_write), /* RSI peripheral stub */ LAYOUT (0xFF800000, 0x4000, read_write), /* Data A */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ LAYOUT (0xFF900000, 0x4000, read_write), /* Data B */ <at> <at> -419,6 +421,7 <at> <at> LAYOUT (0xFFC03C00, 0xd00, read_write), /* MUSB stub */ LAYOUT (0xFFC04300, 0x10, read_write), /* OTP stub */ LAYOUT (0xFFC04380, 0x10, read_write), /* OTP Data stub */ + LAYOUT (0xFFC03900, 0x100, read_write), /* RSI stub */ LAYOUT (0xFEB00000, 0x20000, read_write_exec), /* L2 */ LAYOUT (0xFF800000, 0x4000, read_write), /* Data A */ LAYOUT (0xFF804000, 0x4000, read_write), /* Data A Cache */ <at> <at> -559,15 +562,16 <at> <at> sim_hw_parse (sd, "/core/bfin_dmac <at> 0/type %i", mdata->model_num); switch (mdata->model_num) { + case 510 ... 519: case 522 ... 527: + case 534: + case 536: + case 537: num_dmas = 16; break; case 531 ... 533: num_dmas = 12; break; - case 534: - case 536: - case 537: default: num_dmas = 16; break;
<div>

<div>
Revision <a href="http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/?action=browse&amp;path=/&amp;view=rev&amp;root=toolchain&amp;revision=4758">4758</a>
Author <a href="http://blackfin.uclinux.org/gf/user/vapier/">vapier</a>
Date 2010-08-01 23:04:11 -0400 (Sun, 01 Aug 2010)
<h3>Log Message</h3>
sim: bfin: initial BF51x SIC/DMA support (boots u-boot and linux)

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfindvbfin_dmacc">trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c</a></li>
<li><a href="#trunkbinutils217simbfindvbfin_sicc">trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c</a></li>
<li><a href="#trunkbinutils217simbfinmachsc">trunk/binutils-2.17/sim/bfin/machs.c</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c (4757 =&gt; 4758)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c	2010-08-02 02:21:08 UTC (rev 4757)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c	2010-08-02 03:04:11 UTC (rev 4758)
</span><span class="lines"> <at>  <at>  -87,6 +87,38  <at>  <at> 
</span><span class="cx">     return CTYPE;	/* MDMA */
</span><span class="cx"> }
</span><span class="cx"> 
</span>+static const unsigned int bfin_dmac_51x_mdma_map[] = {
+  /* MDMA0 */
+  [12] = 13,
+  [13] = 12,
+  /* MDMA1 */
+  [14] = 15,
+  [15] = 14,
+};
+
+static const char *bfin_dmac_51x_pmap[] = {
+  "ppi", "emac", "emac", "sport <at> 0", "sport <at> 0", "sport <at> 1",
+  "sport <at> 1", "spi <at> 0", "uart <at> 0", "uart <at> 0", "uart <at> 1", "uart <at> 1",
+};
+
+/* XXX: Need to figure out how to handle portmuxed DMA channels.  */
+static const struct hw_port_descriptor bfin_dmac_51x_ports[] = {
+  { "ppi",         0, 0, input_port, },
+  { "emac_rx",     1, 0, input_port, },
+  { "emac_tx",     2, 0, input_port, },
+  { "sport <at> 0_rx",  3, 0, input_port, },
+  { "sport <at> 0_tx",  4, 0, input_port, },
+/*{ "rsi",         4, 0, input_port, },*/
+  { "sport <at> 1_tx",  5, 0, input_port, },
+/*{ "spi <at> 1",       5, 0, input_port, },*/
+  { "sport <at> 1_rx",  6, 0, input_port, },
+  { "spi <at> 0",       7, 0, input_port, },
+  { "uart <at> 0_rx",   8, 0, input_port, },
+  { "uart <at> 0_tx",   9, 0, input_port, },
+  { "uart <at> 1_rx",  10, 0, input_port, },
+  { "uart <at> 1_tx",  11, 0, input_port, },
+};
+
<span class="cx"> static const unsigned int bfin_dmac_52x_mdma_map[] = {
</span><span class="cx">   /* MDMA0 */
</span><span class="cx">   [12] = 13,
</span><span class="lines"> <at>  <at>  -216,6 +248,13  <at>  <at> 
</span><span class="cx"> 
</span><span class="cx">   switch (hw_find_integer_property (me, "type"))
</span><span class="cx">     {
</span>+    case 510 ... 519:
+      dmac-&gt;pmap = bfin_dmac_51x_pmap;
+      dmac-&gt;pmap_count = ARRAY_SIZE (bfin_dmac_51x_pmap);
+      dmac-&gt;mdma_map = bfin_dmac_51x_mdma_map;
+      dmac-&gt;mdma_count = ARRAY_SIZE (bfin_dmac_51x_mdma_map);
+      set_hw_ports (me, bfin_dmac_51x_ports);
+      break;
<span class="cx">     case 522 ... 527:
</span><span class="cx">       dmac-&gt;pmap = bfin_dmac_52x_pmap;
</span><span class="cx">       dmac-&gt;pmap_count = ARRAY_SIZE (bfin_dmac_52x_pmap);
</span></span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c (4757 =&gt; 4758)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c	2010-08-02 02:21:08 UTC (rev 4757)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c	2010-08-02 03:04:11 UTC (rev 4758)
</span><span class="lines"> <at>  <at>  -322,6 +322,68  <at>  <at> 
</span><span class="cx">   { "ivg14", IVG14, 0, output_port, }, \
</span><span class="cx">   { "ivg15", IVG15, 0, output_port, },
</span><span class="cx"> 
</span>+static const struct hw_port_descriptor bfin_sic_51x_ports[] = {
+  BFIN_SIC_TO_CEC_PORTS
+  /* SIC0 */
+  { "pll",            0, 0, input_port, },
+  { "dma_stat",       1, 0, input_port, },
+  { "dmar0_block",    2, 0, input_port, },
+  { "dmar1_block",    3, 0, input_port, },
+  { "dmar0_over",     4, 0, input_port, },
+  { "dmar1_over",     5, 0, input_port, },
+  { "ppi",            6, 0, input_port, },
+  { "emac_stat",      7, 0, input_port, },
+  { "sport <at> 0_stat",   8, 0, input_port, },
+  { "sport <at> 1_stat",   9, 0, input_port, },
+  { "ptp_err",       10, 0, input_port, },
+/*{ "reserved",      11, 0, input_port, },*/
+  { "uart <at> 0_stat",   12, 0, input_port, },
+  { "uart <at> 1_stat",   13, 0, input_port, },
+  { "rtc",           14, 0, input_port, },
+  { "dma0",          15, 0, input_port, },
+  { "dma3",          16, 0, input_port, },
+  { "dma4",          17, 0, input_port, },
+  { "dma5",          18, 0, input_port, },
+  { "dma6",          19, 0, input_port, },
+  { "twi",           20, 0, input_port, },
+  { "dma7",          21, 0, input_port, },
+  { "dma8",          22, 0, input_port, },
+  { "dma9",          23, 0, input_port, },
+  { "dma10",         24, 0, input_port, },
+  { "dma11",         25, 0, input_port, },
+  { "otp",           26, 0, input_port, },
+  { "counter",       27, 0, input_port, },
+  { "dma1",          28, 0, input_port, },
+  { "porth_irq_a",   29, 0, input_port, },
+  { "dma2",          30, 0, input_port, },
+  { "porth_irq_b",   31, 0, input_port, },
+  /* SIC1 */
+  { "gptimer <at> 0",    100, 0, input_port, },
+  { "gptimer <at> 1",    101, 0, input_port, },
+  { "gptimer <at> 2",    102, 0, input_port, },
+  { "gptimer <at> 3",    103, 0, input_port, },
+  { "gptimer <at> 4",    104, 0, input_port, },
+  { "gptimer <at> 5",    105, 0, input_port, },
+  { "gptimer <at> 6",    106, 0, input_port, },
+  { "gptimer <at> 7",    107, 0, input_port, },
+  { "portg_irq_a",  108, 0, input_port, },
+  { "portg_irq_b",  109, 0, input_port, },
+  { "mdma0",        110, 0, input_port, },
+  { "mdma1",        111, 0, input_port, },
+  { "watchdog",     112, 0, input_port, },
+  { "portf_irq_a",  113, 0, input_port, },
+  { "portf_irq_b",  114, 0, input_port, },
+  { "spi <at> 0_stat",   115, 0, input_port, },
+  { "spi <at> 1_stat",   116, 0, input_port, },
+/*{ "reserved",     117, 0, input_port, },*/
+/*{ "reserved",     118, 0, input_port, },*/
+  { "rsi_int0",     119, 0, input_port, },
+  { "rsi_int1",     120, 0, input_port, },
+  { "pwm_trip",     121, 0, input_port, },
+  { "pwm_sync",     122, 0, input_port, },
+  { "ptp_stat",     123, 0, input_port, },
+};
+
<span class="cx"> static const struct hw_port_descriptor bfin_sic_52x_ports[] = {
</span><span class="cx">   BFIN_SIC_TO_CEC_PORTS
</span><span class="cx">   /* SIC0 */
</span><span class="lines"> <at>  <at>  -335,6 +397,8  <at>  <at> 
</span><span class="cx">   { "emac_stat",      7, 0, input_port, },
</span><span class="cx">   { "sport <at> 0_stat",   8, 0, input_port, },
</span><span class="cx">   { "sport <at> 1_stat",   9, 0, input_port, },
</span>+/*{ "reserved",      10, 0, input_port, },*/
+/*{ "reserved",      11, 0, input_port, },*/
<span class="cx">   { "uart <at> 0_stat",   12, 0, input_port, },
</span><span class="cx">   { "uart <at> 1_stat",   13, 0, input_port, },
</span><span class="cx">   { "rtc",           14, 0, input_port, },
</span><span class="lines"> <at>  <at>  -560,6 +624,26  <at>  <at> 
</span><span class="cx"> 
</span><span class="cx">   switch (hw_find_integer_property (me, "type"))
</span><span class="cx">     {
</span>+    case 510 ... 519:
+      set_hw_io_read_buffer (me, bfin_sic_52x_io_read_buffer);
+      set_hw_io_write_buffer (me, bfin_sic_52x_io_write_buffer);
+      set_hw_ports (me, bfin_sic_51x_ports);
+      set_hw_port_event (me, bfin_sic_52x_port_event);
+      mmr_names = bf52x_mmr_names;
+
+      /* Initialize the SIC.  */
+      sic-&gt;bf52x.imask0 = sic-&gt;bf52x.imask1 = 0;
+      sic-&gt;bf52x.isr0 = sic-&gt;bf52x.isr1 = 0;
+      sic-&gt;bf52x.iwr0 = sic-&gt;bf52x.iwr1 = 0xFFFFFFFF;
+      sic-&gt;bf52x.iar0 = 0x00000000;
+      sic-&gt;bf52x.iar1 = 0x11000000;
+      sic-&gt;bf52x.iar2 = 0x33332222;
+      sic-&gt;bf52x.iar3 = 0x44444433;
+      sic-&gt;bf52x.iar4 = 0x55555555;
+      sic-&gt;bf52x.iar5 = 0x06666655;
+      sic-&gt;bf52x.iar6 = 0x33333000;
+      sic-&gt;bf52x.iar7 = 0x00000000;	/* XXX: Find and fix */
+      break;
<span class="cx">     case 522 ... 527:
</span><span class="cx">       set_hw_io_read_buffer (me, bfin_sic_52x_io_read_buffer);
</span><span class="cx">       set_hw_io_write_buffer (me, bfin_sic_52x_io_write_buffer);
</span><span class="lines"> <at>  <at>  -578,7 +662,7  <at>  <at> 
</span><span class="cx">       sic-&gt;bf52x.iar4 = 0x55555555;
</span><span class="cx">       sic-&gt;bf52x.iar5 = 0x06666655;
</span><span class="cx">       sic-&gt;bf52x.iar6 = 0x33333000;
</span>-      sic-&gt;bf52x.iar7 = 0x00000000;
+      sic-&gt;bf52x.iar7 = 0x00000000;	/* XXX: Find and fix */
<span class="cx">       break;
</span><span class="cx">     case 531 ... 533:
</span><span class="cx">       set_hw_io_read_buffer (me, bfin_sic_537_io_read_buffer);
</span></span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/machs.c (4757 =&gt; 4758)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/machs.c	2010-08-02 02:21:08 UTC (rev 4757)
+++ trunk/binutils-2.17/sim/bfin/machs.c	2010-08-02 03:04:11 UTC (rev 4758)
</span><span class="lines"> <at>  <at>  -117,6 +117,8  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC03400, 0x20, read_write),	/* SPI1 stub */
</span><span class="cx">   LAYOUT (0xFFC03600, 0x10, read_write),	/* OTP stub */
</span><span class="cx">   LAYOUT (0xFFC03680, 0x10, read_write),	/* OTP Data stub */
</span>+  LAYOUT (0xFFC03800, 0xD0, read_write),	/* RSI stub */
+  LAYOUT (0xFFC03FE0, 0x20, read_write),	/* RSI peripheral stub */
<span class="cx">   LAYOUT (0xFF800000, 0x4000, read_write),	/* Data A */
</span><span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="cx">   LAYOUT (0xFF900000, 0x4000, read_write),	/* Data B */
</span><span class="lines"> <at>  <at>  -419,6 +421,7  <at>  <at> 
</span><span class="cx">   LAYOUT (0xFFC03C00, 0xd00, read_write),	/* MUSB stub */
</span><span class="cx">   LAYOUT (0xFFC04300, 0x10, read_write),	/* OTP stub */
</span><span class="cx">   LAYOUT (0xFFC04380, 0x10, read_write),	/* OTP Data stub */
</span>+  LAYOUT (0xFFC03900, 0x100, read_write),	/* RSI stub */
<span class="cx">   LAYOUT (0xFEB00000, 0x20000, read_write_exec),	/* L2 */
</span><span class="cx">   LAYOUT (0xFF800000, 0x4000, read_write),	/* Data A */
</span><span class="cx">   LAYOUT (0xFF804000, 0x4000, read_write),	/* Data A Cache */
</span><span class="lines"> <at>  <at>  -559,15 +562,16  <at>  <at> 
</span><span class="cx">   sim_hw_parse (sd, "/core/bfin_dmac <at> 0/type %i", mdata-&gt;model_num);
</span><span class="cx">   switch (mdata-&gt;model_num)
</span><span class="cx">     {
</span>+    case 510 ... 519:
<span class="cx">     case 522 ... 527:
</span>+    case 534:
+    case 536:
+    case 537:
<span class="cx">       num_dmas = 16;
</span><span class="cx">       break;
</span><span class="cx">     case 531 ... 533:
</span><span class="cx">       num_dmas = 12;
</span><span class="cx">       break;
</span>-    case 534:
-    case 536:
-    case 537:
<span class="cx">     default:
</span><span class="cx">       num_dmas = 16;
</span><span class="cx">       break;
</span></span>
</div>
</div>

</div>
vapier | 2 Aug 2010 05:47
Favicon

[4759] trunk/binutils-2.17/sim/bfin: sim: bfin: initial BF538 SIC/ DMA support (boots u-boot and linux)

Revision 4759 Author vapier Date 2010-08-01 23:47:41 -0400 (Sun, 01 Aug 2010)

Log Message

sim: bfin: initial BF538 SIC/DMA support (boots u-boot and linux)

Modified Paths

Diff

Modified: trunk/binutils-2.17/sim/bfin/TODO (4758 => 4759)

--- trunk/binutils-2.17/sim/bfin/TODO 2010-08-02 03:04:11 UTC (rev 4758) +++ trunk/binutils-2.17/sim/bfin/TODO 2010-08-02 03:47:41 UTC (rev 4759) <at> <at> -14,3 +14,5 <at> <at> R0 = [SP++]; gets traced as R0 = [P6++]; merge dv-bfin_evt with dv-bfin_cec since the EVT regs are part of the CEC + +figure out how to handle multiple DMACs for like BF538

Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c (4758 => 4759)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c 2010-08-02 03:04:11 UTC (rev 4758) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c 2010-08-02 03:47:41 UTC (rev 4759) <at> <at> -178,6 +178,53 <at> <at> { "uart <at> 0_rx", 7, 0, input_port, }, }; +static const unsigned int bfin_dmac0_538_mdma_map[] = { + /* MDMA0 */ + [20] = 21, + [21] = 20, + /* MDMA1 */ + [22] = 23, + [23] = 22, +}; + +static const char *bfin_dmac0_538_pmap[] = { + "ppi", "sport <at> 0", "sport <at> 0", "sport <at> 1", "sport <at> 1", "spi <at> 0", + "uart <at> 0", "uart <at> 0", +}; + +static const struct hw_port_descriptor bfin_dmac0_538_ports[] = { + { "ppi", 0, 0, input_port, }, + { "sport <at> 0_rx", 1, 0, input_port, }, + { "sport <at> 0_tx", 2, 0, input_port, }, + { "sport <at> 1_rx", 3, 0, input_port, }, + { "sport <at> 1_tx", 4, 0, input_port, }, + { "spi <at> 0", 5, 0, input_port, }, + { "uart <at> 0_rx", 6, 0, input_port, }, + { "uart <at> 0_tx", 7, 0, input_port, }, +}; + +/* XXX: this is unhandled ... */ +static const unsigned int bfin_dmac1_538_mdma_map[] = { +}; + +static const char *bfin_dmac1_538_pmap[] = { + "sport <at> 2", "sport <at> 2", "sport <at> 3", "sport <at> 3", NULL, NULL, + "spi <at> 1", "spi <at> 2", "uart <at> 1", "uart <at> 1", "uart <at> 2", "uart <at> 2", +}; + +static const struct hw_port_descriptor bfin_dmac1_538_ports[] = { + { "sport <at> 2_rx", 0, 0, input_port, }, + { "sport <at> 2_tx", 1, 0, input_port, }, + { "sport <at> 3_rx", 2, 0, input_port, }, + { "sport <at> 3_tx", 3, 0, input_port, }, + { "spi <at> 1", 6, 0, input_port, }, + { "spi <at> 2", 7, 0, input_port, }, + { "uart <at> 0_rx", 8, 0, input_port, }, + { "uart <at> 0_tx", 9, 0, input_port, }, + { "uart <at> 1_rx", 10, 0, input_port, }, + { "uart <at> 1_tx", 11, 0, input_port, }, +}; + static const unsigned int bfin_dmac_537_mdma_map[] = { /* MDMA0 */ [12] = 13, <at> <at> -278,6 +325,13 <at> <at> dmac->mdma_count = ARRAY_SIZE (bfin_dmac_537_mdma_map); set_hw_ports (me, bfin_dmac_537_ports); break; + case 538 ... 539: + dmac->pmap = bfin_dmac0_538_pmap; + dmac->pmap_count = ARRAY_SIZE (bfin_dmac0_538_pmap); + dmac->mdma_map = bfin_dmac0_538_mdma_map; + dmac->mdma_count = ARRAY_SIZE (bfin_dmac0_538_mdma_map); + set_hw_ports (me, bfin_dmac0_538_ports); + break; default: hw_abort (me, "no support for DMAC on this Blackfin model yet"); }

Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c (4758 => 4759)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c 2010-08-02 03:04:11 UTC (rev 4758) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c 2010-08-02 03:47:41 UTC (rev 4759) <at> <at> -566,6 +566,63 <at> <at> { "portf_irq_b", 311, 0, input_port, }, }; +static const struct hw_port_descriptor bfin_sic_538_ports[] = { + BFIN_SIC_TO_CEC_PORTS + /* SIC0 */ + { "pll", 0, 0, input_port, }, + { "dmac <at> 0_stat", 1, 0, input_port, }, + { "ppi", 2, 0, input_port, }, + { "sport <at> 0_stat", 3, 0, input_port, }, + { "sport <at> 1_stat", 4, 0, input_port, }, + { "spi <at> 0_stat", 5, 0, input_port, }, + { "uart <at> 0_stat", 6, 0, input_port, }, + { "rtc", 7, 0, input_port, }, + { "dma0", 8, 0, input_port, }, + { "dma1", 9, 0, input_port, }, + { "dma2", 10, 0, input_port, }, + { "dma3", 11, 0, input_port, }, + { "dma4", 12, 0, input_port, }, + { "dma5", 13, 0, input_port, }, + { "dma6", 14, 0, input_port, }, + { "dma7", 15, 0, input_port, }, + { "gptimer <at> 0", 16, 0, input_port, }, + { "gptimer <at> 1", 17, 0, input_port, }, + { "gptimer <at> 2", 18, 0, input_port, }, + { "portf_irq_a", 19, 0, input_port, }, + { "portf_irq_b", 20, 0, input_port, }, + { "mdma0", 21, 0, input_port, }, + { "mdma1", 22, 0, input_port, }, + { "watchdog", 23, 0, input_port, }, + { "dmac <at> 1_stat", 24, 0, input_port, }, + { "sport <at> 2_stat", 25, 0, input_port, }, + { "sport <at> 3_stat", 26, 0, input_port, }, +/*{ "reserved", 27, 0, input_port, },*/ + { "spi <at> 1_stat", 28, 0, input_port, }, + { "spi <at> 2_stat", 29, 0, input_port, }, + { "uart <at> 1_stat", 30, 0, input_port, }, + { "uart <at> 2_stat", 31, 0, input_port, }, + /* SIC1 */ + { "can_stat", 100, 0, input_port, }, + { "dma8", 101, 0, input_port, }, + { "dma9", 102, 0, input_port, }, + { "dma10", 103, 0, input_port, }, + { "dma11", 104, 0, input_port, }, + { "dma12", 105, 0, input_port, }, + { "dma13", 106, 0, input_port, }, + { "dma14", 107, 0, input_port, }, + { "dma15", 108, 0, input_port, }, + { "dma16", 109, 0, input_port, }, + { "dma17", 110, 0, input_port, }, + { "dma18", 111, 0, input_port, }, + { "dma19", 112, 0, input_port, }, + { "twi <at> 0_stat", 113, 0, input_port, }, + { "twi <at> 1_stat", 114, 0, input_port, }, + { "can_rx", 115, 0, input_port, }, + { "can_tx", 116, 0, input_port, }, + { "mdma1_0", 117, 0, input_port, }, + { "mdma1_1", 118, 0, input_port, }, +}; + static void bfin_sic_537_port_event (struct hw *me, int my_port, struct hw *source, int source_port, int level) <at> <at> -698,6 +755,26 <at> <at> sic->bf537.iar2 = 0x55555444; sic->bf537.iar3 = 0x66655555; break; + case 538 ... 539: + set_hw_io_read_buffer (me, bfin_sic_52x_io_read_buffer); + set_hw_io_write_buffer (me, bfin_sic_52x_io_write_buffer); + set_hw_ports (me, bfin_sic_538_ports); + set_hw_port_event (me, bfin_sic_52x_port_event); + mmr_names = bf52x_mmr_names; + + /* Initialize the SIC. */ + sic->bf52x.imask0 = sic->bf52x.imask1 = 0; + sic->bf52x.isr0 = sic->bf52x.isr1 = 0; + sic->bf52x.iwr0 = sic->bf52x.iwr1 = 0xFFFFFFFF; + sic->bf52x.iar0 = 0x10000000; + sic->bf52x.iar1 = 0x33322221; + sic->bf52x.iar2 = 0x66655444; + sic->bf52x.iar3 = 0x00000000; + sic->bf52x.iar4 = 0x32222220; + sic->bf52x.iar5 = 0x44433333; + sic->bf52x.iar6 = 0x00444664; + sic->bf52x.iar7 = 0x00000000; /* XXX: Find and fix */ + break; default: hw_abort (me, "no support for SIC on this Blackfin model yet"); }

Modified: trunk/binutils-2.17/sim/bfin/machs.c (4758 => 4759)

--- trunk/binutils-2.17/sim/bfin/machs.c 2010-08-02 03:04:11 UTC (rev 4758) +++ trunk/binutils-2.17/sim/bfin/machs.c 2010-08-02 03:47:41 UTC (rev 4759) <at> <at> -391,14 +391,11 <at> <at> DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"), DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"), DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"), - DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"), - DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"), - DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"), - DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"), - DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"), DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE, "bfin_ppi"), +/* XXX: DMAC1 not supported yet. DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE, "bfin_uart <at> 1"), DEVICE (0xFFC02100, BFIN_MMR_UART_SIZE, "bfin_uart <at> 2"), + */ }; #define bf539_dev bf538_dev <at> <at> -572,6 +569,10 <at> <at> case 531 ... 533: num_dmas = 12; break; + case 538 ... 539: + /* XXX: This is just DMAC0. */ + num_dmas = 12; + break; default: num_dmas = 16; break;
<div>

<div>
Revision <a href="http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/?action=browse&amp;path=/&amp;view=rev&amp;root=toolchain&amp;revision=4759">4759</a>
Author <a href="http://blackfin.uclinux.org/gf/user/vapier/">vapier</a>
Date 2010-08-01 23:47:41 -0400 (Sun, 01 Aug 2010)
<h3>Log Message</h3>
sim: bfin: initial BF538 SIC/DMA support (boots u-boot and linux)

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfinTODO">trunk/binutils-2.17/sim/bfin/TODO</a></li>
<li><a href="#trunkbinutils217simbfindvbfin_dmacc">trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c</a></li>
<li><a href="#trunkbinutils217simbfindvbfin_sicc">trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c</a></li>
<li><a href="#trunkbinutils217simbfinmachsc">trunk/binutils-2.17/sim/bfin/machs.c</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/TODO (4758 =&gt; 4759)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/TODO	2010-08-02 03:04:11 UTC (rev 4758)
+++ trunk/binutils-2.17/sim/bfin/TODO	2010-08-02 03:47:41 UTC (rev 4759)
</span><span class="lines"> <at>  <at>  -14,3 +14,5  <at>  <at> 
</span><span class="cx"> R0 = [SP++]; gets traced as R0 = [P6++];
</span><span class="cx"> 
</span><span class="cx"> merge dv-bfin_evt with dv-bfin_cec since the EVT regs are part of the CEC
</span>+
+figure out how to handle multiple DMACs for like BF538
</span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c (4758 =&gt; 4759)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c	2010-08-02 03:04:11 UTC (rev 4758)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_dmac.c	2010-08-02 03:47:41 UTC (rev 4759)
</span><span class="lines"> <at>  <at>  -178,6 +178,53  <at>  <at> 
</span><span class="cx">   { "uart <at> 0_rx",   7, 0, input_port, },
</span><span class="cx"> };
</span><span class="cx"> 
</span>+static const unsigned int bfin_dmac0_538_mdma_map[] = {
+  /* MDMA0 */
+  [20] = 21,
+  [21] = 20,
+  /* MDMA1 */
+  [22] = 23,
+  [23] = 22,
+};
+
+static const char *bfin_dmac0_538_pmap[] = {
+  "ppi", "sport <at> 0", "sport <at> 0", "sport <at> 1", "sport <at> 1", "spi <at> 0",
+  "uart <at> 0", "uart <at> 0",
+};
+
+static const struct hw_port_descriptor bfin_dmac0_538_ports[] = {
+  { "ppi",         0, 0, input_port, },
+  { "sport <at> 0_rx",  1, 0, input_port, },
+  { "sport <at> 0_tx",  2, 0, input_port, },
+  { "sport <at> 1_rx",  3, 0, input_port, },
+  { "sport <at> 1_tx",  4, 0, input_port, },
+  { "spi <at> 0",       5, 0, input_port, },
+  { "uart <at> 0_rx",   6, 0, input_port, },
+  { "uart <at> 0_tx",   7, 0, input_port, },
+};
+
+/* XXX: this is unhandled ... */
+static const unsigned int bfin_dmac1_538_mdma_map[] = {
+};
+
+static const char *bfin_dmac1_538_pmap[] = {
+  "sport <at> 2", "sport <at> 2", "sport <at> 3", "sport <at> 3", NULL, NULL,
+  "spi <at> 1", "spi <at> 2", "uart <at> 1", "uart <at> 1", "uart <at> 2", "uart <at> 2",
+};
+
+static const struct hw_port_descriptor bfin_dmac1_538_ports[] = {
+  { "sport <at> 2_rx",  0, 0, input_port, },
+  { "sport <at> 2_tx",  1, 0, input_port, },
+  { "sport <at> 3_rx",  2, 0, input_port, },
+  { "sport <at> 3_tx",  3, 0, input_port, },
+  { "spi <at> 1",       6, 0, input_port, },
+  { "spi <at> 2",       7, 0, input_port, },
+  { "uart <at> 0_rx",   8, 0, input_port, },
+  { "uart <at> 0_tx",   9, 0, input_port, },
+  { "uart <at> 1_rx",  10, 0, input_port, },
+  { "uart <at> 1_tx",  11, 0, input_port, },
+};
+
<span class="cx"> static const unsigned int bfin_dmac_537_mdma_map[] = {
</span><span class="cx">   /* MDMA0 */
</span><span class="cx">   [12] = 13,
</span><span class="lines"> <at>  <at>  -278,6 +325,13  <at>  <at> 
</span><span class="cx">       dmac-&gt;mdma_count = ARRAY_SIZE (bfin_dmac_537_mdma_map);
</span><span class="cx">       set_hw_ports (me, bfin_dmac_537_ports);
</span><span class="cx">       break;
</span>+    case 538 ... 539:
+      dmac-&gt;pmap = bfin_dmac0_538_pmap;
+      dmac-&gt;pmap_count = ARRAY_SIZE (bfin_dmac0_538_pmap);
+      dmac-&gt;mdma_map = bfin_dmac0_538_mdma_map;
+      dmac-&gt;mdma_count = ARRAY_SIZE (bfin_dmac0_538_mdma_map);
+      set_hw_ports (me, bfin_dmac0_538_ports);
+      break;
<span class="cx">     default:
</span><span class="cx">       hw_abort (me, "no support for DMAC on this Blackfin model yet");
</span><span class="cx">     }
</span></span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c (4758 =&gt; 4759)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c	2010-08-02 03:04:11 UTC (rev 4758)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_sic.c	2010-08-02 03:47:41 UTC (rev 4759)
</span><span class="lines"> <at>  <at>  -566,6 +566,63  <at>  <at> 
</span><span class="cx">   { "portf_irq_b",  311, 0, input_port, },
</span><span class="cx"> };
</span><span class="cx"> 
</span>+static const struct hw_port_descriptor bfin_sic_538_ports[] = {
+  BFIN_SIC_TO_CEC_PORTS
+  /* SIC0 */
+  { "pll",            0, 0, input_port, },
+  { "dmac <at> 0_stat",    1, 0, input_port, },
+  { "ppi",            2, 0, input_port, },
+  { "sport <at> 0_stat",   3, 0, input_port, },
+  { "sport <at> 1_stat",   4, 0, input_port, },
+  { "spi <at> 0_stat",     5, 0, input_port, },
+  { "uart <at> 0_stat",    6, 0, input_port, },
+  { "rtc",            7, 0, input_port, },
+  { "dma0",           8, 0, input_port, },
+  { "dma1",           9, 0, input_port, },
+  { "dma2",          10, 0, input_port, },
+  { "dma3",          11, 0, input_port, },
+  { "dma4",          12, 0, input_port, },
+  { "dma5",          13, 0, input_port, },
+  { "dma6",          14, 0, input_port, },
+  { "dma7",          15, 0, input_port, },
+  { "gptimer <at> 0",     16, 0, input_port, },
+  { "gptimer <at> 1",     17, 0, input_port, },
+  { "gptimer <at> 2",     18, 0, input_port, },
+  { "portf_irq_a",   19, 0, input_port, },
+  { "portf_irq_b",   20, 0, input_port, },
+  { "mdma0",         21, 0, input_port, },
+  { "mdma1",         22, 0, input_port, },
+  { "watchdog",      23, 0, input_port, },
+  { "dmac <at> 1_stat",   24, 0, input_port, },
+  { "sport <at> 2_stat",  25, 0, input_port, },
+  { "sport <at> 3_stat",  26, 0, input_port, },
+/*{ "reserved",      27, 0, input_port, },*/
+  { "spi <at> 1_stat",    28, 0, input_port, },
+  { "spi <at> 2_stat",    29, 0, input_port, },
+  { "uart <at> 1_stat",   30, 0, input_port, },
+  { "uart <at> 2_stat",   31, 0, input_port, },
+  /* SIC1 */
+  { "can_stat",     100, 0, input_port, },
+  { "dma8",         101, 0, input_port, },
+  { "dma9",         102, 0, input_port, },
+  { "dma10",        103, 0, input_port, },
+  { "dma11",        104, 0, input_port, },
+  { "dma12",        105, 0, input_port, },
+  { "dma13",        106, 0, input_port, },
+  { "dma14",        107, 0, input_port, },
+  { "dma15",        108, 0, input_port, },
+  { "dma16",        109, 0, input_port, },
+  { "dma17",        110, 0, input_port, },
+  { "dma18",        111, 0, input_port, },
+  { "dma19",        112, 0, input_port, },
+  { "twi <at> 0_stat",   113, 0, input_port, },
+  { "twi <at> 1_stat",   114, 0, input_port, },
+  { "can_rx",       115, 0, input_port, },
+  { "can_tx",       116, 0, input_port, },
+  { "mdma1_0",      117, 0, input_port, },
+  { "mdma1_1",      118, 0, input_port, },
+};
+
<span class="cx"> static void
</span><span class="cx"> bfin_sic_537_port_event (struct hw *me, int my_port, struct hw *source,
</span><span class="cx"> 			 int source_port, int level)
</span><span class="lines"> <at>  <at>  -698,6 +755,26  <at>  <at> 
</span><span class="cx">       sic-&gt;bf537.iar2 = 0x55555444;
</span><span class="cx">       sic-&gt;bf537.iar3 = 0x66655555;
</span><span class="cx">       break;
</span>+    case 538 ... 539:
+      set_hw_io_read_buffer (me, bfin_sic_52x_io_read_buffer);
+      set_hw_io_write_buffer (me, bfin_sic_52x_io_write_buffer);
+      set_hw_ports (me, bfin_sic_538_ports);
+      set_hw_port_event (me, bfin_sic_52x_port_event);
+      mmr_names = bf52x_mmr_names;
+
+      /* Initialize the SIC.  */
+      sic-&gt;bf52x.imask0 = sic-&gt;bf52x.imask1 = 0;
+      sic-&gt;bf52x.isr0 = sic-&gt;bf52x.isr1 = 0;
+      sic-&gt;bf52x.iwr0 = sic-&gt;bf52x.iwr1 = 0xFFFFFFFF;
+      sic-&gt;bf52x.iar0 = 0x10000000;
+      sic-&gt;bf52x.iar1 = 0x33322221;
+      sic-&gt;bf52x.iar2 = 0x66655444;
+      sic-&gt;bf52x.iar3 = 0x00000000;
+      sic-&gt;bf52x.iar4 = 0x32222220;
+      sic-&gt;bf52x.iar5 = 0x44433333;
+      sic-&gt;bf52x.iar6 = 0x00444664;
+      sic-&gt;bf52x.iar7 = 0x00000000;	/* XXX: Find and fix */
+      break;
<span class="cx">     default:
</span><span class="cx">       hw_abort (me, "no support for SIC on this Blackfin model yet");
</span><span class="cx">     }
</span></span>
</div>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/machs.c (4758 =&gt; 4759)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/machs.c	2010-08-02 03:04:11 UTC (rev 4758)
+++ trunk/binutils-2.17/sim/bfin/machs.c	2010-08-02 03:47:41 UTC (rev 4759)
</span><span class="lines"> <at>  <at>  -391,14 +391,11  <at>  <at> 
</span><span class="cx">   DEVICE (0xFFC00600, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 0"),
</span><span class="cx">   DEVICE (0xFFC00610, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 1"),
</span><span class="cx">   DEVICE (0xFFC00620, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 2"),
</span>-  DEVICE (0xFFC00630, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 3"),
-  DEVICE (0xFFC00640, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 4"),
-  DEVICE (0xFFC00650, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 5"),
-  DEVICE (0xFFC00660, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 6"),
-  DEVICE (0xFFC00670, BFIN_MMR_GPTIMER_SIZE, "bfin_gptimer <at> 7"),
<span class="cx">   DEVICE (0xFFC01000, BFIN_MMR_PPI_SIZE,     "bfin_ppi"),
</span>+/* XXX: DMAC1 not supported yet.
<span class="cx">   DEVICE (0xFFC02000, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 1"),
</span><span class="cx">   DEVICE (0xFFC02100, BFIN_MMR_UART_SIZE,    "bfin_uart <at> 2"),
</span>+ */
<span class="cx"> };
</span><span class="cx"> #define bf539_dev bf538_dev
</span><span class="cx"> 
</span><span class="lines"> <at>  <at>  -572,6 +569,10  <at>  <at> 
</span><span class="cx">     case 531 ... 533:
</span><span class="cx">       num_dmas = 12;
</span><span class="cx">       break;
</span>+    case 538 ... 539:
+      /* XXX: This is just DMAC0.  */
+      num_dmas = 12;
+      break;
<span class="cx">     default:
</span><span class="cx">       num_dmas = 16;
</span><span class="cx">       break;
</span></span>
</div>
</div>

</div>
vapier | 2 Aug 2010 05:50
Favicon

[4760] trunk/binutils-2.17/sim/bfin/dv-bfin_emac.c: sim: bfin: add EMAC_PTP MMR stubs

Revision 4760 Author vapier Date 2010-08-01 23:50:12 -0400 (Sun, 01 Aug 2010)

Log Message

sim: bfin: add EMAC_PTP MMR stubs

Modified Paths

Diff

Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_emac.c (4759 => 4760)

--- trunk/binutils-2.17/sim/bfin/dv-bfin_emac.c 2010-08-02 03:47:41 UTC (rev 4759) +++ trunk/binutils-2.17/sim/bfin/dv-bfin_emac.c 2010-08-02 03:50:12 UTC (rev 4760) <at> <at> -68,12 +68,20 <at> <at> bu32 _pad1[4]; bu32 sysctl, systat, rx_stat, rx_stky, rx_irqe, tx_stat, tx_stky, tx_irqe; bu32 mmc_ctl, mmc_rirqs, mmc_rirqe, mmc_tirqs, mmc_tirqe; - bu32 _pad2[27]; + bu32 _pad2[3]; + bu16 BFIN_MMR_16(ptp_ctl); + bu16 BFIN_MMR_16(ptp_ie); + bu16 BFIN_MMR_16(ptp_istat); + bu32 ptp_foff, ptp_fv1, ptp_fv2, ptp_fv3, ptp_addend, ptp_accr, ptp_offset; + bu32 ptp_timelo, ptp_timehi, ptp_rxsnaplo, ptp_rxsnaphi, ptp_txsnaplo; + bu32 ptp_txsnaphi, ptp_alarmlo, ptp_alarmhi, ptp_id_off, ptp_id_snap; + bu32 ptp_pps_startlo, ptp_pps_starthi, ptp_pps_period; + bu32 _pad3[1]; bu32 rxc_ok, rxc_fcs, rxc_lign, rxc_octet, rxc_dmaovf, rxc_unicst, rxc_multi; bu32 rxc_broad, rxc_lnerri, rxc_lnerro, rxc_long, rxc_macctl, rxc_opcode; bu32 rxc_pause, rxc_allfrm, rxc_alloct, rxc_typed, rxc_short, rxc_eq64; bu32 rxc_lt128, rxc_lt256, rxc_lt512, rxc_lt1024, rxc_ge1024; - bu32 _pad3[8]; + bu32 _pad4[8]; bu32 txc_ok, txc_1col, txc_gt1col, txc_octet, txc_defer, txc_latecl; bu32 txc_xs_col, txc_dmaund, txc_crserr, txc_unicst, txc_multi, txc_broad; bu32 txc_xs_dfr, txc_macctl, txc_allfrm, txc_alloct, txc_eq64, txc_lt128; <at> <at> -92,6 +100,13 <at> <at> "EMAC_RX_STAT", "EMAC_RX_STKY", "EMAC_RX_IRQE", "EMAC_TX_STAT", "EMAC_TX_STKY", "EMAC_TX_IRQE", "EMAC_MMC_CTL", "EMAC_MMC_RIRQS", "EMAC_MMC_RIRQE", "EMAC_MMC_TIRQS", "EMAC_MMC_TIRQE", + [mmr_idx (ptp_ctl)] = "EMAC_PTP_CTL", "EMAC_PTP_IE", "EMAC_PTP_ISTAT", + "EMAC_PTP_FOFF", "EMAC_PTP_FV1", "EMAC_PTP_FV2", "EMAC_PTP_FV3", + "EMAC_PTP_ADDEND", "EMAC_PTP_ACCR", "EMAC_PTP_OFFSET", "EMAC_PTP_TIMELO", + "EMAC_PTP_TIMEHI", "EMAC_PTP_RXSNAPLO", "EMAC_PTP_RXSNAPHI", + "EMAC_PTP_TXSNAPLO", "EMAC_PTP_TXSNAPHI", "EMAC_PTP_ALARMLO", + "EMAC_PTP_ALARMHI", "EMAC_PTP_ID_OFF", "EMAC_PTP_ID_SNAP", + "EMAC_PTP_PPS_STARTLO", "EMAC_PTP_PPS_STARTHI", "EMAC_PTP_PPS_PERIOD", [mmr_idx (rxc_ok)] = "EMAC_RXC_OK", "EMAC_RXC_FCS", "EMAC_RXC_LIGN", "EMAC_RXC_OCTET", "EMAC_RXC_DMAOVF", "EMAC_RXC_UNICST", "EMAC_RXC_MULTI", "EMAC_RXC_BROAD", "EMAC_RXC_LNERRI", "EMAC_RXC_LNERRO", "EMAC_RXC_LONG", <at> <at> -241,6 +256,9 <at> <at> /* XXX: Are these supposed to be read-only ? */ *valuep = value; break; + case mmr_offset(ptp_ctl) ... mmr_offset(ptp_pps_period): + /* XXX: Only on some models; ignore for now. */ + break; default: dv_bfin_mmr_invalid (me, addr, nr_bytes, true); break; <at> <at> -303,6 +321,9 <at> <at> case mmr_offset(txc_ok) ... mmr_offset(txc_abort): dv_store_4 (dest, *valuep); break; + case mmr_offset(ptp_ctl) ... mmr_offset(ptp_pps_period): + /* XXX: Only on some models; ignore for now. */ + break; default: dv_bfin_mmr_invalid (me, addr, nr_bytes, false); break;
<div>

<div>
Revision <a href="http://blackfin.uclinux.org/gf/project/toolchain/scmsvn/?action=browse&amp;path=/&amp;view=rev&amp;root=toolchain&amp;revision=4760">4760</a>
Author <a href="http://blackfin.uclinux.org/gf/user/vapier/">vapier</a>
Date 2010-08-01 23:50:12 -0400 (Sun, 01 Aug 2010)
<h3>Log Message</h3>
sim: bfin: add EMAC_PTP MMR stubs

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbinutils217simbfindvbfin_emacc">trunk/binutils-2.17/sim/bfin/dv-bfin_emac.c</a></li>
</ul>
</div>
<div>
<h3>Diff</h3>
<a></a>
<div class="modfile">
<h4>Modified: trunk/binutils-2.17/sim/bfin/dv-bfin_emac.c (4759 =&gt; 4760)</h4>
<span>
<span class="info">--- trunk/binutils-2.17/sim/bfin/dv-bfin_emac.c	2010-08-02 03:47:41 UTC (rev 4759)
+++ trunk/binutils-2.17/sim/bfin/dv-bfin_emac.c	2010-08-02 03:50:12 UTC (rev 4760)
</span><span class="lines"> <at>  <at>  -68,12 +68,20  <at>  <at> 
</span><span class="cx">   bu32 _pad1[4];
</span><span class="cx">   bu32 sysctl, systat, rx_stat, rx_stky, rx_irqe, tx_stat, tx_stky, tx_irqe;
</span><span class="cx">   bu32 mmc_ctl, mmc_rirqs, mmc_rirqe, mmc_tirqs, mmc_tirqe;
</span>-  bu32 _pad2[27];
+  bu32 _pad2[3];
+  bu16 BFIN_MMR_16(ptp_ctl);
+  bu16 BFIN_MMR_16(ptp_ie);
+  bu16 BFIN_MMR_16(ptp_istat);
+  bu32 ptp_foff, ptp_fv1, ptp_fv2, ptp_fv3, ptp_addend, ptp_accr, ptp_offset;
+  bu32 ptp_timelo, ptp_timehi, ptp_rxsnaplo, ptp_rxsnaphi, ptp_txsnaplo;
+  bu32 ptp_txsnaphi, ptp_alarmlo, ptp_alarmhi, ptp_id_off, ptp_id_snap;
+  bu32 ptp_pps_startlo, ptp_pps_starthi, ptp_pps_period;
+  bu32 _pad3[1];
<span class="cx">   bu32 rxc_ok, rxc_fcs, rxc_lign, rxc_octet, rxc_dmaovf, rxc_unicst, rxc_multi;
</span><span class="cx">   bu32 rxc_broad, rxc_lnerri, rxc_lnerro, rxc_long, rxc_macctl, rxc_opcode;
</span><span class="cx">   bu32 rxc_pause, rxc_allfrm, rxc_alloct, rxc_typed, rxc_short, rxc_eq64;
</span><span class="cx">   bu32 rxc_lt128, rxc_lt256, rxc_lt512, rxc_lt1024, rxc_ge1024;
</span>-  bu32 _pad3[8];
+  bu32 _pad4[8];
<span class="cx">   bu32 txc_ok, txc_1col, txc_gt1col, txc_octet, txc_defer, txc_latecl;
</span><span class="cx">   bu32 txc_xs_col, txc_dmaund, txc_crserr, txc_unicst, txc_multi, txc_broad;
</span><span class="cx">   bu32 txc_xs_dfr, txc_macctl, txc_allfrm, txc_alloct, txc_eq64, txc_lt128;
</span><span class="lines"> <at>  <at>  -92,6 +100,13  <at>  <at> 
</span><span class="cx">   "EMAC_RX_STAT", "EMAC_RX_STKY", "EMAC_RX_IRQE", "EMAC_TX_STAT",
</span><span class="cx">   "EMAC_TX_STKY", "EMAC_TX_IRQE", "EMAC_MMC_CTL", "EMAC_MMC_RIRQS",
</span><span class="cx">   "EMAC_MMC_RIRQE", "EMAC_MMC_TIRQS", "EMAC_MMC_TIRQE",
</span>+  [mmr_idx (ptp_ctl)] = "EMAC_PTP_CTL", "EMAC_PTP_IE", "EMAC_PTP_ISTAT",
+  "EMAC_PTP_FOFF", "EMAC_PTP_FV1", "EMAC_PTP_FV2", "EMAC_PTP_FV3",
+  "EMAC_PTP_ADDEND", "EMAC_PTP_ACCR", "EMAC_PTP_OFFSET", "EMAC_PTP_TIMELO",
+  "EMAC_PTP_TIMEHI", "EMAC_PTP_RXSNAPLO", "EMAC_PTP_RXSNAPHI",
+  "EMAC_PTP_TXSNAPLO", "EMAC_PTP_TXSNAPHI", "EMAC_PTP_ALARMLO",
+  "EMAC_PTP_ALARMHI", "EMAC_PTP_ID_OFF", "EMAC_PTP_ID_SNAP",
+  "EMAC_PTP_PPS_STARTLO", "EMAC_PTP_PPS_STARTHI", "EMAC_PTP_PPS_PERIOD",
<span class="cx">   [mmr_idx (rxc_ok)] = "EMAC_RXC_OK", "EMAC_RXC_FCS", "EMAC_RXC_LIGN",
</span><span class="cx">   "EMAC_RXC_OCTET", "EMAC_RXC_DMAOVF", "EMAC_RXC_UNICST", "EMAC_RXC_MULTI",
</span><span class="cx">   "EMAC_RXC_BROAD", "EMAC_RXC_LNERRI", "EMAC_RXC_LNERRO", "EMAC_RXC_LONG",
</span><span class="lines"> <at>  <at>  -241,6 +256,9  <at>  <at> 
</span><span class="cx">       /* XXX: Are these supposed to be read-only ?  */
</span><span class="cx">       *valuep = value;
</span><span class="cx">       break;
</span>+    case mmr_offset(ptp_ctl) ... mmr_offset(ptp_pps_period):
+      /* XXX: Only on some models; ignore for now.  */
+      break;
<span class="cx">     default:
</span><span class="cx">       dv_bfin_mmr_invalid (me, addr, nr_bytes, true);
</span><span class="cx">       break;
</span><span class="lines"> <at>  <at>  -303,6 +321,9  <at>  <at> 
</span><span class="cx">     case mmr_offset(txc_ok) ... mmr_offset(txc_abort):
</span><span class="cx">       dv_store_4 (dest, *valuep);
</span><span class="cx">       break;
</span>+    case mmr_offset(ptp_ctl) ... mmr_offset(ptp_pps_period):
+      /* XXX: Only on some models; ignore for now.  */
+      break;
<span class="cx">     default:
</span><span class="cx">       dv_bfin_mmr_invalid (me, addr, nr_bytes, false);
</span><span class="cx">       break;
</span></span>
</div>
</div>

</div>

Gmane