Changeset 82dcd25 in mainline
- Timestamp:
- 2019-04-06T16:14:01Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3ef901d0
- Parents:
- 46e886f
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/include/arch/mach/malta/malta.h
r46e886f r82dcd25 41 41 #include <typedefs.h> 42 42 43 #define MALTA_PCI_BASE PA2KSEG1(0x18000000UL) 43 #define MALTA_PCI_PHYSBASE 0x18000000UL 44 45 #define MALTA_PCI_BASE PA2KSEG1(MALTA_PCI_PHYSBASE) 44 46 #define MALTA_GT64120_BASE PA2KSEG1(0x1be00000UL) 45 47 … … 49 51 #define ISA_IRQ_COUNT 16 50 52 51 #define TTY_BASE (MALTA_PCI_ BASE + 0x3f8)53 #define TTY_BASE (MALTA_PCI_PHYSBASE + 0x3f8) 52 54 #define TTY_ISA_IRQ 4 53 55 -
kernel/genarch/src/drivers/ns16550/ns16550.c
r46e886f r82dcd25 39 39 #include <genarch/drivers/ns16550/ns16550.h> 40 40 #include <ddi/irq.h> 41 #include <ddi/ddi.h> 41 42 #include <arch/asm.h> 42 43 #include <console/chardev.h> 43 44 #include <stdlib.h> 45 #include <align.h> 44 46 #include <str.h> 45 47 … … 143 145 * 144 146 */ 145 ns16550_instance_t *ns16550_init(ioport8_t *dev, unsigned reg_shift, inr_t inr, 146 cir_t cir, void *cir_arg, outdev_t **output) 147 { 148 ns16550_instance_t *instance = 149 malloc(sizeof(ns16550_instance_t)); 147 ns16550_instance_t *ns16550_init(ioport8_t *dev_phys, unsigned reg_shift, 148 inr_t inr, cir_t cir, void *cir_arg, outdev_t **output) 149 { 150 size_t size = 6 * (1U << reg_shift); 151 ioport8_t *dev = pio_map((void *) dev_phys, size); 152 153 ns16550_instance_t *instance = malloc(sizeof(ns16550_instance_t)); 150 154 if (instance) { 151 155 instance->ns16550 = dev; … … 158 162 if (!instance->output) { 159 163 free(instance); 164 pio_unmap((void *) dev_phys, (void *) dev, 165 size); 160 166 return NULL; 161 167 } … … 176 182 177 183 ddi_parea_init(&instance->parea); 178 instance->parea.pbase = (uintptr_t) dev; 179 instance->parea.frames = 1; 184 instance->parea.pbase = ALIGN_DOWN((uintptr_t) dev_phys, 185 PAGE_SIZE); 186 instance->parea.frames = ALIGN_UP(size, PAGE_SIZE); 180 187 instance->parea.unpriv = false; 181 188 instance->parea.mapped = false;
Note:
See TracChangeset
for help on using the changeset viewer.