In a 12-inch skillet or Dutch oven, heat the olive oil over medium. Add the onion and rosemary, cooking for 4-6 minutes, stirring occasionally until softened. Add the garlic and red pepper flakes, cooking until fragrant, about 1 minute.
Add the broccoli and cook, stirring, for 3-4 minutes until it begins to soften.
Stir in the white beans, broth and ¼ tsp black pepper. Bring to a boil, then reduce the heat to low and simmer, mashing some beans to thicken the mixture, about 6-8 minutes.
Remove from heat, stir in the lemon juice and the parmesan or pecorino. Taste and adjust salt and pepper. Serve in shallow bowls topped with additional parmesan and with toasted bread on the side.