FreeBSD/sys/powerpc/mikrotik/platform_rb.c
/* Slicer operates on the NAND controller, so we have to find the chip. */
Slicer operates on the NAND controller, so we have to find the chip.
Slicer operates on the NAND controller so we have to find the chip .
static int
rb_nand_slicer(device_t dev, struct flash_slice *slices, int *nslices)
{
	struct nand_chip *chip;
	device_t *children;
	int n;
	if (device_get_children(dev, &children, &n) != 0) {
		panic("Slicer called on controller with no child!");
	}
	dev = children[0];
	free(children, M_TEMP);
	if (device_get_children(dev, &children, &n) != 0) {
		panic("Slicer called on controller with nandbus but no child!");
	}
	dev = children[0];
	free(children, M_TEMP);
	chip = device_get_softc(dev);
	*nslices = 2;
	slices[0].base = 0;
	slices[0].size = 4 * 1024 * 1024;
	slices[0].label = "boot";
	slices[1].base = 4 * 1024 * 1024;
	slices[1].size = chip->ndisk->d_mediasize - slices[0].size;
	slices[1].label = "rootfs";
	return (0);
}
static int rb_nand_slicer ( device_t dev , struct flash_slice * slices , int * nslices ) { struct nand_chip * chip ; device_t * children ; int n ; if ( device_get_children ( dev , & children , & n ) != 0 ) { panic ( " " ) ; } dev = children [ 0 ] ; free ( children , M_TEMP ) ; if ( device_get_children ( dev , & children , & n ) != 0 ) { panic ( " " ) ; } dev = children [ 0 ] ; free ( children , M_TEMP ) ; chip = device_get_softc ( dev ) ; * nslices = 2 ; slices [ 0 ] . base = 0 ; slices [ 0 ] . size = 4 * 1024 * 1024 ; slices [ 0 ] . label = " " ; slices [ 1 ] . base = 4 * 1024 * 1024 ; slices [ 1 ] . size = chip -> ndisk -> d_mediasize - slices [ 0 ] . size ; slices [ 1 ] . label = " " ; return ( 0 ) ; }
Slicer operates on the NAND controller, so we have to find the chip.
Slicer operates on the NAND controller so we have to find the chip .